LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does Write File.vi put a square in front of the data?

I am write a program to run a 601PRO Safety Analyzer using the serial port. I am trying send the results from my program to either a text file or an Excel file. If I use Write to Spreadsheet File.vi I can't get the time/date stamp to work, plus I would like to send text like operators name and serial number of the device under test. If I use the Write File.vi, I get a square in front of my data. I have version 6.0 on Windows NT. Any ideas?
0 Kudos
Message 1 of 5
(2,948 Views)
As many times said, you can modify write to spreadsheet file, change it's numerical controls to string controls, and then you'll have the posibility of including strings. One interesting approach is to use this modified write to spreadsheet to write the first row, as headers, and to put data use the normal write to spreadsheet with append TRUE.
Hope this helps
Message 2 of 5
(2,948 Views)
To answer your original question, if you wire a numeric to the Write File function, what you are creating is a byte stream file. If you want to be able to read the data file or export it to Excel, you have to convert everything to strings as Gorka said.
0 Kudos
Message 4 of 5
(2,948 Views)
Thanks for everyones help. This was my first question as I am new to LV and your/everyones response was a pleasant surprise.
0 Kudos
Message 5 of 5
(2,948 Views)
Try using the "Array to spreadsheet string" function to make the data you
need to write Excel-compatible. Then you can append the required data to
the string (After each carriage return if you need to add an X-axis later or
simply to the beginning of the string if you need to record operator etc.).

Once the string is finished, use the "Write characters to file" function to
write the file and hey presto.

Things to remember

Use the same seperator character (Tab by default) when adding your own data.
Don`t forget to terminate every line with a carriage return.

I haven`t done this in version 6, but I presume the base functions remain
the same.

A notice to Natrional Instruments : A "Write to spreadsheet" function with a
"Header" function would be really nice.....(Perhaps
it`s in LV6 already, I
dunno)

Hope this helps

Shane


Brad22 schrieb in Nachricht
<5065000000080000004C1F0000-986697009000@quiq.com>...
>I am write a program to run a 601PRO Safety Analyzer using the serial
>port. I am trying send the results from my program to either a text
>file or an Excel file. If I use Write to Spreadsheet File.vi I can't
>get the time/date stamp to work, plus I would like to send text like
>operators name and serial number of the device under test. If I use
>the Write File.vi, I get a square in front of my data. I have version
>6.0 on Windows NT. Any ideas?
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 5
(2,948 Views)