LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert VISA VI to communicate with a USB RAW device

Hi everyone,

 

I have some code direct from the manufacturer of the lasers we use, however this code was used with an older version of the lasers which communicate using GPIB, the newer laser communicates through USB.  

 

I have done some basic research and know that the newer version of the laser we just purchased is a USB RAW device so it will not be able to communicate through VISA, and so the older VI would need modification to work with this newer laser.  

 

I have knowledge of LabVIEW basics, but I am hoping for some direction on what part of the VI/subVIs I would need to modify to make this conversion with the least amount of change (if possible).  We would love to not start from scratch because we want all of the functionality of the program used with the old laser, just modify it to communicate with USB RAW devices.

 

I have attached the library below.

 

Thank you for any/all suggestions!

0 Kudos
Message 1 of 7
(3,009 Views)

You should be able to communicate through VISA. Have you tried creating a driver for it using the driver wizard? You will need to know the VID and PID of the device in order to create the driver.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 7
(2,995 Views)

Using the tutorial on this website, I did create a driver for it a couple of days ago.  

 

I only just was able to view the code (previously the company had only provided the application file), so I am wondering if I enable the "Serial" option that comes up after pressing "Run" and check that box, will it be able to communicate with the laser?

 

When I use the VISA In dropdown menu on the front panel, the only 2 things that come up are the COM port and the LPT port...should my USB device come up there as well?

0 Kudos
Message 3 of 7
(2,993 Views)

Actually the options that I was talking about are RS232 or GPIB (I thought it was serial or GPIB).

0 Kudos
Message 4 of 7
(2,990 Views)

I have never used teh VISA drop down. I generally configure it directly or create my own dialog. The connection string would look like this: "USB::0x<VID>::0x<PID>::<Device SN>::RAW". Replace the VID, PID and serial number with the appropriate values for your devices. You can also use the VISA Find Resource VI to list the available devices.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 7
(2,987 Views)

You should understand that USB RAW is nothing like RS-232 serial. I have no idea what 'serial' option you are talking about. If the instrument's USB interface is actual a virtual com port, then you would not be using USB RAW. If you unplug the device and a com port disappears in windows device manager, then you have a virtual com port. If it doesn't, then you do not and would need very low level details from the vendor in order to communicate with it. Perhaps they provide an api that does not require VISA.

 

If in fact you used the wizard and actually replaced the vendor's driver with the VISA one, then yes, it would show in MAX as a VISA RAW resource.

 

 

0 Kudos
Message 6 of 7
(2,986 Views)

The options I was talking about were referring to the program I had posted, it has 2 options 1 for for RS232 and the other for GPIB communication.

 

The device is USB RAW.

 

0 Kudos
Message 7 of 7
(2,981 Views)