Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

error -10401 using DAQ 6527

Two problems:

1. When executing functions DIG_Change_Message_Control() or DIG_Change_Message_Config() error -10401 is returned. I get a return of "0" when executing Init_DA_Brds(), but this "0" happens when using device number 285 or 1(Max device number).

2. When calling function DIG_Change_Message_Config() I get a compile error for callbackAddr: 'DIG_Change_Message_Config' : cannot convert parameter 7 from 'void (struct HWND__ *,unsigned int,unsigned int,long)' to 'unsigned long'.
If I pass a zero to the function it will compile, but then I get the error in 1. above. Are there any examples for Visual C++, I checked help docs and website but found none.

Thanks, Brad
0 Kudos
Message 1 of 4
(3,656 Views)
Hi Brad,

There might be a couple problems here. The first might have to do with the board not being properly detected by the software. Open up Measurement & Automation Explorer (MAX) and select My System >> Devices & Interfaces and right-click your board (6527) and select Properties. Test the resources and run the Test Panels to see if the device is working correctly. If it isn't then we will probably have to delete it from MAX and restart the computer. Worst case, remove card, reinstall NI-DAQ driver and reinsert card afterward.

As for getting compile errors for the 7th parameter, the callback function address, you should just be able to declare a function normally and use its name as the parameter.

int myFunc(blah, blah, blah, blah)
{
..
}

D
IG_Change_Message_Config(blah, blah, blah, blah, blah, blah, myFunc);

Anyway, hope that helps. Have a good day.

Ron
0 Kudos
Message 2 of 4
(3,656 Views)
Hi Ron,

Thanks for the answer. I checked out the card in MAX and used the test panels - all checks are good. I did a type cast for the parameter callbackAddr and now I can compile successfully.

After I execute DIG_Change_Message_Control (device, code); with code set to 0(start detection) I get an error code of -10600(noSetup).

I am calling these three functions:

Init_DA_Brds(device, (short*) &m_nDeviceNum);

DIG_Change_Message_Config (device, 0, "0.0", "0.1", 0, 0, (unsigned int) CallBack);

DIG_Change_Message_Control (device, 0);

Have any ideas or know of any visual C examples that use edge detection?

Thanks, Brad
0 Kudos
Message 3 of 4
(3,656 Views)
Hi Brad,

I'm not sure if you got passed this point or not but here's what I thought of anyway.

All you would need to do is perform a digital port_config to setup the digital ports for input or output. Once the task has been set, then you can configure messages for that task. That is morelikely why you are getting errors.

Here are a couple example programs I found on the website, they should be able to give you some insight. Hope that helps.

Notify Changes in the States of a Digital Line Using a DIO 652X Device (CVI)http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E29B56A4E034080020E74861&p_node=DZ52318&p_submitted=N&p_rank=&p_answer=&p_source=Internal

6527 change detection using Visual Basic
http://ve
nus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DF1756A4E034080020E74861&p_node=DZ52319&p_submitted=N&p_rank=&p_answer=&p_source=Internal

Ron
0 Kudos
Message 4 of 4
(3,656 Views)