08-03-2012 05:08 PM
I am trying to enable interrupts in a driver using VISA and I am receiving an error that does not make any sense. Here are the calls that I am making to VISA and viEnableEvent returns 0xBFFF0083 or VI_ERROR_INV_LENGTH.
status = viOpen(defaultRM[0], desc, VI_NULL, VI_NULL, &instr[0]);
status = viInstallHandler (instr[0], VI_EVENT_PXI_INTR, IHandler, /*uhandle*/ (ViAddr)0);
status = viEnableEvent(instr[0], VI_EVENT_PXI_INTR, VI_HNDLR, VI_NULL);
If anyone has encountered this error or can dig into the function to see what causes it, I would appreciate it.
Thanks,
John
Solved! Go to Solution.
08-06-2012 11:55 AM
Hello John,
I this same error related to some other VISA calls, like the viMove, but also related to the address that you are accessing with the VISA Event call. However, they seem to be corrected on later VISA versions. What's the VISA version you have? You could always download the latest VISA driver and see if it persists. It would also be a good thing to rule out the hardware you are talking to. Can you give more details on what instrument you are talking to and on what interface (serial, Ethernet, etc)?
08-06-2012 12:47 PM
Hi Daniel,
I am porting over interrupts to VISA for a ARINC 664 PCIe board. I currently have interrupts working in a Windows version of the driver so I know that the board is functioning properly with interrupts. The VISA driver works, I just want to add the interrupt callback functionality to it.
I am currently working with VISA 5.0.2, I will try upgrading to 5.1.2 to see if it helps.
Thanks,
John
08-07-2012 03:48 PM
Hello John,
Have you tried Example 7-1 on page 90 of the VISA Manual? It seems that you are calling the same functions, except maybe for the malloc function, but let's see if you get that same error with this example code.
08-17-2012 05:00 PM
In case anyone else runs into this error, the error was caused by interrupts not being implemented in the inf file. After going through the driver wizard again and setting up interrupts in the inf file everything worked as expected.