LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

analog input to file ansi c

Hi, i'm trying to use NIDAQmx and AnsiC to develope a basic software, i need to know where i can find some infos for file input output, tipically at the moment i have a very simple problem, how can i acquire from analog input and write samples to a file?
In the C reference help i cann't find anything, in the ansiC examples there's nothing like this for what i've seen.

Regards Flavio
0 Kudos
Message 1 of 5
(2,937 Views)

Hello Flavio

in the AnsiC library there are several functions for file I/O: fopen, fclose, fread, fwrite, fprintf, ... Check the Input/Output class of the AnsiC Library.

Labwindows also has it's own functions for File I/O. Check File I/O in the Formatting and I/O Library.

If you have any specific questions about using these functions, just post again...

0 Kudos
Message 2 of 5
(2,929 Views)
Thank you, first of all a question, i know this isn't the right place, where can i post questions regarding Ansi C  programming cause i'm not using LabWindows or msVC.

Second question, it's not clear to me how to write acquired datas to a file, i created a task with analog inputs, i do acquire samples, but at this point, how do i acces to those datas?

Does anyone have an example of data acquisition from one analog channel and data logging to a text file or something similar?

Regards and please excuse me if i'm not too clear, i'm not a coder...

Flavio
0 Kudos
Message 3 of 5
(2,926 Views)
Guess its the         DAQmxReadAnalogF64   function....

Fl
0 Kudos
Message 4 of 5
(2,921 Views)

Under the Help menu of CVI select Find Examples.  Look under Fundamentals then File Input and Output for examples on how to handle file io.  Look under Hardware Input and Output then DAQmx for examples on how to acquire and access data in an array.  That should get you started.

There are some great examples that you can run to see how various things behave or can be done.  If you have any more questions please feel free to post them here.

Good Luck

0 Kudos
Message 5 of 5
(2,907 Views)