Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

CNi4882::InstallEventHandler

I followed the CNi4882 InstallEventHandler example

make the function as below,
int EventHandler(CNi4882& object, void* userData)
{
// Return zero to uninstall the event handler.
return 0;
}

and run the program by with Ni Spy on, captured
ibnotify(UD1,0x0000, 0x00000000, 0x0000000) (with red color)
when goes through "return 0" this line,
but check at Ni Spy property sheet, said its iberr: ECAP

It seems not work as well as sample said.

my test condition is:
> Ni Measurement Studio for VS.NET
> GPIB card: PCMCIA-GPIB+
> GPIB driver: V2.1
0 Kudos
Message 1 of 3
(3,424 Views)

Could you show me where you found this example.

By looking at your NI Spy capture it looks like you received the ECAP error because the mask for ibnotify is all zeros. This means the mask does not set anything to notify. You can find what the error codes mean, and how to set the mask for ibnotify in the NI-488.2 Help.

The following KnowledgeBase shows where to find the examples for VS.NET, where there is an example called "Notify" which might be of use.

NI-DAQmx, NI-VISA and NI-488.2 .NET Example Locations

Shawn B.
National Instruments

Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 2 of 3
(3,407 Views)
I found the example in Measurement Studio Reference help file as shown in attached bitmap.
Thank you
0 Kudos
Message 3 of 3
(3,210 Views)