LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

does PID loop transfer values to new instance

Greetings Everyone,
 
I'm a new forum user, but I've been using Labview for about three years now. 
I have an application that uses PID VIs in multiple cases of a case structure.  Each case structure passes a different set of setpoints, gain schedules, limits, ect to the new instance of the PIDvi.  What I'm wondering is this:  When I switch cases to the new case structure, does all the integral and derivative information get lost in the shift registers of the old PID instance, or does labview keep them in memory and pass them to the new instance?  If it kept it in memory it would be a great help, becasue there would be less upset in my PID loop.  If not, then I'm going to have to pass a cluster of that information into the new instance...which I'd rather not do to save on system requirements (real time system). 
 
Thanks for the input
Grub
Hell, there are no rules here...we're trying to accomplish something!!! - Thomas Edison
0 Kudos
Message 1 of 4
(2,749 Views)
The PID VIs are reentrant, so the answer is no - each copy has its own data. You can create copies of the PID VIs and use 2 additional items to pass the data - a boolean input which will tell the VI whether to use its own data or the other data and an LV2 global which you can use to transfer the data.

___________________
Try to take over the world!
Message 2 of 4
(2,737 Views)
Thats what I was afraid of....:womansad: 
From a memory standpoint:  WOuld it be better to pass those values in a shift register on the while loop this stuff is inside, or using the global technique you mentioned....I'm assuming shift register in this case...right?
 
Thanks for your input
Grub 
Hell, there are no rules here...we're trying to accomplish something!!! - Thomas Edison
0 Kudos
Message 3 of 4
(2,732 Views)

Using the shift register will only work if you make the VIs not reentrant. In any other case, you will need some means of global data storage. I think the most memory efficient is LV2 Globals (also known as Functional Globals), but I haven't tested it, and I know of some benchmarks that showed that the fastest is single element queues globals.

A single element queue global is a queue with the size of 1 where you always remove the element from the queue when doing an operation. This locks any other calls to the queue, because it's empty, and they will have to wait until you place the element back in the queue.

You can search for the other terms to find some documentation about them.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,728 Views)