GetData(d5,"MODBUS RTU",4X,5,1) //值为 0
GetData(d6,"MODBUS RTU",4X,6,1) //值为 49
GetData(d7,"MODBUS RTU",4X,7,1) //值为 979
zl=d5*65535+d6+d7*0.001
GetData(dm10, "Mitsubishi FX2N", M, 10, 1)
GetData(dm11, "Mitsubishi FX2N", M, 11, 1)
GetData(dm11, "Mitsubishi FX2N", M, 12, 1)
SetData(zl,"Local HMI",lW,0,1) //原件 显示 为0 异常
set语句位置移动下就正常了
GetData(d5,"MODBUS RTU",4X,5,1) //值为 0
GetData(d6,"MODBUS RTU",4X,6,1) //值为 49
GetData(d7,"MODBUS RTU",4X,7,1) //值为 979
zl=d5*65535+d6+d7*0.001
SetData(zl,"Local HMI",lW,0,1) //原件显示为 49.979 正常
GetData(dm10, "Mitsubishi FX2N", M, 10, 1)
GetData(dm11, "Mitsubishi FX2N", M, 11, 1)
GetData(dm11, "Mitsubishi FX2N", M, 12, 1)
变量和 setdata 之间不能有其他的getdata 语句么。 |