ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retaining Last Value without a While loop

Solved!
Go to solution

Hello,

 

I am using LabVIEW 2013. Attached is my VI. I am sending in a "Curr. TestPlan Row" random numbers at random times. I am wanting it to retain its last number whenever this VI is not being called, and then reset the value to it's new value whenever the VI is called again and a new number has been sent. Also attached is a screenshot of when the VI is called.

Please note, I cannot use a WHILE loop, so it has to retain its value a different way...

 

Thanks in advance for any help!

SM

Download All
0 Kudos
Message 1 of 7
(4,529 Views)

Im not sure why you cant use a while loop, its possible to have a loop iterate one time and use a FGV. I attached a link for this.

 

You can also use a config file to do this.

 

 

https://forums.ni.com/t5/Example-Code/Basic-Functional-Global-Variable-Example/ta-p/3503982



-Matt
Message 2 of 7
(4,517 Views)

Matt,

 

I can't use a WHILE loop for several reasons. What about a FOR loop?

 

Thanks,
SM

0 Kudos
Message 3 of 7
(4,498 Views)
Solution
Accepted by topic author Sman29

Maybe a feedback node?

0 Kudos
Message 4 of 7
(4,496 Views)

There is nothing wrong with a while loop if it iterates only once and used as scaffold for an unititialized shift register. You can also use a globally initialized feedback node, which does not need a while loop.

 

This entire subVI makes no sense. This is just a continuation of your old thread, banging your head against the same concrete wall. You are digging yourself into a deeper hole again.

0 Kudos
Message 5 of 7
(4,491 Views)

Kyle,


I think a Feedback Node is exactly what I was looking for! Now I just got to figure out how to implement it for my "Curr. TestPlan Row" number properly...

0 Kudos
Message 6 of 7
(4,478 Views)

Matt,

 

Could you elaborate on the config file? Such as the name of the function so I can look it up or something?

 

Thanks,
SM

0 Kudos
Message 7 of 7
(4,462 Views)