LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write string array into cfg file

Hi, everybody.

I faced the problem to write array into cfg file. I am trying to put many items in a key. It should look like
[Section1]
Key1=el_1, el_2,el_3,.............el_n.
each element is string of 105 characters. Everything works fine when I save the only one el_1 or multiple for the  first time, however, when I am trying to update values in a key section some extra strings appear in a file. My VI is attached.

Thanks in advance
0 Kudos
Message 1 of 9
(4,693 Views)
Hi palnic,
there is no attachment.
Mike
0 Kudos
Message 2 of 9
(4,692 Views)
Sorry,
VI should be attached now
0 Kudos
Message 3 of 9
(4,678 Views)

Do you realize that your spreadsheet string only writes the following:

1111111111
  2222222222222222
 33333333333333333333

The way you wrote your VI, it sends the entire string above to the value for Write Key.vi.

Do you realize that value is for the data type only?  So I'm not sure what you want to do....

Without describing the problem you are having, can you describe what you actually want to do?

R



Message Edited by JoeLabView on 07-22-2008 11:49 AM
Message 4 of 9
(4,667 Views)
The configuration file functions do not properly handle having EOL characters in the key value. In your problem statement you said that you want to write the key out like this:
Key1=el_1, el_2,el_3,.............el_n.
But in your code you are using the EOL character to separate the individual strings. If you use the comma separator, as your post indicates, then subsequent writes with different strings will work.
0 Kudos
Message 5 of 9
(4,659 Views)
This is a  Profile Editor for controller Dimension2 CSZ Thermochamber, Each segment has to be submitted to the controller as a string,like this  "      75,      85,       0,       0,       0,       0,       0,       0, 1:30:00,____________,  1,  2,1,1" . I can send up to 8 profiles(recipes) with total 256 segments to controller.I store profile info into 2D array and now I want to save this array to file. In attached VI I replaced all varibles with constants, in real apps "SEGMENT", # OF SEGMENTS" and "RECIPE" are varables.

Thanks for response

A
0 Kudos
Message 6 of 9
(4,652 Views)
to
0 Kudos
Message 7 of 9
(4,645 Views)
Hello,

I am not sure to understand what  you want - However, attached you will find a VI that takes a 1D array of strings and put this data into a file.
Data of the array (el1, el2, el3, etc...) are stored in this way into the file : Segment="el1,el2,el3, etc...".                   As requested.

But think that your array element (el1 for instance) already includes coma (,) .. So in the file it will be difficult to dissociate elements.

Why you don't prefer to use "back to line" to separate elements into your file ?

Hope this will answer your question.

Chris


Download All
0 Kudos
Message 8 of 9
(4,607 Views)
smercurio_fc said " The configuration file functions do not properly handle having EOL characters in the key value...."

This is the reason why I could not save strings properly. I put " ; " as a separator and everything works just fine, attachment shows how each array element looks like(see description for command SG)

Thanks everybody for help
0 Kudos
Message 9 of 9
(4,589 Views)