LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRio - Write into file

Solved!
Go to solution

Hey friends,

 

I have a rather small problem, however was not able to fix it yet.

 

There is a zip file attached with a small vi to write some random numbers into a file.

The vi itself works. As you can see in the picture below it safes the data directly into the file.

 

xKoko.PNG

 

However if I start this vi in a MyRio Project and run it with the MyRio Device, the output is different. It still safes data into the file but does not start a new line for each set of numbers. Actually I dont know why 

 

xKoko_2.PNG 

 

Maybe you have a solution for it.

Thanks guys for your help.

 

Greetings

Samuel

0 Kudos
Message 1 of 4
(1,780 Views)
Solution
Accepted by topic author Suryoyono

Hi Suryoyono,

 


@Suryoyono wrote:

However if I start this vi in a MyRio Project and run it with the MyRio Device, the output is different. It still safes data into the file but does not start a new line for each set of numbers. Actually I dont know why 


The myRIO is a different kind of computer than your default Windows pc!

 

There are two differences between those two text files:

  1. one file is using a comma as decimal separator, the other uses a point
  2. one file is using "CR NL" (0D0A in hex display) as end-of-line markers, the other only "NL" (0A in hex display).

Both text files are valid, as you can easily see once you open them with Excel!

 

The problem here is that silly text editor from Microsoft/Windows: it cannot handle the plain "NL" end-of-line markers as it searches for Windows-default CR+NL.

Use a better text editor like Notepad++ to read the text file as you expect it!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(1,769 Views)

@Suryoyono wrote:

However if I start this vi in a MyRio Project and run it with the MyRio Device, the output is different. It still safes data into the file but does not start a new line for each set of numbers. Actually I dont know why 


What you are seeing is a difference in operating systems' End Of Line.  In Windows, EOL is a Carriage Return and a Line Feed.  Linux (what the myRIO runs) just uses a Line Feed.


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
Message 3 of 4
(1,761 Views)

Thank you guys both for your fast answers and awesome information.

I checked it out and if I open the txt data with excel, it rightly converts the data after setting it up.

 

@Gerd

I also downloaded Notepad++ and it works fine with it. Youre amazing haha.

 

I wish you both a great weekend and happy easter

0 Kudos
Message 4 of 4
(1,734 Views)