rs485 2w and 4w comms

lbric

Member
Join Date
Jul 2013
Location
Bell Gardens CA
Posts
27
Hello,

Not an expert at all in comms need some help trying to figure something out. I have a plc and hmi that i am trying to establish rs485 communication betwen the two. my plc is knockoff mitsubishi fx3 that has rs485 a/b terminals. my hmi is a weintek with a db9 port and i am using ezbuilder pro software to program it. the hmi software plc driver is setup for a mitsubishi fx3 rs485 4w which is what it recommends for this brand/model.

the hmi manual shows me that pins 1/2 are rx+/- and pins 3/4 are tx/-

i have connected the rx/tx + to the b(-) terminal on my plc and the rx/tx + to the a(+).

when i power up the plc i can see the value i have stored in my test register for a split second then i get an error message "device no response". I can reboot the hmi and again see my value on startup but then the error message appears.

not sure if i am missing doing something wrong in the wire connections or if its a plc issue. i have read about 120 ohm resistors being used to cancel reflections??? but not sure what that means. i tried placing a resistor across my a/b terminals but it did not produce any positive results. i am trying to achieve back and forth comms.

any help would be greatly appreciated.

thanks
Ricardo
 
Hello,

Not an expert at all in comms need some help trying to figure something out. I have a plc and hmi that i am trying to establish rs485 communication betwen the two. my plc is knockoff mitsubishi fx3 that has rs485 a/b terminals. my hmi is a weintek with a db9 port and i am using ezbuilder pro software to program it. the hmi software plc driver is setup for a mitsubishi fx3 rs485 4w which is what it recommends for this brand/model.

the hmi manual shows me that pins 1/2 are rx+/- and pins 3/4 are tx/-

i have connected the rx/tx + to the b(-) terminal on my plc and the rx/tx + to the a(+).

when i power up the plc i can see the value i have stored in my test register for a split second then i get an error message "device no response". I can reboot the hmi and again see my value on startup but then the error message appears.

not sure if i am missing doing something wrong in the wire connections or if its a plc issue. i have read about 120 ohm resistors being used to cancel reflections??? but not sure what that means. i tried placing a resistor across my a/b terminals but it did not produce any positive results. i am trying to achieve back and forth comms.

any help would be greatly appreciated.

thanks
Ricardo
I am ALSO not an EXPERT. But I have worked on a bunch of similar stuff ;)

It appears to be working for you on startup - so your wiring is good. (tx, rx, + and -)

The 120 ohm resistor is a terminating resistor, and you should have one on each 'end'. Between A/B on the PLC, and between RX/TX+ and RX/TX- on the HMI end. That should not be required for a few feet on your work bench. But it's something to try out.

The 'reflections' are due to changes in impedance in the wiring, between the wire and the HMI or the wire and the PLC. There is a bunch of math and a bit of physics to the explanation that I honestly don't remember much about. But it's a real thing and we use terminating resistors on RS485, Canbus, and most other 2 or 4 wire networks that have more than 2 nodes, or extend more than a few feet.

As for changes, I would try to slow down the baud rate on both to as slow as they go. This is usually 300 baud, or 2400 baud.

Another suggestion is to find a setting on the HMI for retries, and increase that if you can. Another setting, timeout, could be increased as well.

Try one thing at a time. The wiring stuff you can leave in if it does not appear to help ... since it won't hurt. If the setting changes don't work, you might want to change the setting back to where you started since things will run slower if you leave the setting changed before you go on to the next change.
 
Does the HMI have an option for Mitsubishi FX3 RS485 2-wire? Have you tried using that? Your description sounds like 4-wire on the HMI end and 2-wire on the PLC side which is effectively 2-wire.

The serial protocol uses a command/response model. The HMI sends a command to the PLC and the PLC responds. A command could be a request to the PLC to send some data to the HMI (Read), or a request to change some value(s) in the PLC (Write).

Four-wire communication means that commands from the HMI to the PLC go out on one pair of wires and the responses from the PLC to the HMI go out on the other pair. Two-wire communication means that the commands from the HMI to the PLC and the responses from the PLC to the HMI ride on the same pair of wires.

With four-wire, the HMI can send the next command to the PLC as soon as it receives the beginning of the response to the first. With two-wire, the HMI must wait until the end of the response to the first command before it can send another command.
 
if it's 2 wire communications then both transmit and receive us the same pair
both Tx+ and Rx+ get tied together and Tx- and Rx- get tied together

RS4865 is multi node setup with one or more masters and multipole slaves
the master Tx is connected to the Slave Rx
4 wire allows for both transmit and receive at the same time with 2 wire the master sends a request and waits for the slave to reply
the communication protocol packet must contain the master node and slave node address's so the control knows to respond
 
+1 to changing it to 2 wire and wire accordingly.

PLC no response comes up whenever the Weintek tries to: read an address that doesn't exist
Write an address that doesn't exist

For troubleshooting, create a blank project with just the one functioning tag and nothing else.

Write back with successes or if you get a different problem
 
Jumpering Tx+ to Rx+, Tx-to Rx-

Jumpering Tx+ to Rx+, Tx-to Rx-

Just a heads up: on the latest USB/RS-485 converter with an FTDI chipset and screw terminal block (instead of DB9), 2 wire, half duplex operation failed when I routinely jumpered what I thought were Tx+ to Rx+, Tx-to Rx-, like I’d done on earlier 485 converters.

When I removed the jumpers and used just 2 connections, it worked fine. I remember having to analyze the tiny silk screened script characters identifying the terminals and can’t recall the ones used for half duplex (it’s not here to examination).
 
It looks like everybody is looking towards the same answer but there is some terminology that's not being used that is (in my best guess not having used either pieces of equipment) what's causing the issue and that's "Full Duplex" and "Half Duplex". RS485 on two wires must be half duplex (and isn't really two wires, it should be three) with most protocols (the language, not the signal levels) only having one master to multiple remotes. RS485 on four wires is usually full duplex with a transmit pair from the master to the remotes and a transmit pair from the remotes to the master. With the HMI set to RS485 four wire, it's likely acting as a full duplex master and whenever it transmits it hears itself and gets confused. This is assuming some things about how the port is labeled which I won't go into detail but it makes sense that you get one data packet going one way and then failure I.E. the PLC sends the data, the HMI responds and then it stops. Without knowing the specifics of your HMI, I was able to see that most of Weintek's HMI support RS485 two wire so as mentioned previously, that should be the setting you would want to use.
 
Thanks for your reply,

i think the baud rate i have to leave at 38400 in order for the communication to work on plc. i will try the resistors and increasing timeout and retrys
 
Hello

thank you all for your feedback. i think i tried the 2w setup with no success but i am going to try again maybe i had the +/- wires backwards. this is a bench setup so the wiring is minimal but i will try those resistors as well. increasing timeout and retry also sounds like something to play with. my program is just like AustralIan mentioned 1 simple tag with an 16 bit integer.

i also have an rs232 port on both devices. is the pin out on a db9 the same on all devices? i can also set the hmi driver to rs232. the hmi manual has db9 pins 2/3 rx/txD and pin 5 GND, and pins 7/8 rts/cts. i think i would just flip flop the rx/tx connections and leave the rest the same to achieve a connection.

thanks
Ricardo
 
Thank you all for your replies, some times i fear no one will chime in but it was encouraging to have some feedback. just wanted to update that i was able to make things work.

the mitsubishi fx plc has a register where you can set communication protocols, D8120. i found that it was set to 7,E,1,38400 by default. i was able to modify it to 8,E,1,9600 (did the same on the HMI) and after that i started seeing intermittent comms my value would drop in and out quite rapidly. then i set the HMI driver from 4w to 2w and that was the winning combination. just for kicks i tested a 2w 7,E,1,9600 setup with no success. i think the key was changing the data bits from 7 to 8 along with the 2w driver setting. hopes this helps someone in the future
 

Similar Topics

Hey, Long time reader but first time poster here! I need some input/advice with the following problem: I need to write code for M340 that will...
Replies
6
Views
1,609
Hi guys Just wondering if anyone has succesfully read barcode data from these barcode scanners to a plc via rs232 or rs485? If so do you guys have...
Replies
0
Views
1,469
hello everybody, i am wondering if anyone can help me with a little problem im having, i have a standard (4/5 wire) usb to RS485 adapter, and i...
Replies
0
Views
1,775
Can anyone shed light on this: I have an RS485 Modbus setup currently with an ML1100 and a Multitek DMM, 8E1. 8N1 will not work, because the...
Replies
1
Views
2,238
Got a small project that involves several mitsubishi FX1N talking to a FX2n. Comms is done via the RS485 card attached to the FX's. Problem is...
Replies
4
Views
2,649
Back
Top Bottom