向大家请教一个问题,我有一个自由通讯协议的宏,在编译时,有两句错误语句,OUTPORT(td[0],“MODBUS RTU Device”, 7) 和
INPORT(rd[0],“MODBUS RTU Device”, 15, return_value),参数设置有错,错误代码是C30。我怎么也看不出错误。请达人你们,请教一下。全部程序如下:
macro_command main()
char rd[16],td[7]
short return_value
float result
FILL(td[0], 0, 16)
FILL(rd[0], 0, 16)
td[0]=0X3A
td[1]=0X30
td[2]=0X31
td[3]=0X44
td[4]=0X37
td[5]=0X46
td[6]=0X0D
OUTPORT(td[0],“MODBUS RTU Device”, 7)
INPORT(rd[0],“MODBUS RTU Device”, 15, return_value)
SetData(return_value, "Local HMI", LB, 50, 1)
if (return_value > 0 and rd[3] == 0x44) then
ASCII2FLOAT(rd[4], result, 8)
SetData(result, "Local HMI", LW, 10, 1)
end if
end macro_command |