|
邀请回答
马上注册,享受更多特权
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
//读取
ETC_CO_SdoRead4_1(
xExecute:=SdoRead4 ,
xAbort:= ,
usiCom:=1 , //EtherCAT主站个数
uiDevice:=1001 , //从站的物理地址
usiChannel:= ,
wIndex:=16#200B , //对象字典中的参数索引
bySubindex:=16#0D , //对象字典中的参数子索引。
udiTimeOut:=100 , //可以设定以毫秒为单位的超时时间。如果在此时间内, 读取参数没有被执行,将生成一个错误信息。
xDone=> ,
xBusy=> ,
xError=> ,
eError=> ,
udiSdoAbort=> ,
abyData=>SdoRead4_1_Data , //读到的参数数据会被复制到这个4字节的数组中。
usiDataLength=> ); //读取字节的个数 (1,2,4)。
ReadLoad_1[1] :=BYTE_TO_REAL(SdoRead4_1_Data[1]);
ReadLoad_1[2] :=BYTE_TO_REAL(SdoRead4_1_Data[2]);
ReadLoad_1[3] :=BYTE_TO_REAL(SdoRead4_1_Data[3]);
ReadLoad_1[4] :=BYTE_TO_REAL(SdoRead4_1_Data[4]);
G_H_OD_ReadLoad_Left := (ReadLoad_1[1] + ReadLoad_1[2] * 255 ) / 10;
ETC_CO_SdoRead4_2(
xExecute:=SdoRead4 ,
xAbort:= ,
usiCom:=1 ,
uiDevice:=1002 ,
usiChannel:= ,
wIndex:=16#200B ,
bySubindex:=16#0D ,
udiTimeOut:=100 ,
xDone=> ,
xBusy=> ,
xError=> ,
eError=> ,
udiSdoAbort=> ,
abyData=>SdoRead4_2_Data ,
usiDataLength=> );
ReadLoad_2[1] :=BYTE_TO_REAL(SdoRead4_2_Data[1]);
ReadLoad_2[2] :=BYTE_TO_REAL(SdoRead4_2_Data[2]);
ReadLoad_2[3] :=BYTE_TO_REAL(SdoRead4_2_Data[3]);
ReadLoad_2[4] :=BYTE_TO_REAL(SdoRead4_2_Data[4]);
G_H_OD_ReadLoad_Right := (ReadLoad_2[1] + ReadLoad_2[2] * 255 ) / 10;
CASE Load_circulation OF
0:
SdoRead4 := TRUE;
Load_circulation := 10;
10:
IF TON_Load.Q THEN
SdoRead4 := FALSE;
Load_circulation := 0;
END_IF
END_CASE
TON_Load(IN:=(Load_circulation = 10) , PT:=T#8MS , Q=> , ET=> );
|
-
-
上一篇: 伺服后台软件应用下一篇: SV635N手册
|