Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB (USB-GPIB)

hi,

 

i have a Ni gpib-usb and am using it with a rohde & schwarz ESU40. i am running 2 programs to this device the first command uses the ethernet port of the ESU40, and the second program uses the gpib. so when i use the gpib program and end the program i can't use the ethernet port of the ESU40, i have to reboot the device. i have tried other programs from the internet that uses gpib and those programs are fine because when i end those programs the ethernet port works on the ESU40. so basiclly i'm "not" disconnecting right, what is the command to disconnect once you have connected to the gpib. the following is the commands on how i connect to the ESU via gbib, but i don't know what the command is to disconnect can you help?????(eoitermination cl or nl)

 

Call ibfind("DEV1", analyzer%

Call ibpad(analyzer%,20) 

0 Kudos
Message 1 of 5
(5,075 Views)

Hello neelesh2003,

 

So if I am understanding your problem correctly you need to find a way to close out the GPIB session you are opening. Since you are using ibfind to open communication you can use ibonl to close the session to the device. If you are using LabWindows/CVI you can find the help for this function by opening it up under the GPIB 488.2 Library and in there it is located under Open/Close.  Here is also a description of what the function does:

This function does the following:

 

Description for Online:

 

     Cancels any asynchronous I/O in progress. Resets all

     configurable software parameters to their default values.      

     If called on a board, reinitializes the board.

 

Description for Offline:

 

     Disables a board or device from GPIB operations.

     Disassociates the descriptor from the board or device.

 

Note:  If the device descriptor was obtained from OpenDev,

       do NOT use this function to take the device offline.

       Instead, use CloseDev (the "Close Device" panel).

 

/*-------------------- Prototype ---------------------*/

int ibonl (int BoardDevice, int Operation_Mode);

 

Hopefully this gets you up and running.

 

Best Regards,

 

Adam G.

National Instruments
Applications Engineer
Message 2 of 5
(5,042 Views)

hi, i am using vba from microsoft excel.  

0 Kudos
Message 3 of 5
(4,998 Views)

i tired the ibonl(analyzer%, 0), it did not work completely. see the thing is i have 3 programs the first program(emc32) uses the ethernet port of the spectrum analyzer, the second program(rs commander) uses the gpib, and the thrid program(my program vba) uses the gpib.

 

when i use the rs commander(gpib) and capture the plot and close the program then start the emc32(ethernet) program everything works fine, its just when i use my program vba(gpib) then try to use the emc32(ethernet) thats when it does not work.

 

the problem is i am not either closing the vba correctly, is it unregisterGPIBglobalsforthread(??????)

 

the ibonl(analyzer%, 0) did do something because before when i started the emc32 it would lock up right away but now with the ibonl command i am able to get past the first screen, so the ibonl did do something.  

0 Kudos
Message 4 of 5
(4,990 Views)

Hello,

 

I was wondering what the commands are that the RS commander program uses to stop communication to the GPIB device? Have you tried adding these into your VBA program? Also I was wondering what error message you are getting? If you are not able to find these out I was wondering if you could do a NI SPY capture (http://digital.ni.com/public.nsf/allkb/282C5D41E2BA04F2862574BA007803B9). If you have to do this I would need multiple captures. The first would be when you are using the RS commander program and the emc32 program and the second would be when you are using your VBA program and the emc32 program when if throws the error.

 

Best Regards,

 

Adam G

National Instruments
Applications Engineer
0 Kudos
Message 5 of 5
(4,967 Views)