LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multidrop with RS-485

Hello all,

 

as a semi rookie to VISA read-write (only really done some basic stuff with this!), I was hoping to get a hand with altering my program to work with multi drop over RS-485. 

 

The VI attached will ,as you can probably tell, just uses VISA read-write to grab data from a pre-determined register (AC) which in this case happens to be a temperature reading from a flow-meter. All fairly straight forward.

 

The issue comes with the fact that I am now trying to daisy chain ten of these flow meters together and read the same register from each of them (the register is called AC on all ten of the flow meters since they are identical). They will all be daisy chained and then read by the computer over an RS-458 to USB conversion through the came COM port. It's been recommended to me that the best way of doing this not using LabVIEW would be multi drop although I truly have no idea how to go about implementing this in LabVIEW! Or perhaps there is an easier alternative I'm not seeing short of going into each flow-meters and changing the names of the temperature register I'm trying to read on each one to make them different (which will be a nightmare).

 

All help ideas welcome but helpful ones are always the best!

 

Thanks.

 

P.s. sorry for my LabVIEW programming etiquette, I'm trying my best!

0 Kudos
Message 1 of 6
(3,401 Views)

I cannot view your vi because of my old LV version, however I can say that multi-drop works if the communication protocol is of master-slave type (that is: command-answer) and the command format contains an "address". Assigning a different address to each flow-meter, it is possible to poll data sequentially; after each command, only one device will answer (the addressed one).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 6
(3,377 Views)

Yeah that is how it's set up at the moment, but the address on the flow meter I want to read is the same for all ten so commanding that address will be an issue since it would be the same address for all of the flow meters and therefore LabVIEW won't know from which flow meter I am commanding data from... surely? The only solution I see is to buy a shed load of USB to RS-485 adapters and connect each flow meter to a different COM port to differentiate between each of them, but if I can find another way it would be great to save the money.

0 Kudos
Message 3 of 6
(3,374 Views)

Also I know its bad form but I've attached a screen shot of the vi since you can't view it 🙂

0 Kudos
Message 4 of 6
(3,368 Views)

So the command is a simple AC\n which does not contain even the shadow of an address.

In this case it's not likely you can get back any data because all devices will try to answer at once or so.

If there is no other command format available, as you wrote yourself, you need providing one serial port for each device (or  change the register names, do you really can do this? it seems unusual to me).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 6
(3,359 Views)

Without knowing what device you are using there is no way in telling you much more. It could be that your devices support multidrop (a good chance if they really use an RS-485 and not RS-422 or RS-232) but that they are currently configured to operate in single device mode.

The way this usually works is that you would get an utility program that you can use to access your device and program a device address into it. Sometimes assigning a device address is all that is needed, sometimes one needs to explicitly enable multidrop operation somewhere. If the device is really old there is a chance that it has DIP switches that allow you to enable multidrop support and assign an address.

 

After the device has multidrop enable, you have to usually prepend the command with the device address such as 

\4AC\n for a device with the device address 4.

If your device does not support multidrop operation or you can't find how to configure it for it, then you can not connect them all to the same RS-485 bus. In that case all of them will recognize the AC\n command and respond to it, creating a bus collision that corrupts any answer from the devices.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(3,342 Views)