10-22-2012 12:33 PM
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?
10-22-2012 12:51 PM
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.
10-22-2012 01:23 PM
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).
10-22-2012 01:28 PM
Yes. This is the exact case for plotting previous and current data.
10-22-2012 01:31 PM
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.