Beckhoff - Ramp that can be interrupted/updated while ramping operation is in progress

Viewed 40

I am looking for a way to ramp lights properly. This function block looked like a good candidate :

https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclibbabasic/11640060811.html&id=

Unfortunately, it will ignore any subsequent nEndLevel updates. So while ramp is in progress any new values of nEndLevel Are ignored where what is usually needed from this type of ramp is to stop the current ramping operation and start a new one as soon as new nEndLevel value is received. Is there any other ramp function block in the Beckhoff library that can do that ?

I need a ramp that can be interrupted/updated while ramping operation is in progress basically.

1 Answers

I don't think you need another function block...

A rising-edge at bStart starts dimming the light from the actual to the end-level (nEndLevel)

bStart: This input starts the dim-ramp from the actual value to nEndLevel within the time defined as tRampTime. This can be interrupted by bOn, bOff or bToggle at any time.

As I understand it, a rising edge on bStart starts a new ramp.

You could try to detect the change in the value of nEndLevel and generate a rising edge on bStart, which should make it generate a new ramp. For example, using a temporary variable nEndLevel_old that retain the old value for comparison in the next cycle.

Related