Internet PLC Forum
General => Technical support => Topic started by: pjuangph on June 14, 2012, 04:00:54 AM
-
I'm trying to read the first 4 inputs of Nano using RS485 and NETCMD.
I'm getting a response back of
@02RI0059 ' No inputs on
@02RI045D ' 1 input is on
I'm not sure how to read this
Z$ = NETCMD$(2,"@02"+"RI00*")
DM[100] = HEXVAL(MID$(Z$,6,4))
-
The inputs are represented as 8-bit hexadecimal number
So since you get a response RI04 rewrite it in binary it is
0000 0100
- this means input #3 is turned ON.
-
I see, thanks, I didn't know to ignore the stuff after the 4.
-
The 5D in this case is the FCS (frame check sequence) which is an error checksum where the PLC will determine if there is any error in the response string. You can simply ignore them since NETCMD$ automatically checks the FCS command on your behalf.