09-27-2010 06:44 AM
Trying to set up continuous acquisition with Visual Basic for Excel. There's no sample VB programs specifically for this in the NI-DAQ sample code, but got the following line of code from the sample C program ContAcq-IntClk.c:
int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
Which is the header for the callback function. My question is, what do I do with CVICALLBACK? I can't even figure out what it's function is in C, much less trying to translate it to VB.
09-28-2010 02:02 PM
Hi wdkeller,
The CVICALLBACK macro should precede the function name in the declarations and function headers for all user interface callbacks. This ensures that the functions are treated by the compiler as cdecl, even when the default calling convention is stdcall. CVICALLBACK is defined in cvidefs.h, which is included by userint.h. The CVICALLBACK macro is included where necessary in the header files generated by the User Interface Editor and in source code generated by CodeBuilder.
The above information was found in the NI LabWindows/CVI Help in the "Using Callback Functions to Respond to User Interface Events" page. Let me know if this does not fully answer your question.
09-29-2010 09:12 AM
Thanks for answering.
This tells me how to handle it in C, but I still don't understand how to handle it in VB. If I were programming in C, I could just cut and past some of the sample code and get it running, but I have no clue how to set it up in Visual Basic.