Showing results for 
Search instead for 
Did you mean: 

Insert values to a txt file

I need to save the sensor values ​​in a file, in this case it would be a txt file, I followed an example to save the values ​​but when I run vi and then I stop to see if the file has the saved values ​​it has nothing saved where I will be to miss?

0 Kudos
Message 1 of 9

Here are some suggestions to help you debug your own code:

  • Does the inner While loop run?  Test by wiring an indicator to the Loop Index "i" and see if it changes.
  • What, if anything, is on the wire going to the "Write to Text File" VI?  Right-click on the wire and choose "Probe", which pops up a little window that shows you when anything is put on the wire and what is put there.  If you don't write, then the file will be empty.
  • Copy your file to one called "Test Me", remove almost everything except the File I/O stuff, do a Write to Text File with a constant "Test" wired to its input.  Verify you are writing something.  If not, check how you are setting up File I/O. 

Bob Schor

0 Kudos
Message 2 of 9

I did what I suggested and even the block of gives the value obtained in the string, put the Probe in the string of string to as the figure. but i'm going to the file and not show the values.

0 Kudos
Message 3 of 9

I am noticing some cRIO nodes in there.  What target is this VI running on?  If running on the cRIO, then you cannot write directly to your PC.  You would need to stream the data to your PC to save the file.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 4 of 9

So you have some characters in the string going to the Text Write.  That's good.


But when you open the file, nothing is in it.


Have you put a probe or indicator on the error wire after the Write to Text File?


@smalhao wrote:

but i'm going to the file and not show the values.

Yes.  So?   This is called debugging.  Putting some things on screen so you can see if the code is behaving the way you want.  When it is working properly, then you can take those things back out!

0 Kudos
Message 5 of 9

The VI running in scan mode on the server is attached, and Probe wire following gives no error status

0 Kudos
Message 6 of 9

How i export the data of cRIO to PC?

0 Kudos
Message 7 of 9

I tried to export cRIO 9040 analog port values ​​to PC via lossless communication with network streams, sticking the probe in write file the values ​​are there but i'm not receive them in the file of reader.

0 Kudos
Message 8 of 9
0 Kudos
Message 9 of 9