ÇØ´ç ÀÛȸ¦ Àüü´Â Àü´Þµå¸±¼ö°¡ ¾ø°í ¸ÅÅ©·Î Àüü º¹»çÇؼ ÷ºÎµå¸³´Ï´Ù
macro_command main()
unsigned char command[10], response[10]
short return_value, sum=0, i, rpmset
short result[16]={0}
FILL(command[0], 0, 10)// init 0-31 0
FILL(response[0], 0, 10)
command[0] = 0x49 // "I"
command[1] = 0x53 // "S"
command[2] = 0x01 // 0X##(1~64)
command[3] = 0x05 // CMD
command[4] = 0x00 // DATA1
command[5] = 0x00 // DATA2
command[6] = 0x00 // CHECKSUM ---->7°³
for i = 0 to 5 step 1
sum=sum+command[i]
next i
command[6]=sum
OUTPORT(command[0], "MODBUS RTU Device", 7) // ¸í·É º¸³»±â
INPORT(response[0], "MODBUS RTU Device", 10, return_value)
SetData(return_value, "Local HMI", LW, 51, 1)// return_value == 0 -> error
//SetData(return_value, "Local HMI", LW, 10, 1)// return_value == 0 -> error
SetData(response[0], "Local HMI", RW, 10, 10)// send response to LW
end macro_command