Delayed control sequence

Forum Home Forums Understanding the Software Delayed control sequence

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #17759
    oley
    Participant

    Hi,
    I’m using the Auto Control Module to control power.
    I have a calculated channel CnlLimit whose script returns a Yes or No value.
    I added a Channel Data Trigger, which works fine.
    However, I need a backup action: after the trigger fires and a time interval elapses (e.g., 3 minutes), it must check whether the power is below the minimum threshold, and if not, shut it down hard using a switch.

    How can I implement the following algorithm as simply as possible:
    if CnlLimit > 0 CnlPow = 0
    Delay 180s
    if CnlPow > 10 CnlSwitch1 = 0
    ?

    #17763
    Mikhail
    Moderator

    Hi,

    Try the following approach:
    1. Add a command under the trigger with the 180 sec delay.
    2. That command is sent to a new channel of the output type.
    3. In the output formula of the channel, check the condition and reject a command if the condition is not satisified.

    Example of output formula:
    CheckCondition() ? CmdVal : double.NaN

    #17764
    Mikhail
    Moderator

    The channel should be tied to the relay or something.

    #17766
    oley
    Participant

    Hi Mikhail,

    I will try this.
    Thanks!

    #17767
    oley
    Participant

    I’m a bit stuck:
    I created a trigger identical to the one I use to limit power, but with a 300-second delay.
    The channel with the current power is channel 108.
    I linked the command to a new channel (208) of type Output with the formula:

    IsPowerNotLimited() ? CmdVal : double.NaN

    public double IsPowerNotLimited()
    {
        var ret = DataRel(-100).Val > 10 ? 1 : 0;
        SetVal(CnlNum, ret);
        return ret;
    }

    If the value on channel 108 is > 10, I need to shut down the system by setting channels 802 and 803 to 1.

    Do I need to create a trigger for changes to this new channel 208?

    #17769
    oley
    Participant

    Some update:

    I used the same trigger with delayed command to this calculated channel.
    Additionally I created another trigger for this calculated channel with two commands which control the switches. I have to test it in my environment.

    Channel script looks like:

    public bool IsPowerNotLimited()
    {
        return DataRel(-100).Val > 10;
    }
    
    • This reply was modified 2 months ago by oley.
    #17772
    Mikhail
    Moderator

    Hi,
    SetVal is wrong in that function. The function used in the output formula shouldn’t set any channel, it just returns a value.
    Check ModAutoControl.log to make sure that commands are sent when needed.

    #17773
    Mikhail
    Moderator

    For the output channel 208 set the event flag to generate events on commands. It can help to see what value was sent and when.

    #17774
    oley
    Participant

    Hi,

    I have a problem with my fallback trigger.
    Would you look on my ACM config:

    https://ibb.co/yBhJM43w
    https://ibb.co/WvFwRSDk
    https://ibb.co/Q3PXKnSd
    https://ibb.co/6Jt3jdJ4
    https://ibb.co/Kc4hhQpf
    https://ibb.co/5hY5GjqK
    https://ibb.co/S7x3ny1w
    https://ibb.co/gLMbVgHH

    Logs:

    2026-03-21 11:00:00 Trigger state “PowerAdjustment\Limit_28 [280120]”: Delay before firing 1 sec
    2026-03-21 11:00:00 Trigger state “PowerAdjustment\NoLimit_28 [280120]”: Waiting
    2026-03-21 11:00:00 No trigger commands to send
    2026-03-21 11:00:00 No trigger events to send
    2026-03-21 11:00:00 Trigger state “PowerAdjustment\Limit_41 [410120]”: Delay before firing 1 sec
    2026-03-21 11:00:01 Trigger state “PowerAdjustment\Limit_13 [130120]”: Firing
    2026-03-21 11:00:01 Send command. Channel 132204
    2026-03-21 11:00:01 Sending trigger commands completed
    2026-03-21 11:00:01 Sending trigger events completed
    2026-03-21 11:00:01 Trigger state “PowerAdjustment\Limit_28 [280120]”: Firing
    2026-03-21 11:00:01 Send command. Channel 282202
    2026-03-21 11:00:01 Command is enqueued to be sent at 11:05:01. Channel 281208
    2026-03-21 11:00:01 Sending trigger commands completed
    2026-03-21 11:00:01 Sending trigger events completed
    2026-03-21 11:00:01 Trigger state “PowerAdjustment\Limit_41 [410120]”: Firing
    2026-03-21 11:00:01 Send command. Channel 412204
    2026-03-21 11:00:01 Sending trigger commands completed
    2026-03-21 11:00:01 Sending trigger events completed
    2026-03-21 11:05:01 Send command with a delay. Channel 281208

    My calculated channel:

    https://ibb.co/DPZFRTTG

    public bool IsPowerNotLimited()
    {
        return DataRel(-100).Val > 10;
    }
    

    First command is sent: Send command with a delay. Channel 281208, but no reaction of the trigger on 281208.

    • This reply was modified 2 months ago by oley.
    #17780
    Mikhail
    Moderator

    Hi,

    If the channel is specified, the object is redundant here.
    According the above part of the log, the fallback trigger does not fire.

    #17781
    Mikhail
    Moderator

    Note that a trigger fires when a channel value changes. I mean that the trigger condition should be false, and after that the condition should be true to cause the trigger to fire. Did it happen?
    If the channel is undefined, the trigger condition neither true or false as I remember.

    • This reply was modified 2 months ago by Mikhail.
    • This reply was modified 2 months ago by Mikhail.
    #17784
    Mikhail
    Moderator

    Try changing channel values by ScadaTestClient in order to test triggers separately.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.