knowledge-database (beta)

Current group: comp.lang.labview

Re: writing a serial string to ascii file

Re: writing a serial string to ascii file  
tbob
From:tbob
Subject:Re: writing a serial string to ascii file
Date:Fri, 21 Jan 2005 16:11:00 -0600 (CST)
See attached vi. It contains code on how to write your data to a file. I =
put comments in a red text block. Had to change some things like making lo=
ops stop after one iteration because I don't have anything on my serial por=
t. You can change them back or just copy the added code for file writing i=
nto your existing vi. Basically what I did was to open a file, convert the=
retrieved data from a number into a string, concatenated the data into a s=
ingle string with commas separating the data and an end of line constant to=
terminate the string, then write the line to a file. I did the same for t=
he next case which collected wind data. When the stop button is pushed, th=
e file is closed. If you look at the file that is generated, you will see =
something like:
12.4, 45, 56.23 (this is pressure, temperature, humidit=
y)
34, 45 (this is wind speed and direction)
The last line =
may be repeated 5 times with different data because your code does 5 loops.=
Anyway, I hope you get the idea on how to write sequential data to a file=
You can add labels and headers by concatenating labels before the data, =
and writing a header to the file before the loop begins.


dataCollect.vi:
http://forums.ni.com/attachments/ni/170/103437/1/dataCollect.vi
   

Copyright © 2006 knowledge-database   -   All rights reserved