LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

write in a text file

Hello,

I would like to translate a VI I did which makes multiple acquisitions on multiple channels, and a little bit of processign after that, to a C# interface.
I found examples to start developping the C# interface, but I still miss something really important for me : an accurate time reference for each acquisition and each calculation. In the .vi I did before, I used the "write LABview measurement file" block, which fit very well to my needs.
Is there a way to have access to the same time data through the NI-DAQmx API ?
I've been looking in the "Task" class, "Timing" objects, but I haven't found anything fitting to what I need.

I've read in your message that I would just have to "multiply for every sample the acquision period by sample index in measures array".
Do you know if the "write LABview measurement file" block logs time data in the same way ? And what about the time logged with each calculation done in the .vi ? Is it also based on the same data?

Thx,
Adrien
0 Kudos
Message 41 of 44
(1,507 Views)

Hello Adrien,

The DAQmx driver will actually get t0 from the system clock.  Once the DAQmx Read is done retrieving data, it will call the system clock from the computer and will calculate t0 depending on how many samples it acquires.  The DAQmx driver is assuming that all of the samples are continuous and will use dt to calculate the time of each sample.

This is why your t0 and dt may not be accurate if there is a long delay between DAQmx Reads or when you start the task.  LabVIEW takes this information and assumptions to develop the header information.  In order to get the same information, you will need to call the system clock and derive the t0 of your acquisition.


Message Edited by Robert F on 09-11-2007 01:37 PM

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 42 of 44
(1,480 Views)

iFile = OpenFile (sLinTableFile, VAL_WRITE_ONLY, VAL_APPEND, VAL_ASCII);// "E:\autoo\xducer.txt"
sprintf (msg, "%s [%s]: Your line of data", DateStr (), TimeStr ());
WriteLine (iFile, msg, -1);
CloseFile (iFile);

 

 

 

 

I TRIED THIS BUT AM GETTING 

library function error(return value==-1[0xffffffff])

0 Kudos
Message 43 of 44
(1,017 Views)

This error results from the call to OpenFile() ?

So how does sLinTableFile look like? Does the path name include double backslashes?

0 Kudos
Message 44 of 44
(1,015 Views)