From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

log data to a file

The attached vi is wroking as I need and displaying data correctly on a X/Y graph.  I cannot figure out how to effectively write both y values along with their time stamp to a log file.  Any help or suggestions would be appreciated.  Thanks.

0 Kudos
Message 1 of 7
(2,370 Views)

if you could post a the vi in labview 2009 or post a snippet, I might be able to help.



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 2 of 7
(2,350 Views)

I saved it as version 9.  Can you work with that?  I also posted a jpg.  Tahnks for the help.

Download All
0 Kudos
Message 3 of 7
(2,345 Views)

Your VI is still in LV2011 and I can not open it. Looking at the snippet of your code, I would recommend using tdms file format, which would be easier to work with. You would just need to input the bundled data to the tdms write and set the channel names according to the order. refer to tdms write examples in labview for more idea. Hope it helps.



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 4 of 7
(2,334 Views)

Hey Jootbox,

 

There are a lot of different ways to accomplish this. A simple start would be to take a look at the Write to Measurement File.vi. This express VI is able to work with a variety of different inputs and can output a couple different file formats (LVM, TDMS, TDM). It would be best at this point to specify how you want to format your file output. Im guessing you want it to have 1 timestamp value with two corresponding digitial values? Something like this,

 

time          value 1           value 2

 

0                   5                       5

.1                  5                       5

.2                  0                       5

 

Is this the kind of format you want? If so you may want to combine the acquisition of your digital channels into 1 task. 

http://digital.ni.com/public.nsf/allkb/0C1ADEF06A54AB2D862575040066FD51

 

Then write the output of this task to a file. It should automatically append a timestamp when you're writing to a TDMS file.

 

Tim A.
0 Kudos
Message 5 of 7
(2,310 Views)

Easiest starting point is to use the vi Write To Measurment File.vi   You just attach your data to the signals input and select how you want it to work.  If you need anything more than that it gets more complicated, because doing the simple stuff in labview is what is difficult.

0 Kudos
Message 6 of 7
(2,305 Views)

Please have a look at the NI TDMS File Format document to get an overview what's possible with TDMS. You might want to concentrate on the LabVIEW section first and follow the link to the Introduction to LabVIEW TDM Streaming VIs - which is the next step in case "Write To Measurment File.vi" is not sufficient

0 Kudos
Message 7 of 7
(2,284 Views)