Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Distinguishing Between Multiple Serial Devices of the Same Model

Hello,

 

I am updating 8 test rigs that turn and measure the torque applied to multi-turn valves. For each rig, two serial connections are sent to a PC so I have 16 different devices where 8 devices are one model and another 8 are a different model. My problem is that I need to distinguish which device is sending/receiving information based on both its rig and its model.

 

The devices in question are Interface's Model 9834 Torque Sensor Indicator and Automation Direct's Model 4850 Stepper Motor Driver. Both of these devices use an RS-232 protocol. I thought that one way of distinguishing between these devices was to send a command to each device that asked for some kind of identifier for the device and compare it to the id of the device that I was looking for. However, after talking to both company's tech support, there is no such identifier command.

 

My next idea was to route these devices through a cDAQ because I know how to programmatically id the cDAQ through its serial number. However, the only C module that I found which supports RS-232 is only supported by cRIO which is out of my budget.

 

I am a bit stumped at this point. Does anyone have an idea on how I can programmatically identify which device is sending/receiving information from the PC?

 

Note: The current program hard codes the com ports that the serial connections are assigned to but this is problematic since the rigs needs to be more mobile and unplugging and plugging these rigs can change how the com ports are assigned.

 

0 Kudos
Message 1 of 12
(4,801 Views)

Hi

Instead of a crio I would use an arduino as an intermediate interface .

Cheap and it only is used to identify and for all other commands it sends the serial info further and also transmits to you what it receives from the device.

greetings from the Netherlands
Message 2 of 12
(4,785 Views)

Seems like you will need to set all displays to the same value and then change one at a time and have the operator assign them.  Once they are initially assigned, you can save it to a configuration file then have the operator verify that the correct piece of equipment is being addressed prior to operation.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 3 of 12
(4,783 Views)

@JATHL wrote:

My next idea was to route these devices through a cDAQ because I know how to programmatically id the cDAQ through its serial number. However, the only C module that I found which supports RS-232 is only supported by cRIO which is out of my budget.


Unless that is part is locked away inside of the test rig, you are just moving the problem.  The technician can still swap the cables.  How similar are the data packets between the two sensors?  You might be able to distinguish from that.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 12
(4,772 Views)

Hello crossrulz,

 

The packets between the torque sensor and the stepper motor drive should be different. However, I am using multiple torque sensors of the same model and the same is true for the stepper motor drivers. I am having problems distinguishing between devices of the same make and model.

 

Also, the technician shouldn't have access to swap the cables. The only cable that they would have access to in the case that you highlighted is the usb cable that runs from the cDAQ to the PC and I know how to distinguish between the cDAQs on a system.

0 Kudos
Message 5 of 12
(4,767 Views)

Hi,

Maybe you can use serial-usb devices from FTDI. You can program a serial number into these devices.Even give it a name.

With the low level drivers from FTDI you can find the COM port number of the known serial numbers (names).

 

I used it for a portable test set-up. Several engineers could use this set-up with their own laptop. You never know which COM port is assigned to a serial-usb. This way I could solve this in my program without operator action.

 

Kees

0 Kudos
Message 6 of 12
(4,739 Views)

Hi Kees,

 

These serial-usb devices from FTDI seem to be what I'm looking for. However, I have some additional questions about your set-up.

 

1) Do you remember what serial-usb device that you were using from FTDI?

 

2) Did you use the D2XX drivers or VCP drivers to communicate to this device?

0 Kudos
Message 7 of 12
(4,727 Views)

Hi,

 

1)  Almost every FTDI USB-serial device can be used. I used the UM232R and FT4232H and some others. With the last one you have 4 serial ports. With these device you have to add the RS-232 devices for the interface.

But FTDI also have complete RS-232 devices based on the same chips.

 

2)  I used the D2XX drivers. I changed them all with Error cluster I/O and error handler. See zip file.

 

Kees

Message 8 of 12
(4,722 Views)

Hello Kees,

 

I finished writing some code that should search for the connected FTDI devices and return their com port number and serial number: 

Com_Serial_Info_FTDI.JPGI don't really know if this will work since I have yet to get a FTDI device to test it on. From your experience, do you believe that this code will work or is there something missing?

 

Note: The "False" part of the condition statement just returns constants and a false boolean to stop the while loop. Also, shoot out to abeaver with his thread post on finding the com ports of FTDI devices.

0 Kudos
Message 9 of 12
(4,690 Views)

Hi,

 

This is what I made some time ago. I think is is basically the same.

 

Kees

0 Kudos
Message 10 of 12
(4,688 Views)