08-19-2017 07:53 PM
Hello,
I am configuring a code for continuous sampling using NI-DAQmx (6255). In the ANCI C sample codes, the following is used:
int32 CVICALLBACK EveryNCallback(...
Is this only for CVI environment or can I use it on gcc too?
Cheers
08-21-2017 12:35 PM - last edited on 11-26-2024 06:13 PM by Content Cleaner
Reference here:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9udSAC&l=en-US
08-28-2017 11:12 AM
Nope, I have already generated the necessary library for the gcc compiler. I just want to know whether " int32 CVICALLBACK EveryNCallback " works on gcc. I am not sure since it calls CVICALLBACK. I was able to compile the sample code. But I dont know if it will work fine with the device.
08-28-2017 03:52 PM
CVICALLBACK is just a #define to (ultimately) tell the compiler to use the __cdecl calling convention:
#if defined(__linux__) || defined(__APPLE__) #define __CFUNC #define __CFUNC_C #define __CFUNCPTRVAR #define CVICDECL #define CVICALLBACK CVICDECL #else #define __CFUNC __stdcall #define __CFUNC_C __cdecl #define __CFUNCPTRVAR __cdecl #define CVICDECL __cdecl #define CVICALLBACK CVICDECL #endif
Assuming that gcc understands the __cdecl keyword it should work fine.
(In this context "CVICALLBACK" isn't specific to CVI, it refers to any C environment. The "CVI" prefix is present for historic reasons.)