02-22-2018
07:55 AM
- last edited on
05-07-2025
02:11 PM
by
Content Cleaner
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.
02-22-2018 02:02 PM
02-22-2018 02:43 PM - edited 02-22-2018 02:44 PM
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.
02-23-2018
04:57 AM
- last edited on
05-07-2025
02:11 PM
by
Content Cleaner
@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.
02-23-2018 07:41 AM - edited 02-23-2018 07:44 AM
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.
02-26-2018 02:07 AM
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
02-27-2018 08:02 AM
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?
02-27-2018 08:43 AM
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
03-02-2018 08:58 AM
Hello Kees,
I finished writing some code that should search for the connected FTDI devices and return their com port number and serial number:
I 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.
03-02-2018 09:09 AM
Hi,
This is what I made some time ago. I think is is basically the same.
Kees