From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 pump control via Labview

Solved!
Go to solution

Hello,

I have a system with a pump whose control interface is RS485 db15 (2 wires). I have connected a USB to RS485 adapter, which I plugged into my computer (see attached picture).
I want to be able to control the start and stop of my pump with Labview.
Do I have to use the Modbus protocol or can I use VISA directly? How do I go about it? I am new to Labview.
Thank you in advance for your answers.

0 Kudos
Message 1 of 26
(1,994 Views)

If it is true RS485, you don't need Modbus, you can use the VISA functions to communicate.

 

This is an excellent tutorial - https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 26
(1,964 Views)

You should probably also wire the ground (GND) connection. If the USB converter is not galvanically isolated there is however a change of a ground loop that way but that depends entirely on how your computer and pump are grounded to earth if at all.

 

But without ground connection the differential output is usually floating and then you get an unreliable communication due to limited common mode voltage rejection.

 

And to how to talk with the pump that depends entirely on the pump. It may talk Modbus or any of the other zillion possible protocols, including an entirely homebrewn one. But you do have a programmer reference manual for it, don’t you? Without such a document you could pretty much shout in the air and hope that the pump will do anything. It’s similarly likely to work than trying to send random bits and bytes to the device.

Rolf Kalbermatter
My Blog
Message 3 of 26
(1,937 Views)
Solution
Accepted by nicos1712

Some manufacturers swap the A end B connection of their devices.

I had a discussion with one of them and he was telling me that it was a Transmit and Receive line !!!

 

So also try to swap the two lines. And like Rolf said use the 0V connection and RTFM

 

Kees

Message 4 of 26
(1,913 Views)

Hello Kees,

 

Thank you for your reply.

I had already read the pin assignment diagram for my pump (see attachment). If I understand correctly, I have to connect pin 2 "485 Interface A" and pin 9 "485 Interface B", as well as a pin "E-c Ground" (any pin)?
I have already made these connections, except for the ground.
Do I need to add anything else?
Thank you very much for your help.

 

Nicolas

0 Kudos
Message 5 of 26
(1,886 Views)

Hi Nicolas,

 

The connection are Ok. But if it still does not work I would try to swap the A and B wire, just to be sure that this is not the problem.

If the RS-485 connection is very long you should also use terminators. If it is short (< 2 meter) it should work without terminators.

 

First let me know if swapping the wires solved anything.

 

What is the protocol that your device is using ?

 

Kees

0 Kudos
Message 6 of 26
(1,863 Views)

Thanks.

And do I have to plug in the ground too or is that not important?
The manual tells me that the interface supports a Modbus communication protocol.

 

 

 

0 Kudos
Message 7 of 26
(1,840 Views)

Yes, connect the 0V (ground)

 

In your first message you said you can start and stop the pump. How did you do that ??

0 Kudos
Message 8 of 26
(1,816 Views)

Thank you for your reply.

 

I want to be able to stop or start the pump with Labview. This is possible thanks to some pins in the pin assignment diagram (see attachment). In addition, a paragraph in the user manual tells me how to operate the external control (see attachment).
But, with the 485 A and B interface and the Ground, can I still control the start/stop of the pump or do I have to use the "Start/stop" pins?


Thanks again.

 

0 Kudos
Message 9 of 26
(1,786 Views)

Hi,

 

This piece of short text tells something about the wire functions.

Maybe you should share more information about the pump. 

Manual with a description of the ModBus interface ?!??

 

Kees

0 Kudos
Message 10 of 26
(1,751 Views)