Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Visa support the VI_ATTR_PXI_RECV_INTR_DATA?

Dear all,
 
I have a problem, the code is like this:
 
ViStatus _VI_FUNCH IHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr uhandle)
{
   
0 Kudos
Message 1 of 3
(7,675 Views)
Dear all,
 
I have a problem, the code is like this:
 
ViStatus _VI_FUNCH IHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr uhandle)
{
     u32 intValue;
     status = viGetAttribute(vi, VI_ATTR_PXI_RECV_INTR_DATA, &intValue);
     intValue &= 0x000A0000;
     switch(intValue){
           case 0x00080000:
                   theSTIM->renew_stim();
                   return VI_SUCCESS;
           case 0x00020000;
                   theTEST->renew_test();
                   return VI_SUCCESS;
           default:
                   return VI_SUCCESS;
     };
}
 
In the NI Spy, I got messsage as follows:
.......
Invoking VISA user callback(0x024BE270, PXI_INTR, 0x024BF4A8, 0x00BC614E)              0      ................................
viGetAttribute(0x024BE270, PXI_RECV_INTR_DATA, "<INVALID>")                                     0xBFFF001D     ......................................
.......
 
 
I am wondering whether the visa3.1 supports the attribute of VI_ATTR_PXI_RECV_INTR_DATA or not.
If it does, why I have this problem?
 
Thanks
George
0 Kudos
Message 2 of 3
(7,671 Views)
Hi George,

Both VI_ATTR_PXI_RECV_INTR_DATA and VI_ATTR_PXI_RECV_INTR_SEQ are attributes of the event, not the session.  The handler should be:

ViStatus _VI_FUNCH IHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr uhandle)
{
     u32 intValue;
     status = viGetAttribute(event, VI_ATTR_PXI_RECV_INTR_DATA, &intValue);
     [ ...  ]
}

Hope it helps,
Diego




0 Kudos
Message 3 of 3
(7,498 Views)