LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using gpib-32.dll in Labview 7.0

Hi there,
 
I am relatively new to Labview and I need some help trying to program an old HP3488A switch/control unit using the Call Library Function Node. I would like to convert the existing VB6 code, which uses gpib-32.dll, into Labview. What I have done in the VB code is to call the ibdev function to set up the HP instrument. I would like to do the same in Labview. How would I even go about setting up the .dll files as I am revamping the existing code (running on a Pentium II computer) and trying to create an identical code in Labview (running on a Pentium III computer). Also, after I have set up the .dll files (done any system configurations if necessary), how do I actually implement this file in Labview?
 
I have tried calling the ibdev function in the properties of the Call Library Function. I created 6 parameters of return types with ranges of type long. Then I pass integers into the input of this node and when I tried running it I get an error exception within the external code as follows:
 
"An exception occured within the external code called by a Call Library Node. This might have corrupted Labview's memory. Save any work to a new location and restart Labview. VI "switch.vi" was stopped at Call Library Function Node 0x1D7C of subVI "switch.vi"
 
Can someone please help me? Thanks.
0 Kudos
Message 1 of 14
(3,908 Views)

I would abandon the Call Libraray Function node route completely.

Just use LabVIEW's built-in GPIB Read and GPIB Write and GPIB Init elements.

And if this instrument supports VISA, I would use LabVIEW's VISA Open, VISA Write, and VISA Read.

 

 

0 Kudos
Message 2 of 14
(3,891 Views)
nyc is correct. You're making this far too complicated. There's even a driver already written for the instrument that can be downloaded from https://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E94C3659CE034080020E74... .
0 Kudos
Message 3 of 14
(3,887 Views)

I actually tried that before. As the HP3488A switch instrument is very old and came out before IEEE488.2 got introduced, it still uses IEEE 488.1, or HPIB commands. When I try using MAX or even my Agilent IO Control, it shows that there is an instrument connect to GPIB address 10, but neither programs can auto-identify the instrument using the *IDN? query. Even so, I tried typing ID? in both programs and I got no data back from the instrument. I'm not too sure as to what the problem is since I always get "\n" back from the instrument's reply. I even tried changing the termination character enable to TRUE and I still got nothing back.

However, on the front local display of the switch, I can see arrow indicators moving between TALK and LISTEN whenever I perform a write or write/read command. But no data gets sent or received because I couldn't perform any write commands to change the switch. If anyone can tell me what the real problem is that would be great. But if not, then I will have to use the Call Library Node because I know that my VB6 code actually works on the HPIB instrument and I could simply use this gpib-32.dll file on Labview and perform the same instructions, which should allow me to talk to the switch. Can anyone tell me how to properly set up a Call Library Function Node as I have errors using the gpib-32.dll file (please see my previous message)?

0 Kudos
Message 4 of 14
(3,881 Views)
You might have a look at this knowledge base article. I'm fairly certain that MAX doesn't support 488.1 (...but I could be wrong!)
0 Kudos
Message 5 of 14
(3,871 Views)
I've still got two old testers with this switch and I just went to one of them, opened MAX, selected the instrument with the correct address, right clicked and selected Communicate with Instrument. I entered ID? for the query and immediately got back HP3488A\r\n. This program in MAX uses the same ibdev, ibwrt, ibrd that you are used to. The production program actually uses VISA and I have no problem there either executing the same command. I don't know where you might have set a termination character to true (MAX? LabVIEW?) but the instrument itself may not be set correctly for it's termination character. Mine seem to repsond with just EOI sent but maybe yours is setup differently. You can try appending different termination characters in MAX to see if any work (\r or \n or both). If you cannot get the instrument to respond to the ID? query in MAX, I don't see how you can get either the call library node or native LabVIEW functions to work. I think your error with calling the dll might be caused by passing an incorrect parameter and that can probably be fixed but I think you need to worry about getting MAX to talk to it first.
Message 6 of 14
(3,866 Views)
I've tried all different combos using \n and \r and nothing seems to work. Here's my sequence of steps to what I've gotten so far. To begin with, I'm currently using an Agilent 82357A USB GPIB board. I start up VISA Interactive Control and open a VISA session. In the popup window I went to the "Template" tab and select "VI_TRUE" for the "Termination Char Enable" attribute name. I tried this method because it actually worked for another old instrument that I have as the default setting for this attribute in MAX is "VI_FALSE".
 
So anyways, when I go to the "Basic I/O" tab I send the command "ID?" and when I try and read it I simply get back "\n" and checking the status byte of the switch shows a value of 10. Even when I try all the different combinations like "ID?\r" or "ID?\r\n", I still get a response of "\n". One thing I noticed is that sending this query does not put the switch in remote mode (which is one of the local display indicators). It simply goes to a LISTEN mode and stays there. It is true that using the Call Library Function might not work either, but I am really stuck at this point as I can't even use MAX to communicate with the HP3488A switch. Dennis, have you ever experienced this problem before, or has anyone else either?
 
 
0 Kudos
Message 7 of 14
(3,856 Views)
I haven't noticed this. I used the NI-488.2 Communicator that starts with MAX but since you are using an Agilent GPIB->USB, you won't be able to use this. The ibdev, ibrd, and ibwrt won't work either since these are only for NI cards. I'm not sure why the VISA interactive control doesn't work but if you have installed both NI and Aglient's gpib drivers, you may be calling into the wrong dll. They both provide a gpib-32.dll. That could easily be the reason that you are getting an error when calling the dll. If you can select the ibdev function, then you are calling into the NI dll but it is trying to control the Agilent USB-GPIB. In MAX, you should make sure that you have Tulip support selected and try the VISA tool again.
0 Kudos
Message 8 of 14
(3,851 Views)
I've actually already selected the checkbox for Tulip Passport dll already. At this point in time, I'm hoping if someone can help me with regards to setting up a Call Library Function Node for use with gpib-32.dll. I would like to call ibdev in gpib-32.dll and hopefully get a response back. The method's parameters are as follows:
 
 
int ibdev(int board_index, int pad, int sad, int timeout, int send_eoi, int eos);
 
I tried calling it by plugging the inputs as constants in Labview and I got an error message stating that there was an internal error inside the Call Library Node. So instead, I opened MAX, selected Tools ->NI-488.2 ->Interactive Control. I got the DOS screen and I tried using ibdev directly and I still got an error. What am I doing wrong? There are two screenshots, one is taken from Labview, the other from the DOS program called ibic.exe 
 
0 Kudos
Message 9 of 14
(3,840 Views)
You might want to double check with Agilent but as far as I know, you cannot use any "ib" commands with an Agilent USB-GPIB board as I mentioned. I have only used those with an NI board and I have only used VISA commands with an Agilent board. In your VB program, were you using the same Agilent USB-GPIB?
0 Kudos
Message 10 of 14
(3,837 Views)