Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

callback Visual C++ 6.0 and DAQmx

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,

0 Kudos
Message 1 of 3
(6,545 Views)

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

 

Message Edited by Ali M on 03-23-2010 06:24 PM
0 Kudos
Message 2 of 3
(6,523 Views)
I'm studying now..~~~~~~~~~~~~
Do nothing for the sake of doing it...
0 Kudos
Message 3 of 3
(6,272 Views)