12-22-2016 06:30 PM
Hi,
Is there a way to limit the rate of change of a variable without using the PID Output Rate Limiter VI? I tried using this VI and noticed that I can't call multiple instances of this VI without the outputs from each instance being the same. I understand that there is a DBL array input version of this VI which appears to allow different rate of changes for different variables, but ideally I would like to be able to control the rate of change of multiple things without merging everything into one VI.
Does anyone know how to implement something like this? I thought about using time and referencing it to calculate the for the next output, but I'm not sure how to write it in LabVIEW.
Thanks.
Solved! Go to Solution.
12-23-2016 02:10 AM - edited 12-23-2016 02:11 AM
@victorzhao wrote:
Is there a way to limit the rate of change of a variable without using the PID Output Rate Limiter VI? I tried using this VI and noticed that I can't call multiple instances of this VI without the outputs from each instance being the same.
This VI is reentrant, so each instance should have its own data space, so I am not sure why you say they don't. Alternatively you could write your own.
It would really help if you could show us a simplified version of your code so we understand what you e.g. mean by relatively poorly define and vague terms such as "variable", "next output", multiple things", "something like this", etc.
12-23-2016 10:53 AM - edited 12-23-2016 10:54 AM
Hi altenbach,
Thanks for the reply.
I have attached a simple version of how I am using the PID Output Rate Limiter VI. From the attached VI, I call the attached VI three times for each ISCO screw pump that I am using to manage the operation mode of the ISCO screw pump: it can either run in constant mode or it's supposed to increase/decrease at a fixed rate. Here's where the weird thing is happening:
When I run all ISCO three screw pumps in constant mode, everything works as intended and all the pumps are independent. However, once I switch the pumps over to increase/decrease at a fixed rate mode, the pumps seem to respond identically. The only change between running the pumps in constant mode and increase/decrease at a fixed rate mode is the use of the PID output rate limiter VI.
I am likely using it incorrectly, but I'm not too sure how else I could use it.
Thanks.
12-23-2016 11:01 AM
12-23-2016 11:08 AM
@GerdW wrote:
Hi zhao,
you need to make your attached VI reentrant, when you want to call it from 3 instances without interfering each other!
Not just reentrant, but Preallocated Clone Reentrant.
12-23-2016 11:14 AM
Hi,
Thanks for all the quick replies.
Here's another simple question relating reentrant VIs:
Would I have to set the entire mainVI and all subVIs to reentrant or only the subVI that I posted in my earlier post?
Thanks in advance!
12-23-2016 12:50 PM - edited 12-23-2016 01:04 PM
Only the subVI.
(The PID is already reentrant, meaning that each instance placed on the block diagram has its own memory space. SInce you are currently calling it from a non-renetrant subVI, one copy of your subVI is shared by all calling locations. Once your subVI is reentrant, each instance placed on the diagram is independent and has its own copy of the PID tool. Just try it!)