Today I’m presenting you to an example of how to use Start on delay timers in STL.
These two pdf sheets with the instructions of the STL may be of use for you:
Sheet 1– Sorted by category.
Sheet 2 – Sorted alphabetically.
However I would strongly recommend using F1 on your IDE to find out more about the particular function you want to use.
For my particular case and following the thread of the last post I’ve decided to model a tank with its respective High alarm, high warning, low warning and low alarm.
So, in STL how do I initialize a timer comparing values?
Let’s start by writing the High level alarm
We have must compare values, to do so we’ll use the function Load, L.
L #CV // We load the current value read from an analog input to the Accumulator 1.
L #HAlarmSP //We load the Set point when we’ll see an alarm to the accumulator 1, deplacing #CV to accumulator 2
>=R // We compare whether The accumulator 2 (#CV) is greater than the accumulator 1( #HAlarmSP) if this is true then the program continues its execution downwards.
L #AlarmDelay // We load the time to delay the alarm.
SD “TimerHAlarm” // We put the loaded time in the timer initializing it in case the condition mentioned above is true. (This has been declared in a TagList within the TIA Portal IDE.
A “TimerHAlarm” // This is the output of the timer (TMR.Q for those who use . notation)
= #HAlarm // This will be the bool that will be true once the time has elapsed.
So far, so good? I hope so, if not I’ll let the example I’ve programmed here.
And as an exercise I encourage you to program the rest of the code to get a High warning , Low warning and Low alarm.
Here is the video of what I’ve programmed: