Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

what is the difference between GPIB and VISA when we compile a program?

I am using GPIB-USB-HS cable (from NI) to get data from SR 245 Computer interface of Boxcar. The cable’s GPIB interface connects with Boxcar’s GPIB interface, and cable’s USB’s interface connects with desktop. The operating system of my computer is Windows XP, and my Labview is 7.1 versions. I have several questions:

 

The Boxcar has two interfaces: one is GPIB and another is RS 232. I switched jumpers inside the SR 245 and chose GPIB interface. The first question is which interface generally for you to choose when you have GPIB and RS 232 interfaces?

 

After I successfully installed the driver for GPIB-USB-HS cable, I got the primary address of GPIB of instrument is 16 through scanning for instrument when I ran M&A Explorer. The second question is that the cable can’t communicate with the instrument. The command string I sent is from SR 245’s manual. No matter what command I entered, including command*IDN?, “iberr=EABO” is the only answer for my numerous requests. The ACTIVITY green light and the ERROR light didn’t flash, which seemed like nothing happening. Did someone have experience how to correct it? Or did I need to set something in GPIB Configuration?

 

The second question is how to modify boxcar’s driver downloaded from NI Company. There are two drivers for SR 245, and one is GPIB interface and another is Serial interface. I speculated that the driver should be the one with GPIB interface. Is my thought right?

 

I chose the driver supported by GPIB interface. When I opened the driver and corrected the GPIB address in the driver and ran it, the green ACTIVITY light and the red ERROR light on the front panel of SR 245 flashed one times, which shows that the program partly works on the SR 245, but I didn’t get anything from the Front panel of the program, so I modified the program: I changed GPIB WRITE and GPIB READ with VISA WRITE and VISA READ in the driver, and then I ran the modified program, the lights didn’t flash and still got nothing. I didn’t know clearly what the difference between GPIB and VISA is, and when to use VISA rather than GPIB when I compile programs. I remember that VISA supports USB interface, but GPIB doesn’t, right? Is it necessary to replace GPIB icons with relevant VISA icons? I am a little puzzled!!!!!!!!

 

The last question is that did someone have experience to use a Labview program to control Boxcar and get data?

 

Thanks!

 

Linghui

0 Kudos
Message 1 of 34
(7,082 Views)
First of all, yes you chose the correct driver. Unfortunately, the driver appears to be pretty badly written. There isn't a single error in/error out cluster wired and you should make sure that you have automatic error handling dialogs turned on. Do this and see if you get any error messages. The actual error code (if any) you get will be important. You might want to first try issuing some of the commands from MAX to see if they work from there.

Since you are getting an error light on the instrument, see if there is some error query that you can run. This might provide some helpful information as well. I would also double check to see if there is some other setting on the instrument besides the jumper setting.

In theory, VISA and the GPIB commands should work the same. It's possible though, that you made some mistake in the conversion. If you could post the converted VI, someone could look it over.
0 Kudos
Message 2 of 34
(7,052 Views)

Thank you Dennis!!!

Your comment made me a little clear.

So you mean that it should be the same when I use GPIB commands and VISA commands. Is it right?

 

Another question what is the difference between VISA commands and VISA serial commands?

 

Thanks!

 

Linghui

 

0 Kudos
Message 3 of 34
(7,007 Views)
Yes, everything should work exactly the same. VISA is an api (application program interface) that is used for GPIB, serial, USB, VXI, PXI, and Ethernet instrument communication. In the past, you had separate functions for each but using VISA allows you to use just one. VISA takes care of deciding which low level hardware functions to use and all you have to do is specify the VISA Resource Name. To talk to a serial port with VISA, you have a resource name like 'ASRL1::INSTR'. To talk to a GPIB instrument, the resource name is something like GPIB0::16::INSTR. After you specify the resource name, you always use VISA Read and VISA Write commands for all types of instruments. An instrument driver written for a GPIB instrument can usually be used unmodified or slightly modified for any instrument type

The VISA serial commands are just a convenient grouping of the common fucntions for talking to serial instruments. It includes the regular VISA Read and Write with some specific serial VIs (actually VISA property nodes).
Message 4 of 34
(6,999 Views)

Thank you, Dennis;

From what you said, so there is no problem to use GPIB commands to take data from instrument through GPIB-USB-HS cable.

I corrected GPIB address in the driver program, and I used a BNC cable to import signal in the INPUT PORT 1 in the front panel of SR 245. When I ran this program, I got nothing except both lights for Error and for activity flashing one time. I pasted the driver and let someone look at whether there is problem in this program or not.

Thanks!

 

0 Kudos
Message 5 of 34
(6,992 Views)

Is there any problem with this downloaded driver. I got nothing when I ran this program.

Thanks your suggestion.

0 Kudos
Message 6 of 34
(6,986 Views)
Sorry. I can't open your VI. The latest version of LabVIEW that I have is 7.1.
0 Kudos
Message 7 of 34
(6,977 Views)

I will paste it again.

My labview is also 7.1version. Could you try to open it again?

Thanks.

0 Kudos
Message 8 of 34
(6,973 Views)
It's coming up as a 0 byte file.
0 Kudos
Message 9 of 34
(6,969 Views)
"There isn't a single error in/error out cluster wired and you should make sure that you have automatic error handling dialogs turned on. Do this and see if you get any error messages. The actual error code (if any) you get will be important. You might want to first try issuing some of the commands from MAX to see if they work from there. "
 
--Dennis
 
What means automatic error handling dialogs turned on? Do I need to build a ERROR IN and Error out in the driver, right?
 
I can't communicate with the instrument through the cable, though MAX can find GPIB address in the instrument. Even I used commands from the company , for example:Bwrt"*IDN?\r"

 
0 Kudos
Message 10 of 34
(6,967 Views)