08-21-2012 09:36 AM
Hi im trying to save the translations I input in this VI into a text file, it works fine and saves the translations even if I press stop. My problem here is that when I exit LabVIEW and close the VI entireley the saved data is gone and I have to input the translations again. Help 😐
08-21-2012 09:44 AM
Can you post your vi in version older than LV 9.0 or post a snapshot? Are you creating the text file to save the translation and it is being erased when you exit the labview? If it is something like a text control input and then all you have to do is, set it as default and next time you open the labview it ll still be there.
08-21-2012 09:51 AM
You never close the file.
How are you stopping the program? The Stop button is not wired to anything and the Panel Close? event does nothing.
Lynn
08-21-2012 09:52 AM
I dont have any older versions but heres the snapshot. tnx
08-21-2012 09:54 AM - edited 08-21-2012 10:00 AM
Hi Mark,
I see some problems in your VI:
- you load your file at first using an array of I16 as type input for conversion to variant.
- then you add a lot of translations as strings - is this wanted this way as the file seems to consist of [I16]?
- after adding a translation you save a serialized string of your variant to the file,. This adds the full variant to the end of the file! Each time! So your file contains a lot of variants (as serialized string) and you probably only load the first of them at VI start...
- using text file functions for binary strings (as given by Serialize function) seems wrong to me...
Edited:
Why not store all those translations in spreadsheet files using simple 2D array of strings?
08-21-2012 09:54 AM
johnsold,
the stop button just got covered by the event structure, its in the back. Just click the stop button in the FP and find terminal you'll see its covered. sorry about that XD
08-21-2012 10:01 AM
GerdW
what input type should I use?
08-21-2012 10:02 AM
08-21-2012 10:14 AM
Im not really that familiar with the spreadsheet string you mentioned. Im quite new in LabVIEW. So I had to stick with this.
I managed to change the read/write text files to read/write binary files. does that lessen the errors I have?
08-21-2012 10:26 AM
@MarkBai wrote:
Im not really that familiar with the spreadsheet string you mentioned. Im quite new in LabVIEW. So I had to stick with this.
I managed to change the read/write text files to read/write binary files. does that lessen the errors I have?
Is that you really want? Be clear If you write to a binary file you cannot open that manually. You can use the simple Spreadsheet write.vi to write string and Numeric arrays into it. You can find examples in LabVIEW example or use a simple text file and set the file position to write multiple times.