Forum Home › Forums › Understanding the Software › Delayed control sequence
Tagged: Auto Control Module
- This topic has 11 replies, 2 voices, and was last updated 2 months ago by
Mikhail.
-
AuthorPosts
-
March 18, 2026 at 9:45 pm #17759
oley
ParticipantHi,
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
?March 19, 2026 at 1:47 pm #17763
MikhailModeratorHi,
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.NaNMarch 19, 2026 at 1:48 pm #17764
MikhailModeratorThe channel should be tied to the relay or something.
March 19, 2026 at 2:33 pm #17766oley
ParticipantHi Mikhail,
I will try this.
Thanks!March 19, 2026 at 7:37 pm #17767oley
ParticipantI’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.NaNpublic 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?
March 20, 2026 at 9:25 am #17769oley
ParticipantSome 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.
March 20, 2026 at 12:43 pm #17772
MikhailModeratorHi,
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.March 20, 2026 at 12:45 pm #17773
MikhailModeratorFor the output channel 208 set the event flag to generate events on commands. It can help to see what value was sent and when.
March 21, 2026 at 11:56 am #17774oley
ParticipantHi,
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/gLMbVgHHLogs:
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 281208My calculated channel:
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.
March 23, 2026 at 12:33 pm #17780
MikhailModeratorHi,
If the channel is specified, the object is redundant here.
According the above part of the log, the fallback trigger does not fire.March 23, 2026 at 12:36 pm #17781
MikhailModeratorNote 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.March 23, 2026 at 12:38 pm #17784
MikhailModeratorTry changing channel values by ScadaTestClient in order to test triggers separately.
-
This reply was modified 2 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.