Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2182

Control LED with NI USB-6009 using ANSI C

$
0
0

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

 


Viewing all articles
Browse latest Browse all 2182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>