LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control updating the Array?

 I want the array to have both previous and present input. I am trying to use the "Start Reading" button and a case structure to control updating the array. However it does not work. I have to keep the while loop running. I want to use the "Start Reading" button to control updating the Array. Any suggestions?

0 Kudos
Message 1 of 5
(2,445 Views)

What you are asking to do in LabVIEW is fairly trivial and I sure some else is currently whipping up a Producer- Consumer Event loop right now  But if not I'll post back.

 

Your vi shows that you may not understand a few basics concepts of dataflow  for instance your boolean "Start Reading" will only be read 1 time before the loop starts so there is no way to reach both cases of the case structure.  Also, because you abused that local variable you have a possible race condition where there is no way to determine if the array contains two copies of input (What order do these actions take.  Read input terminal, write Variable terminal and read variable local?)

 

The getting started exercizes will point you in the right direction there are also some examples that ship in LabVIEW for acquiring and displaying data.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(2,439 Views)

Just to make sure I understand what you are after...

 

You want the output array to be the current input value and the last input value.  The output is only updated with the button press (press and update once, wait for another button press).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,429 Views)

Yes. This is the exact case for plotting previous and current data.

0 Kudos
Message 4 of 5
(2,425 Views)

Based on my understanding posted above, I think this is what you really want.

 

Shift Registers and Event Structures are you friends.  Look these two guys up in the LabVIEW Help and the Example Finder and become very familiar with them.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,423 Views)