10-09-2017 12:40 AM
I'm experienced with LabVIEW, but about to control an instrument in a way that I never have before: plugged in via USB and presenting a serial ASCII interface. I may use the instrument on both Windows and Mac.
Several questions, relevant to both operating systems:
1. Is VISA The best tool for working with this?
2. On a Mac at least, the identifier for the serial port changes based on which USB port I plug into. So I want to know how to handle this in a user-friendly manner. Is there a good way to get a list of all available serial ports and present that to the user in a menu box?
3. Is there any sort of standardized protocol for getting a serial device to identify itself – so that I could poll the available serial devices and automatically figure out which one is my instrument? The device is not a National Instruments product.
10-09-2017 02:36 PM
I have no experience with a Mac.
If the device and its drivers presents itself as COM port in Windows' Device Manager, then I use VISA.
Such a device would show up in VISA Resource Finder.
10-18-2017 04:14 PM
@nyc_(is_out_of_here) wrote:
If the device and its drivers presents itself as COM port in Windows' Device Manager, then I use VISA.
Such a device would show up in VISA Resource Finder.
This is helpful, and allows me to refine my question. On the Mac, I set up a VISA Resource Finder with the default, universal match string. Now I need help to interpret the two somewhat cryptic answers that came back:
ASRL1::INSTR
ASRL2::INSTR
How would I take these specifications and find out which one is actually my instrument?
10-19-2017 09:33 AM
ASRL1::INSTR refers to a serial device attached to interface ASRL1. One way to determine the corresponding instrument is to connect an disconnect the device, and test which serial device it is. You could also perform loop-back tests to determine the instrument.
On Windows computers, you can change the VISA aliases in NI MAX, and the VISA Resource in LabVIEW will reflect that: http://digital.ni.com/public.nsf/allkb/AE830D99E30CB61486256C7900697999. However, I am not sure if NI-VISA for Mac will have that functionality.
10-19-2017 11:54 AM
Not sure about the Mac having something similar to the registry in Windows. To gather more information as to the device, you can try to look up the information present in the registry. Here is a link to some more information: