Author Topic: RemoteIO-M series  (Read 11252 times)

EdmontonControls

  • Newbie
  • Posts: 2
  • I'm a llama!
    • View Profile
RemoteIO-M series
« on: November 05, 2008, 12:53:07 PM »
 ???
Hello, I am currently using two T100MD888 with comms using RS 485 to send info back and forth between each other.  The Master is sending out requests for values in the slave DM[] locations, this works fine, but when I get the values back in the Master they are out of range, ie they are jumping around from +1800 to -320000.  
From reading the info on the demo program in Trilogi I understood that the DM[] value was send to the master in HEX but was then converted into Decimal, am I wrong in thinking this?  If so, how do I convert the DM[]value in the master back into Decimal so that I can use it.

Thanks for the info


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:RemoteIO-M series
« Reply #1 on: November 05, 2008, 02:54:31 PM »
Are you using the NETCMD$ command? You may be interpreting the returned string at the wrong position which is why you are not getting the correct result. You should examine the return string (use online monitoring) and make sure that you receive the correct string and your program is extracting the data from the correct position.

Also rRemember that the DM value is a 16-bit signed integer so when you convert it to 32-bit number you have to take care of the sign conversion. When you read a DM value from a slave, you should first store them inside the master's DM location so that the data is the same precision and sign.

You can refer to the sample program "RemoteIO-Mseries.PC6" in the "samples" folder for an example of mapping a slave I/O to the master.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EdmontonControls

  • Newbie
  • Posts: 2
  • I'm a llama!
    • View Profile
Re:RemoteIO-M series
« Reply #2 on: November 05, 2008, 05:31:58 PM »
I did use the program RemoteIO-Mseries.pc6 from the trilogi files, infact, I copied the custom functions to my program and modified it enough to extract the DM data from the slave instead of just the I/O data.  
 I store this data from the slave directly into the same DM location in the master to make it easier to understand later.  I am still getting the mixed up sign and number from the slave.

I have used online monitoring to view what is happening and it appears to have the same mixed up sign and out of range data as what is appearing in the Master DM location.

What code would I use to correctly convert the number from 16 bit to 32 bit with the sign in the master?  Can you give me an example or is it covered in the example program?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:RemoteIO-M series
« Reply #3 on: November 06, 2008, 10:49:44 AM »
What command string are you using to obtain the DM from the slave?

You should try to examine the returned string from the NETCMD$ using online monitoring and check if the string is consistent. The data are stored in hexadecimal.

Also try to assign the extracted substring into a string variable so that you can check if you have extracted the correct portion of the string data.

e.g.   B$ = MID$(A$, 3,4) will extract 4 characters from the string A$ starting from the 3rd character.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS