07-20-2018 07:00 AM - edited 07-20-2018 07:02 AM
I was told to start a new topic.
I have 8 serial ports:
1. no device attached
2. one port has a device which does not send \n terminating character and does not respond to IDN?
3. 6 ports that has a device attached that sends \n character and responds to "IDN?"
All 8 serial ports are on a StarTech USB-serial converter.
What is the best way to do a VISA Read when trying to find which port has which device/no device ?
Windows will randomly assign serial ports and the devices can be attached to any of the 8 connectors.
.
07-20-2018 07:20 AM
Use a FOR loop to go through each port. For each port, send the *IDN? query and look at the response. If there is no response (timeout), try the other device's protocol to detect it. If still no response, you can assume there is no device there.
07-20-2018 09:28 AM - edited 07-20-2018 09:30 AM
@nyc_(is_out_of_here) wrote:
I was told to start a new topic.
Well I thought you were asked to create a new topic on your "Byte at Port" and termination character questions but this question still seems related to the "find serial ports" topic of the other thread...
@nyc_(is_out_of_here)Windows will randomly assign serial ports and the devices can be attached to any of the 8 connectors.
I have found that Windows 7+ will remember the UUID of the USB to Serial adaptors and applies the same Com port designator to the same device every time. This is why when you look in the Device Manager you will see serial ports marked as "in use" when no serial ports are present in the system.
07-20-2018 04:21 PM
@RTSLVU wrote:
@nyc_(is_out_of_here) wrote:
I was told to start a new topic.
Well I thought you were asked to create a new topic on your "Byte at Port" and termination character questions but this question still seems related to the "find serial ports" topic of the other thread...
@nyc_(is_out_of_here)Windows will randomly assign serial ports and the devices can be attached to any of the 8 connectors.
I have found that Windows 7+ will remember the UUID of the USB to Serial adaptors and applies the same Com port designator to the same device every time. This is why when you look in the Device Manager you will see serial ports marked as "in use" when no serial ports are present in the system.
It is a new topic because I've found the serial ports.
Now I need to know which devices (or lack thereof) are on those serial ports given that one of the devices does not send a terminating \n.
When the LabVIEW software runs on another PC, serial ports are not the same.
I have experienced this first hand because the employer switched me to a different laptop but connected to the same StarTech USB-serial device.
.
07-20-2018 04:36 PM
If your project has a budget of any kind you could consider switching to one of these things and standardizing which port you plug which device into instead of doing random probing...
07-20-2018 04:47 PM - edited 07-20-2018 04:52 PM
@nyc_(is_out_of_here) wrote:Now I need to know which devices (or lack thereof) are on those serial ports given that one of the devices does not send a terminating \n.
When the LabVIEW software runs on another PC, serial ports are not the same.
I have experienced this first hand because the employer switched me to a different laptop but connected to the same StarTech USB-serial device.
Oh well sure if you move to a different computer, that computer is not going to know what the UUID and ports were on the other computer.
But you should only have to figure that out once, and it should stay the same from then on...
Anyway it seems like the process of elimination is what comes to my mind first.