LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a txt file, load it, modify it and then save it again?

I'm using LV just to create that file. This file is used by another application which doesn't accept [ ] and =
What would you advise me?

 

0 Kudos
Message 11 of 38
(1,714 Views)
Hi JB and Kabanga,

by using a cluster with all needed controls it will be very easy to mimic the behaviour of the config file functions.
All you have to do:
1) one vi to convert this cluster to a string containing one block of data including the "begin" and "end"-lines ("format into string")
2) one vi to convert a string containing one block of data to this cluster ("scan from string")
3) one vi to read a whole file and split it into blocks
4) one vi to take an array of clusters, convert them to strings and write to file
5) user interface: one cluster shown at interface, maybe selection for array index to select other blocks, "load file" and "save file" button, event structure to handle all this
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 38
(1,710 Views)
Ok, thanks!
let me try it now and I'll tell you later the outcome!
One more question: I'm new here and don't know how to rate an answer. Any tipp?
Best regards
0 Kudos
Message 13 of 38
(1,695 Views)
Hi Kabanga,

you cannot rate when you are new in the forum... You have to have some more contributions before you're allowed to!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 38
(1,692 Views)
According to this thread (first message from Laura F.) you need at least 50 posts to be able to rate messages.
0 Kudos
Message 15 of 38
(1,689 Views)
Hi GerdW,
thanks a lot for your help.
Sincerely I couldn't impliment your idea because it's advanced and, I'm new to Labview.
I've written a programme (attached) file which is doing the job partially.
How can I add VI that create the sections "Begin LineX ...End LineX" (X = 1,2.3.......,127,128).
How can X be changed programatically?
 
Best regards
Kabanga
0 Kudos
Message 16 of 38
(1,668 Views)
Hi Kabanga,

some notes:
1) using property nodes "label.text" is quite senseless: the label will not changed during runtime, so you can replace those property nodes with a string constant.
2) instead of al those "concat string" functions you can use "format into string" with a proper format string, eleminating all those single string constants and "number to decimal string".

To include "begin LineX" and "end lineX" you need just one additional "format into string" at the end of the "block" building (last "concat string") and one additional input for the block number. When you include all your string building in a subvi, you can put this subvi in a for loop and use the iteration count as input...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 38
(1,653 Views)

Hi GerdW

i think to use the Label can be an advantage while devoloping, because if the label change you don´t have to search for the constant.

 

Hi Kabanga

i attached an example for you, to show how you can clean up your blockdiagram. Therefore you have to change the red frame with the green frame. It should do the same.

Mike



Message Edited by MikeS81 on 01-30-2008 06:54 AM
0 Kudos
Message 18 of 38
(1,646 Views)

Hi Mike
thanks for your help.
I'm using  LV 8.2.
Could you plese save it under LV 8.2 and send it again?

Best regards
Kabanga

 

0 Kudos
Message 19 of 38
(1,642 Views)

Hi Kabanga,

i´m sorry. Here is the 8.2 version.

Mike

0 Kudos
Message 20 of 38
(1,640 Views)