From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Clear array

Solved!
Go to solution

Hi!

I'm creating a big project in LabView (I work with state machine) and I have a problem with one part of it. This is related with clearing array. When I press button "play", I start measuring. When I press button "jump", I add another measurement (here random number). But when I press button "refresh" I want whole array to be cleared. However, it only clears for one measurement period. Later, the old values come back up again. I think it can be related with "feedback node". In attachment is separated part related to clearing array.Does anyone have any idea how to fix it?

Thank you in advance

0 Kudos
Message 1 of 6
(1,293 Views)

The data is in the wire (and feedback mode), not in the indicator, so clearing an indicator has no effect. I strongly urge you to go back to basic LabVIEW tutorials because most of your code is extremely ill conceived.

0 Kudos
Message 2 of 6
(1,240 Views)

See if this can give you some ideas....

 

 

0 Kudos
Message 3 of 6
(1,232 Views)

Thanks for your help!

But in your programm, when I press button "refresh", I get after only zeros in the array. I want to have still the random number (also after refreshing)

0 Kudos
Message 4 of 6
(1,221 Views)
Solution
Accepted by topic author pecetowiec_28

@pecetowiec_28 wrote:

Thanks for your help!

But in your programm, when I press button "refresh", I get after only zeros in the array. I want to have still the random number (also after refreshing)


No, you get an empty array, there are no elements containing zero. You can easily modify the code to show whatever you want. Which random number do you want to see? (The array often contains more than one.)

 

It is difficult to come up with a solution if the requirements are not well defined.

0 Kudos
Message 5 of 6
(1,216 Views)

I modified slightly your programm and I get what I want.

So thank you very much for your help

0 Kudos
Message 6 of 6
(1,211 Views)