Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Control LED with NI USB-6009 using ANSI C

Hello 🙂 

 

This is a tutorial to control a LED using ANSI C with NI hardware: 

 

1. Compiler used: cl from (Microsoft using VS Build Tools 2022- not necessary login - no IDE);

 

Capture1223.PNG


2. Library: NIDAQmx.lib;
3. Example of compiling (with include) and linking (in conolse: x86 Native Tools Command Prompt VS 2022):


      cl /EHsc /MD /I "C:\DAQmx ANSI C Dev adaptado\include" ControlLED.c NIDAQmx.lib


4. Put all files in same directory: NIDAQmx.lib and ControlLED.c;

 

Capture.PNG


5. It is mandatory to install the Drivers;
6. Obviously, see some examples of LabVIEW ANSI C (coming from NI);
7. Hardware used: NI USB-6009, you can use another;
8. Enjoy! And Have a good job; 🙂

 

 

Video (where you see the LED turns ON and OFF with a waiting time of 5 seconds): 

 

Download All
Message 1 of 1
(1,301 Views)