Author Topic: NETCMD RI00  (Read 11875 times)

pjuangph

  • Newbie
  • Posts: 7
  • I'm a llama!
    • View Profile
NETCMD RI00
« 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))


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:NETCMD RI00
« Reply #1 on: June 14, 2012, 04:25:25 PM »
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.



« Last Edit: June 14, 2012, 04:26:00 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

pjuangph

  • Newbie
  • Posts: 7
  • I'm a llama!
    • View Profile
Re:NETCMD RI00
« Reply #2 on: June 15, 2012, 06:58:33 AM »
I see, thanks, I didn't know to ignore the stuff after the 4.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:NETCMD RI00
« Reply #3 on: June 15, 2012, 09:32:31 AM »
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.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS