03-22-2010 03:37 PM
I'm using Visual C++ 6.0 and trying to use a callback function in DAQmx. I am using the example "VC_ContGen_IntClk". This program compiles and runs fine in .NET but in Visual C++ 6.0 I get an undeclared indentifier error.
In my .h file for class CniDAQ I declare the function: int32 CVICALLBACK DoneCallback(TaskHandle taskHandle, int32 status, void *callbackData) ;
and the .cpp file defines int32 CVICALLBACK CniDAQ::DoneCallback(TaskHandle taskHandle, int32 status, void *callbackData)
However in the call: DAQmxErrChk (DAQmxRegisterDoneEvent(*taskHandle,0,DoneCallback,NULL)); ---- DoneCallback is flagged as an error as an undeclared identifier.
Can someone please help with this?
Thanks,
03-23-2010 06:22 PM - edited 03-23-2010 06:24 PM
Hello,
A good starting point demonstrating the use of DoneCallback would be to run the following example. It shows how to use a Done event to output a finite number of voltage samples to an Analog Output Channel using an internal sample clock. This example can be found by navigating to Start»Programs»National Instruments»NI-DAQ»Examples»DAQmx ANSI C»Events»Done»Mult Volt Updates-Int Clk-Done Event. Does this error still occur?
Regards,
Ali M
Applications Engineer
National Instruments
05-28-2010 02:39 AM