09-30-2011 01:34 PM
I need some help with clearing the values of a 1-D array of strings. The 1-D array of strings contains the column names of a different array.
This has to be printed to a file, but only once. Im able to do that, but the only problem is, the 1-D array of strings contains the previously stored values.
Those values are from a listbox, which will be frozen as soon as the user hits the OK/START button in the VI. I would like to print the values of the frozen listbox, but it instead prints the values of the un-frozen listbox.
The problem is clear to me, i should create an empty array of strings and store that value, but where in the sequence should this be done?
I have attached the VI, "Header" is the array im talking about.
Thank you,
Eureka
Solved! Go to Solution.
09-30-2011 03:05 PM
Your Vi is full of race conditions due to overuse of uneccessary local variables and I am surprised it works at all. You write to and read from local variables in parallel and there is no way of telling what occurs first.
I would recommend to eliminate the locals and sequences and use pure dataflow to force correct execution order. For example you write "array 2" to "header" via a local variable in one place, some complicated output in another place directly to the indicator, and then read it again from a local variable before writing to the file. There is no telling what the "header" contains at that last point. Your entire code is peppered with these problems.
10-03-2011 12:13 PM
I have simplified the VI, this is a very basic VI. The problem im trying to solve is, i need to print the characters in the 1-D array "OP" to a text file. Here, OP consists of
"TIME 101 102"
where 101, 102 are the channel numbers which may vary. Those values are from the Listbox. The listbox is frozen once the "START" is pressed. Meaning, the user cannot change the channel values after that instant. I would like to print that channel values, the ones frozen. But what im printing is the ones before freezing the listbox, which is not correct.
Thank you,
Eureka
10-03-2011 03:35 PM
Solved!
I tried filling empty string arrays in the write header sub-VI and it works!
Thank you,
Eureka