NI Home > Community > NI Discussion Forums
Reply
Member
Hougang
Posts: 7
0 Kudos

How to open saved files using 'read from text file' function

Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?

 

Here are some screenshots on part of my program :smileyhappy: 

let me know if you guys would need more information / screenshots :smileyhappy: thank you!

Knight of NI
altenbach
Posts: 26,095
0 Kudos

Re: How to open saved files using 'read from text file' function

[ Edited ]

What is your LabVIEW version. In all recent version "write to text file" in not something you can modify. Your modification was very misguided and shows very poor understanding of LabVIEW and dataflow. (e.g. Why is the orange array terminal inside the loop? Why is array to spreadsheet string inside the loop? Why do you loop multiple times if you are always writing the same data? Why is there a 500ms delay? That makes no sense even though you added a diagram comment)

 

You should never modify stock VI. If the connectors don't match, you are using the wrong tools! For example, "write to spreadsheet file" is probably what you want.

 

Please attach your VI instead of images. We cannot debug images.

 

 


LabVIEW Champion . Do more with less code and in less time .

Knight of NI
Dennis_Knutson
Posts: 31,979
0 Kudos

Re: How to open saved files using 'read from text file' function

Why are you making it so difficult for yourself? Simply write using the Write to Spreadsheet File and read with the Read From Spreadsheet File.

 

Don't really know what VIs you are modifying. Write to Text File and Read From Text File are functions you cannot modify. Are you using an old version of LabVIEW?

Member
Hougang
Posts: 7
0 Kudos

Re: How to open saved files using 'read from text file' function

I'm really a noob at this, I kept whats there is because it worked :x Only recently started learning how to use labview. sorry people. Will attach my vi now. :\

Member
Hougang
Posts: 7
0 Kudos

Re: How to open saved files using 'read from text file' function

Oh and im using Labview 2009 version 9.0f3 (32-bit)

Member
Hougang
Posts: 7
0 Kudos

Re: How to open saved files using 'read from text file' function

I went under 'Help' and used the 'Search for examples'. from there i found Write to text file and open it and modified the block diagram ><

Knight of NI
altenbach
Posts: 26,095

Re: How to open saved files using 'read from text file' function

[ Edited ]

Well, better look in the file IO palette next time. It's all there! :smileyvery-happy:

 

Here's a quick draft. I also left some other random diagram comments.

 

(You did not attach any subVIs so I cannot test. There could be bugs)

 

NOTE: you don't need any value properties. There is an execute VI option to "clear indicators when called".


LabVIEW Champion . Do more with less code and in less time .

Member
Hougang
Posts: 7
0 Kudos

Re: How to open saved files using 'read from text file' function

Ohmy, thanks 

( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose ) :smileyvery-happy:

 

The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project