LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

memory subvi

Solved!
Go to solution

Dear all,

I wonder how i can store data within a subVI when the iterating loop (an thus the shift registers) are in the mainVI (or in my actual case, four levels up in VI calling).

so far i solved this with a global array variable , but i feel this is not the way to do this. what is the best way for this?

last n ticks.PNG

Thank you for your advice!

0 Kudos
Message 1 of 6
(3,233 Views)
Solution
Accepted by topic author OPCler

Hi OPCler,

 

how i can store data within a subVI

To store data within a subVI you should use shift registers (or feedback nodes) IN the subVI.

 

i solved this with a global array variable , but i feel this is not the way to do this. what is the best way for this?

There is no "best" way - you need to look for appropriate ways!

- functional globals aka action engines

- notifiers

- global variables

- DVR

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,223 Views)

Feedback node! thats what i was looking for!

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

Hi OPCler,

 

in times before the feedback node we used to use while loops set to iterate just once to hold a shift register…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,201 Views)

what an evil hack ^^

0 Kudos
Message 5 of 6
(3,186 Views)

@OPCler wrote:

what an evil hack ^^


It is not a hack.  It is actually by design that we can use shift registers and feedback nodes to store state information ever since LabVIEW 2.0.

 

And you should also read up on the Action Engine.


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 6 of 6
(3,171 Views)