LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading current from a multimeter using "read" button, putting data into array

I am trying to read current through a resistor using a multimeter using
a user operated button on the front panel and then collect all of the
readings in an array.

I can get the readings but as soon as the next reading comes in it
overwrites the previous data in the array, leaving me with only one
reading. I know you can use shift registers to save data but I cant
figure out how to make that work with my user controlled button. I
could also use a pop up message, prompting to insert a new resistor.

I appreciate any help you can give, thanks.

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

Yes you would use a shift register to remember your array of readings

Every time you take a reading you would append the new data to array using build array in concatenate mode.

If you select a new resistor just wire and empty array to right hand side shift registor in the  loop. That will reset the readings array in the following iteration of the loop.

David

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

David Crawford wrote:
> Yes you would use a shift register to remember your array of readings
> Every time you take a reading you would append the new data to array using build array in concatenate mode.
> If you select a new resistor just wire and empty array to right hand side shift registor in the  loop. That will reset the readings array in the following iteration of the loop.
> David


Thanks for your help with the concatenate mode, that helped alot. I
still have one more problem. I cant figure out how to make the for
loop (taking the readings) run only once when I press the "read"
control button. I can set a constant to the "N" on the For loop and it
will make an array of that many values, but I need it to add a reading
to the array everytime a the read button is pressed, any ideas?

Right now I have a case statement where when the "read" button is true
it makes the "N" = 1 and if false, the "N" = 0, this doesnt work
because once the "N" = 0 (button not pressed), the array dissapears.
Thanks for your help so far.

0 Kudos
Message 3 of 4
(2,397 Views)

It should be a while loop instead of a for loop. I would recommend that you use an event structure inside a while loop.

Take a look at the example Acquire-Analyze-Present.vi shipped with Labview. To get to the example goto Help menu then select Find Examples. Once the Example Finder is up goto the search tab and enter event. Double click event-driven. You should then see the example vi. This VI would be a great place to start.

David

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