Experience with RS485, Modbus RTU - please help

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

aamcle

Well-Known Member
Joined
Jan 7, 2013
Messages
492
Reaction score
53
Hi.
Does anyone have experience?

I need some help my PID has RS485 built in, its 2 wire +ve and -ve.

I'm connecting PID to an RJ45, then a network cable to comport/USB adapter and on to a notebook with Win7 and PID manufactures software.

But software cannot detect the PID!!!

As far as I can tell from the information I've found the RS485 +ve goes to 4 and the -ve to 5 in the RJ45, is this correct?

The Pid settings are Baud 9600, parity even, DL 7, SB 1, Modus RTU. I have reflected those settings in the software and in the setup of the comport (Com3).

I'm stuck, I can't think of anything else to try unless I'm connecting the + and - to the wrong terminals.

Any help much appreciated.

Aamcle
 
Are you sure your comport usb adapter is RS485 compatible? Many that I have seen are DB9 ports that are RS232. Does your PID use a RS485 DB9 or 4 wire pinout? How are you connecting the 485 to RJ45 adapter (assuming DB9 based) on the PID? On the other end I'm assuming you are using the reverse... a RJ45 to DB9 to USB com port? Can you check your ethernet cable and make sure you are not using a crossover cable... longshot but it might be it.

Here is a 4 wire to DB9 connector pinout for reference in case you didn't have one.
 
1 I bought the adapter as a USB to Rs485
2 there are no Db9s involved.

I am connecting two wires from the data outputs on the PID directly to the Rj45 (wall plate type) a network cable connects the rj45 to the adapter. The adapter plugs into a laptop.

The most likely I can are issues I can see are

Am I connecting the 2 wires +ve and -ve to the right points on the RJ45 ?
Is the adapter actually the right one?
It is listed in device manager as a com's port there are no additional entry's as network ports.

What do you think?

Aamcle
 
Can you post a picture of your connection between the RS485 and the RJ45 on both ends? My guess is something isn't matched up. Also, are you connecting your computer into a wall jack somewhere and your PID is somewhere else? If so, there is no network switch involved, right?

**Also, can you post a link to the PID you are using?**
 
Rivercity has you on the right track, and I'd also like to see the PID being used.

Additionally, if you think polarity is an issue, reverse it, it's just two wires. Also, if you have the choice configure it for 8 bit DL, unless that's all the PID can do.

Do you have modscan32? If you cant pick it up with modscan or similar app, you won't be able to take it any further to do any other programming with it.

Jason
 
What information do you have on your RS485 to USB adapter. That should tell you what pins to connect the data+ and data- to.

Also make sure your ethernet cable is not a crossover cable.
 
I would like to know more about what software you are using. You mentioned that the PID is Modbus RTU correct? I would suppose that it is a modbus slave in that case and that the software you are using must be a Modbus master correct? How are you mapping the modbus registers? Or are you even that far into it yet? I work in the building automation control industry so I have quite a bit of Modbus experience from an integration point of view. This thread as piqued my interest as I haven't seen it WRT to brewing - but take that for what it is worth as I haven't dipped my feet into automated brewing yet. I intend to design a BACnet brewing system as my kegerator is already BACnet.

I digress, the point I am trying to get at here is, are you sure it is a wiring problem and not an issue with the modbus communication?
 
200 ohm termination resistor would be a good idea, but not likely to make a difference. I've left them off a lot of times, even on long bus runs, no problem.

Modbus uses a slave ID. Do you have that matched up between the host and device?

Are you sure the PID is using binary RTU and not the ASCII packeting?

Are both sides using the same CRC checksuming (this is standardized, not likely to be a problem, but who knows).

Turn off all flow control (RTS, DSR) on both sides, if it's an option.

Try downloading modbux poll. It's a pc app that will open the virtual comm port presented by your USB adapter. It should be able to read registers in the PID.

Do you have a friend with a oscilloscope? Pretty simple to look at the packets and see where it's failing. RS485 is a poll/respond protocol, so the host (PC) will always send a msg asking for data, and the slave (PID) will reply immediately. Would be good to know which side is failing.
 
It is not using ASCII I set it up through the PID front panel. I have checked that there is voltage getting as far as the Rj45 so I'm getting an output from the PID.

I have software from Omega that should find and alow me to control the PID, but its not finding it which is why I'm suspecting something in the connections between the Cn7500 and the PC.

So I'm still not convinced that the +ve and -ve wires off the PID are connected to the correct terminals I'm also not entirely sure about that adapter.

Is it possible to check the adapter I what it's supposed to be?


Atb. Aamcle
 
Can you eliminate the RJ45 piece temporarily to see if you can make a direct connection work between the PID and your PC?
 
Modbus RTU normally is 8 bit, Odd parity, 1 Stop bit
The line needs to "fail safe" to the "1" position, usually the voltage difference between line + and line - should be positive when nothing is going on
 
If available, I would add the com ground connection. RS485 can work as 2 wire(done it for testing), but its really a 3 wire network. Any robust 485 network will use the 3 wire config.

Good link for explanation:
http://www.chipkin.com/rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485/
More comprehensive description:
http://www.bb-elec.com/Learning-Cen...ook/RS-422-RS-485-eBook-graphics-embedded.pdf

Definitely get one of the modbus tester programs that were mentioned.

I'm not at my home comp but I think I've used:
http://www.chipkin.com/products/software/modbus-software/cas-modbus-scanner/

The software has a "discover" option that you can use if you don't have good documentation on what the default settings should be. It will try the different combinations of modbus connection settings until it finds one that works. If you can't get it to communicate with that software, then I triple check the wiring(try reversing the signal wires), throw a termination resistor on there, and if there's no com terminal on the PID to run a ground then you probably want to consider an optically isolated usb connector. They're a bit more expensive but will also give added protection against frying your comp if you miswire.
 
I've ordered a 2 wire adapter like the one I linked above, it will eliminate connection issues as I only need to go +ve to +ve and so on.
I'm not expecting the part before Wednesday so I'll wait and investigate the programmes members have been good enough to link to and look into using a ground wire.

Thanks All.

Aamcle
 
Back
Top