LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 0xBFFF003A with viEnableEvent

Hi,
I would like to read data from a USB RAW device but when I try to enable the interrupt with viEnableEvent I get the error code: 0xBFFF003A - Unable to start operation because setup is invalid (usually due to attributes being set to an inconsistent state). I'm using this sample code:
 

...

status = viOpen (defaultRM, "USB0::0x413c::0x3010::NI-VISA-0::RAW",VI_NULL, VI_NULL, &instr);

if (status < VI_SUCCESS)  {

printf ("Cannot open a session to the device.\n");

goto Close;

}

printf("Enabling USB Event\n");

status = viInstallHandler (instr, VI_EVENT_USB_INTR, usbHndlr,0);

status = viEnableEvent (instr, VI_EVENT_USB_INTR, VI_HNDLR, VI_NULL);

...

My OS is XP SP2 and I use CVI 7.0 / NI-VISA 3.6. The .inf file to install the USB device was created with DDW. Any clue about this problem? Is there any other way to read data from USB RAW device?

Thanks.
0 Kudos
Message 1 of 2
(2,515 Views)

Gullit,

communicating with devices using USB RAW Visa mode is documented on the following KB page

http://digital.ni.com/public.nsf/websearch/E3A2C4FE42D7ED0D86256DB7005C65C9?OpenDocument

There is also an example that shows how to program USB RAW devices using VC#.NET. Function calls are similar to the ones you should use in CVI, so it may be helpful

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=F3A25808D07C033AE0340003BA7CCD71&p_...

Hope this Helps,

AlessioD

 

0 Kudos
Message 2 of 2
(2,504 Views)