Hello,
I have an automated test for a device which is connected to a computer via USB port. I want to send a runtime version of this test to our test site in another country. I want them to be able to connect to the serial port based on the port number they get on their PC. My goal is to modify the program such that the USB port number can be entered in an initialization text file and used by the test program to connect to, send the commands to and receive the data from.
For now I have to change the port number in the device manager on each computer to match the USB port number in instrument manager (which is ...!!!)
I would appreciate it if somebody would advice me on how to connect to a USB port based on the user input.
Thanks,
I have an automated test for a device which is connected to a computer via USB port. I want to send a runtime version of this test to our test site in another country. I want them to be able to connect to the serial port based on the port number they get on their PC. My goal is to modify the program such that the USB port number can be entered in an initialization text file and used by the test program to connect to, send the commands to and receive the data from.
For now I have to change the port number in the device manager on each computer to match the USB port number in instrument manager (which is ...!!!)
I would appreciate it if somebody would advice me on how to connect to a USB port based on the user input.
Thanks,
There are ( at least ) 2 ways of doing this. For a single device and what I would say is the 'normal' way of doing this is to use the VISA alias.
In the VEE IO manager, you set an alias ( name ) for the instrument - it tends to default to new_instrument1 or the like ( which is a shame as it can read quite a bit from the instrument in most cases ). I would recommend that before doing any programming, change the name to something useful e.g. Oscilloscope, DSO1234, temperature_monitor or the like ( shorter name is generally better ).
Optionally, when saving the runtime, uncheck the save IO config with the program.
When you put this on a machine with only runtime, use the VEE Runtime IO Configuration ( sorry can't quite remember the application name ), find the instrument, set its alias as for the program and all's well.
Caveat is that now you've programmed it, if you want to change the VISA alias it's a bit awkward, but that could be the subject of another post ;-)
The other way is to set the VISA address dynamically i.e. in the program. This still uses the VISA alias though e.g. ( again please excuse the potentially non-exact syntax )
DSO1235.IO.VisaAddress="USB0::1234::9876::TW890123456::0::INSTR"
where the address can be built from USB port and instrument details.
This is really useful where you have multiple instruments doing the same sort of operations.
Let us know how you get on!
Cheers, Mike