Showing results for 
Search instead for 
Did you mean: 

collecting data and storing into an array using a sub VI

Go to solution

I am using a VISA READ function to get measurements out of a DMM.

Every time i run the program i get a different number. Everything works perfect up to that point.

now i have a subVi to be able to store the data one after the other everytime i take a measurement so that i can ultimately insert it into excel.

it is not working as i intend, what am i doing wrong?

Download All
0 Kudos
Message 1 of 5

Don't wire the constant to the shift register left terminal, because this will empty the SR at each call.

Also, remark that "Read" is actually "Read and initialize". Consider a change to the operation name.

LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 5

i removed it and still have the same issue.

And about the change to the operation name, what do you suggest?

0 Kudos
Message 3 of 5
Accepted by topic author JohmDoe86
  • Please (please!) do not maximize the front panels and diagrams to the screen. Super annoying!
  • Your DMM code does not have a toplevel loop, you should make it a state machine instead
  • Your subVI needs to complete after one iteration, so don't use a stop button
  • The read mode needs the array wired across to be non-destructive
  • Terminals need to be on the toplevel diagram, not inside structures
  • Use a standard connector pane.
  • If you want to just record successive runs to a file, just append to a file. No need for subVIs. (this also ensure that all data collected so far exists, even if the computer crashes later)
  • Use reasonable terminal names ("array" is not descriptive enough.
  • To get an empty array, just do "use default if unwired" in the init case.
  • do. some. beginner. tutorial.
  • etc.




0 Kudos
Message 4 of 5

First: wire a true constant to the While Loop stop terminal. Any operation must only be done once.

Second: connect the right terminal to your output (now it's the emptied shift register).

LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 5