From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with clearing array in a sequence

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(2,156 Views)

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.

0 Kudos
Message 2 of 4
(2,136 Views)

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

 

Download All
0 Kudos
Message 3 of 4
(2,109 Views)
Solution
Accepted by topic author Eureka

Solved!

I tried filling empty string arrays in the write header sub-VI and it works!

 

 

 

Thank you,

Eureka

0 Kudos
Message 4 of 4
(2,092 Views)