将经过值写入高速计数器通道
此指令将经过值写入iChannel指定的高速计数器通道。
输入
要写入iChannel所指定通道的经过值
高速计数器通道:
FPS: 0, 2
FP-X R: 0, 1
FP-X 16K C14T: 0, 1, 2
FP-X 32K C30T, C60T: 0, 1, 2, 3
FP0R: 0, 1, 2, 3
FP0: 0, 1
FP-e: 0, 1
所有用于编程此函数的输入和输出变量已在POU头中声明。 所有编程语言使用相同的POU头。
VAR
bWrite: BOOL:=FALSE;
diElapsedValue: DINT:=5000;
iChannel: INT:=0;
END_VAR
当变量bWrite从FALSE变为TRUE时,由diElapsedValue指定的经过值被写入由iChannel指定的通道。
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 2 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,HscControl_WriteElapsedValue!,,12,0,27,5,,?DEN?DdiElapsedValue?DiChannel?AENO);
B(B_VARIN,,diElapsedValue,10,2,12,4,);
B(B_VARIN,,iChannel,10,3,12,5,);
B(B_CONTACT,,bWrite,4,1,6,3,R);
L(1,2,4,2);
L(6,2,12,2);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if DF(bWrite) then
HscControl_WriteElapsedValue(diElapsedValue := diElapsedValue,
iChannel := iChannel);
end_if;