From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

int32 CVICALLBACK EveryNCallback on gcc

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

0 Kudos
Message 1 of 4
(2,607 Views)

Reference here:

 

https://forums.ni.com/t5/Multifunction-DAQ/How-Can-I-Use-The-NI-DAQmx-ANSI-C-Function-Library-With-G...

 

Using NI-DAQmx in Text Based Programming Environments

http://www.ni.com/tutorial/5409/en/

 

Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications

http://www.ni.com/product-documentation/2835/en/

 

How Can I Use the NI-DAQmx ANSI C Function Library with Borland C and Delphi?

http://digital.ni.com/public.nsf/allkb/B09727F89DA3A06C86256F430071D88E

0 Kudos
Message 2 of 4
(2,513 Views)

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.

0 Kudos
Message 3 of 4
(2,476 Views)

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.)

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 4 of 4
(2,472 Views)