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: 

'Write to Text File Function' Data Error

Hi,

 

I'm using 'Write to Text File Function' to log data.

Currently I'm receiving data from serial port (186bytes in 1 packet, about 20Hz.) , directly logging it to binary text file.

 

When I replay my log data, data error (checksum error)  is constantly occurring.

But there is no data error in receiving data. I've checked it when I receive it.

So I saw hexa data, some bytes are written differently from received data.

 

Is it possible to occur data error while using 'Write to Text File Function'?

How can I solve it?

 

thanks,

0 Kudos
Message 1 of 3
(2,198 Views)

Hi Ujangsan,

 

I'm using 'Write to Text File Function' to log data. … directly logging it to binary text file.

What kind of data do you want to save?

Why do you use a TEXT file function to save BINARY data, when there is a "Write to Binary File" function?

 

So I saw hexa data, some bytes are written differently from received data.

Yes, that is because YOU have the file function configured this way.

Please read the help for WriteToTextFile to understand why and how this is happening!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,166 Views)

If you are logging binary data, then you need to use Write To Binary File.  What is likely happening is the "Convert End Of Line" is changing your data from 0x0A to 0x0D0A.  You can turn that off by right-clicking on the Write To Text File.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,153 Views)