LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting rate of change of a variable

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(4,582 Views)

@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.

0 Kudos
Message 2 of 7
(4,526 Views)

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.

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

Hi zhao,

 

you need to make your attached VI reentrant, when you want to call it from 3 instances without interfering each other!

Best regards,
GerdW


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

@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.

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

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!

0 Kudos
Message 6 of 7
(4,482 Views)
Solution
Accepted by topic author victorzhao

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!)

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