LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Characters To File

I'm using a "Write Characters To File" to save my data.
The data is a String and its Flatten before it send out over UDP (Send) Connection. Each time it is sent out, I'm seeing a 0's in front of the each character. So why the �Write Characters To File� does puts 0's in front of each character?

The help on "Write Characters To File" does not clarify the issue.

Any help would be appreciated.
Thanks,
0 Kudos
Message 1 of 5
(2,952 Views)
It's a little unclear as to what you're doing. Do you have a string, flatten it, do a UDP Write? Then at the receiver, do a UDP Read and then Write Characters to File? You don't mention doing an unflatten from string anywhere. If you flatten it before sending, you have to do an unflatten right after receiving it. Have you looked at the shipping examples called UDP Sender and UDP Receiver? They do pretty much the same thing except the reciever doesn't save the data to a file.
0 Kudos
Message 2 of 5
(2,952 Views)
I'm running into different pitfalls. I have a 1D array with 27 elements and would like to send it over UDP connection. Before I send the data, I must change the format to a String. So I'm using Flatten to convert from Array to String, so UDP can send the data across the channel. Now, before I send the array I would like to save the data into a file (.txt). (Note: Data could be Numeric or Characters). So far I have been converting array to string by using� Array To Spreadsheet String". The output String goes to "Write Characters To File" to save my data. Now the data is horizontal instead of vertical due to "Array To Spreadsheet String".

Thanks
0 Kudos
Message 3 of 5
(2,952 Views)
"I'm running into different pitfalls. I have a 1D array with 27 elements and would like to send it over UDP connection. Before I send the data, I must change the format to a String. So I'm using Flatten to convert from Array to String, so UDP can send the data across the channel. Now, before I send the array I would like to save the data into a file (.txt). (Note: Data could be Numeric or Characters). So far I have been converting array to string by using� Array To Spreadsheet String". The output String goes to "Write Characters To File" to save my data. Now the data is horizontal instead of vertical due to "Array To Spreadsheet String". So how can I get the Array to save vertically to a file?

Thank you,
0 Kudos
Message 4 of 5
(2,952 Views)
Array to Spreadsheet simply takes the elements of the array and inserts the specified delimiter between them. If you want each element to be on a different line, simply use the EOL constant as the delimiter. The constant can be found on the string palette.
0 Kudos
Message 5 of 5
(2,952 Views)