Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

SRQ Callback in IVI Class driver

Solved!
Go to solution

Hi,

 

is it possible to install a callback function for srq call's? For example:

When a Powersupply set the Over Current bit in the Status Register the ivi driver call automatic a userdefined function...

 

thanks for any suggestion

0 Kudos
Message 1 of 8
(3,966 Views)

Hi Sebastian,

 

I did not completly understand what hardware and software you are using. Please specify.

 

Maybe these documents are of any use for you:

 

How Is a Service Request Used on the VXI Bus?

http://digital.ni.com/public.nsf/allkb/22AEC7B4D479294086256BF4005B7C8C?OpenDocument

 

Understanding the VXI/VME Interrupt and Signal Acknowledge Cycle

http://www.ni.com/support/vxi/iack/iack.htm

 

How to Programmatically Check the Status of Your GPIB Board

http://zone.ni.com/devzone/cda/tut/p/id/4314

 

How to Use Asynchronous Callback Functions with GPIB Events in Windows NT/98/95

http://zone.ni.com/devzone/cda/tut/p/id/3458

 

Regards, Topp

 

 

 

0 Kudos
Message 2 of 8
(3,947 Views)

Hi,

 

If you want your driver to be IVI Compliant you should try checking the specifications on the IVI foundation website

0 Kudos
Message 3 of 8
(3,940 Views)

Hello,

I want to use the default IVI IviDCPwr Class to control varius Powersupplys,

and I search a methode to detect overcurrent situations any time of the program flow -> Callback function which inform the user and disable all supplys...

I search a default way to do, and don't won't to write a custom IVI driver.

 

Best regards

0 Kudos
Message 4 of 8
(3,934 Views)

I have never seen IVI drivers having such callback feature.

 

But you will still able to access VISA COM interface if the driver is IVI-COM.

 

Then invoke IEventManager::InstallHandler and EnableEvent methods.

0 Kudos
Message 5 of 8
(3,926 Views)

Hi Sebastian,

 

As for I know, function cannot be called automatically with the change of Status Bit.

 

I have two suggestions:

1) Busy waiting for the change of Status Bit, using while loop. This method consumes a lot of CPU.

2) If you do not demand very accurate response to the change of Status Bit, you may detect the change of Status Bit at beginning of every function.

0 Kudos
Message 6 of 8
(3,913 Views)
Solution
Accepted by topic author Sebastian Weyck

Good evening,

 

I found the solution (-:

when I get the VISA Session from the IVI Driver with GetAttributeViSession -> IVI_ATTR_IO_SESSION I can install an event handler like this:

http://www.ni.com/support/visa/vevents.pdf and now I can catch all STATUS REGISTER changes.

 

thanks for your suggestion and

best regards Sebastian

0 Kudos
Message 7 of 8
(3,901 Views)

Sebastian, thank you for sharing the solution with us.

0 Kudos
Message 8 of 8
(3,882 Views)