LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor multiple devices on 232 bus

Hello All, Newbie here don't be too cruel. I need to be able to monitor different operational parameters from multiple (16 and growing) devices (Edwards Vacuum Pump XDS 6i) on a serial 232 bus. I have successfully created a VI that will send the correct Control functions and monitor the the different states (Temp, Amp draw, Maintenance hours, etc) to a pump with a specific address. However, the monitor function only works when only one pump is connected. The control functions (Start/Stop, Standby, AutoStart, etc) are fine. The monitor display only contains miscellaneous symbols @#*^%$#! in some of the different parameter read when 2 or more pumps are connected. I've attached the VI. Side note. I would also like to  be able to send some of the monitor parameters to an Excel file for a history.

0 Kudos
Message 1 of 13
(4,054 Views)

It's not exactly the same, but this article shows connecting multiple serial devices.  Does that help?

 

http://digital.ni.com/public.nsf/allkb/0A12C1142461275A86256FC0001D932E

 

Also, I would suggest that at this point in your coding, you should definitely look into writing yourself some subVIs.  Especially if you are going to be expanding beyond the two devices you have now:

 

http://www.ni.com/white-paper/7593/en/

0 Kudos
Message 2 of 13
(4,047 Views)

Let me add to that, you're controlling two devices with one COM input reference, don't you get a second reference when you plug in the second device?  If so, you need to give that one to your second loop.

0 Kudos
Message 3 of 13
(4,039 Views)

Each device has has it's own address that is in the command string to get the results, Example #01:01?V809 gets the amp draw for pump 1, where #02:02?V809 gets the amp draw in pump 2. These commands are in different loops.

0 Kudos
Message 4 of 13
(4,026 Views)

@StrongBad469 wrote:

Hello All, Newbie here don't be too cruel. I need to be able to monitor different operational parameters from multiple (16 and growing) devices (Edwards Vacuum Pump XDS 6i) on a serial 232 bus.


Do you mean that multiple devices are sharing a single RS-232 bus, which is nonstandard and usually a kludge involving diodes or multiplexers, or that each of your 16 devices has its own RS-232 link to the computer?

0 Kudos
Message 5 of 13
(4,023 Views)

It's on a single bus. MultiDropConnections.JPG

0 Kudos
Message 6 of 13
(4,009 Views)

I'm guessing this is something like Modbus, where in the string you send, there is identifying information on what device you are talking to, and each device has an address.

 

So in this case I might only have one COM port, but I can talk to N devices, because in the message I state which device I want to talk to.

 

I have done this but only in cases where the hardware supports daisy chaining and the message is repeated from one device to the next.  RS232 has two wires, a transmit, and a receive, and for two devices to talk to each other the wires are swapped, so my transmit goes to the other devices's receive.  If you add another device to the bus how would that work?  Well my transmit could go to the receive of N devices, which would be fine, but how would I get any data back?  All N devices will be sending data to my one receive line, and the data will be garbage.  If you don't care about the reply this might be an option, but I've never tested it, and suspect you will have noise issues.

 

In every case that I've used one COM port to talk to multiple devices, what I really am doing is talking to a device with two ports, a RS232 In and an RS232 Out.  Here is an image from the Lamda TDK Power supply which has this option.  I've seen environmental chambers, and process controllers, have similar options.

 

Power Supply Chaining.png

 

In this case I can send a message saying "Power supply 2 turn on to 100V", and that message first goes to the Power Supply 1.  It looks at the data and realizes the message isn't for it, so it does nothing and then sends it out to the next supply.  The next supply gets the message and does work, then sends a reply back.  Power Supply 1 gets the reply, realizes it isn't for it, does nothing, and sends the reply back to the PC.  In this manor every port only connects to one device.

 

If you need to talk to N devices, and you don't have a chaining method, you need to use N COM ports.  I've bought some 16 port COM devices that have a single USB adapter. Here is one that looks similar to the ones I've used in the past.

 

Edit:  Also is this RS-232 or RS-485?  Your image shows 485 which is different but two wire has similar limitations as RS-232.  In either case if you buy hardware be sure and buy the right communication type.

 

Double Edit:  Oh and you will only have one VISA reference for each COM port.  You can't open two references to the same port, so your software design may depend on the number you have.

0 Kudos
Message 7 of 13
(4,001 Views)

@StrongBad469 wrote:

It's on a single bus. MultiDropConnections.JPG


So if I understand you so far...

 

You can work with one device but not more than one?

 

If so you should look carefully into the options and settings of your RS-485 port device (#1 in your diagram) and the settings for your widgets (#2 in your diagram).

 

Going from an old memory...

 

RS-485 (see Wikipedia ) had both full-and half-duplex modes of operation. Your diagram indicates half-duplex because communications can only be in one direction at any one time.

 

In half-duplex mode there is general a master (#1) and slaves. The master queries the slaves and then should wait for the reply from the selected slave. When a slave is selected (addressed) it should put its data on the lines.

 

No if the slaves (#2 nXDS pump) is NOT playing by the rules one of the pumps could be replying when the other is talking. That will of course scramble the signal and result in garbage being received by the master.

 

So make sure;

your options and setting are configured to operate half-duplex,

Each device has a unique address,

The wiring including load resistors is all as dictated by the widgets.

 

NI Trace

 

should allow you to log the data to and from the port but I expect everything is going out fine but is garbled on the reply.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 13
(3,988 Views)

You got me thinking. I checked to see what the whole return message is. It includes the pump address and other info. The return message for pump 1 temp is #01:01=V808 -200;39. How would I only except a message from a specific pump number, #01:01,in the string box?

 

0 Kudos
Message 9 of 13
(3,978 Views)

I dug up the manual here; according the drawing on page 17 you have it wired correctly. 

Have you followed the procedure on page 18 to 'Assign a Multi-drop Address'? You haven't mentioned that you have and it certainly won't work until you do. If they are both assigned to the same address they will conflict.

 

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

0 Kudos
Message 10 of 13
(3,976 Views)