Author Topic: 485 communication  (Read 12110 times)

ashish

  • Newbie
  • Posts: 25
    • View Profile
485 communication
« on: March 23, 2009, 08:54:49 AM »
i am using t100 md 1616 controller for my system.


i have connected bar code scanner to serial port com1 and read the bar code data

through that port and operate some i/o logic depending on bar code i receive.
plc id is 01.

now,i connect a pc to com3 i.e 485 communication port.
i want to read the status of controller IO on PC .
i am using auto turn around type rs 232-485 converter to connect pc to 485 port of controller.cable used is 2 core shielded cable. cable length between pc and plc is 40 meters.


but i can execute only "IR*" command & for any other command i get message "No response from plc"
i tried with RI command in following format
  "RI01*" it does not work.
i tried with another format
  "@01RI0100*" but this is also not working.
no other command is working through 485 port other than IR*
communication baud rate set is 38400.
also, when i start TL server + TRilogi software and click on "Detect ID" button

in Controller -> select controller menu, then it detects the id properly as 01, but when i click on connect, it fails.


Since it is executing IR* command and shows plc id, i think converter unit should be ok.


« Last Edit: March 23, 2009, 08:59:53 AM by ashish »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:485 communication
« Reply #1 on: March 23, 2009, 03:38:54 PM »
Can you try to connect the PLC via your 485 adapter in short distance (a few feet of twisted pair cable) and see if it works.  If it still doesn't work at short distance then the converter may not be compatible. Try our Auto485 which should work.

If your adapter works at short distance but having problem at long distance (40 meters is quite long) then you will probably need to do several things:

1) Use pull up and pull down resistors to provide bias voltage to the RS485 signal pairs.

2) Add a 120 ohm terminating resistor across the "+"and "-" RS485 terminal at the end of the RS485 bus.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ashish

  • Newbie
  • Posts: 25
    • View Profile
Re:485 communication
« Reply #2 on: March 23, 2009, 06:43:16 PM »
ok. thnks. i will check it out.

richard2511

  • Newbie
  • Posts: 7
  • Good things come in small packages !
    • View Profile
    • Ricardo Schelp & Asociados
Re:485 communication
« Reply #3 on: March 24, 2009, 02:35:47 PM »
I may think there may be some further comments regarding this topic, as follows:

- RS485 is supposed to be a two wire network, which isn't exactly true. Ground potential differences between connected devices may cause a lot of trouble. Both devices having different power supplies will do for this situation quite fast. Line termination and polarization, as already suggested, may not always help, as introduced potentials may be higher than the threshold potentials defined by the line transceivers. Best solution I found was running a third wire to level ground potentials of connected devices, and this shouldn't be using some eventual shielding available on the twisted pair, as this layout may produce so called ground loops, and remedy could be worse than illness. Having a third wire, may not be the only issue to solve a ground potential problem, and some depends on how the power supply layout is done. Best way to have no problems is having just one ground potential reference point and converging all shielding and third (controller ground) wires tied there, and giving the remote devices no local ground reference (difficult some times ...), or having opto coupled and more expensive 485-232 converters.

- From your writing I understand you used no FCS and so called wildcard FCS on commands you tested. I found this will not allways work reliably, probably for the multiprotocol capabilites TriLogi controllers have. Doing the real thing, to say calculate the FCS and add it to the string you are sending to your t100 will perhaps show something different and is in any case a good practice for reliability on results, even if you don't FCS check what is coming from the controller, later. In any case, something else you may try, is to copy the status of your inputs or outputs into a memory position with a function called by one of the timing flags available at the Special Bits area, and then read it with an RVD command. The direct input and output communication commands may behave quite particular under certain program layout conditions and responding to the fact that answering the command coming from your PC means an interrupt and some timing problem to solve by the controller. You may also give the SETPROTOCOL statement a chance to prevent your controller from understanding something wrong, to say, eventually limit your experiments to just one communication protocol.

- The last issue on this problem may be timing, as not all 485-232 adapters have some (smart ?) way to control this, and depend on the control lines (RTS, CTS, etc.), and not just the Rx and Tx signals coming from your PC. Besides, some strange interpretation on RS232 standards introduced by some component and PC accessory makers are doing some more in this sense. Posts at this forum regarding USB adapters tell lots about. I may most warmly recommend the suggestion, made by Support, earlier, on using the TriLogi's Auto485 adapter to solve problems in this sense. The adjustable timing feature (potentiometer) it has, while in Auto mode, may solve most problems you may find regarding timing issues on RS485, as long as packets coming and going are quite similar sized in length. In any case and if these packets may have quite different sizes, fixed timing may be problematic and other solutions, involving hardware handshake, and running out of the scope of this post, should be used.

Final note: do not try to communicate -and- monitor your controller over the same line and at same time ... nothing prevents from doing this, and you may think your pc and t100 have run into some higher state of mind on an overdose of electrons.
 :)