Polybench® Reference
Triggers an Action if an input signal becomes a value around or above 1.0

Action Trigger

Overview

Use this operator to trigger an Action (see also "Actions - Overview") as a result of a signal value. The Action is triggered as soon as the input value changes from 0 or less to 1.0 or more. Read more about triggers in "Pseudo-booleans and triggers".

Operator ports

Input S: Floating point values

Properties

Find more information about changing properties here: "Properties Viewer"

Action
type: Select from the list
Select the code of the Action that is performed when the input value is greater or equal to 1.0.
Select one of those presets:


Value
type: See description
Fill in a parameter value, if one is needed for the Action or to set a value in Address.


Address
type: Address, starts with '$' sign (see "Address - how to address objects and variable parameters")
Fill in the address of the object that should receive the Action.

You may type or paste the address, or you may press the small button on the right to open the Address Constructor ("Address Constructor")

AutoExtendAddress
type: True or False
Set to True if the Address should be extended by the channel name that triggered the Action.
Select one of those presets:
True or False
True may also be read like 'yes' and false like 'no'

The address is extended intelligently. For example, if the address is $Design.Input Field.Text$, then the channel name is added to Design.Input Field and not to Text. If a signal channel is called '10', then the address that is used becomes $Design.Input Field10.Text$. AutoExtendAddress also works for global variables, for example $MyVar$ could become $MyVar10$.

Caption
type: Word or phrase
The name of the object in the project. This name must not contain '.', '$' nor '@' characters.

For more information about the rules and usage of the Caption property, please refer to "Caption property - background and usage".

Documentation
type: See description
Optional documentation of this object. If this object is an operator, the Documentation text is displayed below the operator symbol.

Details

General working

The trigger input expects a trigger, which is a transition from 0 to 1. The input is expected to be a pseudo-boolean signal. It is not exactly defined on what value the trigger is detected (somewhere half-way between 0 and 1).

It is allowed to connect a constant at the input of the Action Trigger, for example to connect to a Constant Button ("Constant Button"). The action will trigger as soon as the constant value changes from 0 or less to 1.0 or more. However, in such a case you would probably want to use an Action Button ("Action Button").

If the Action Trigger has multiple channels at its input bus, then those signals are considered all individually, all having there own trigger moment.

AutoExtendAddress mode

If the input has multiple channels, then the Action of this operator is repeated for each channel. In some cases it makes sense that the action address is changed somewhat for each channel, for example to set a different variable for each channel.

If you use the AutoExtendAddress property, it is possible to change the specified action address by extending it with the channel name. The way the address is extended, depends on the action.
In case of SET_PARAMETER and FUNCTION, the fore-last part if the address is extended. For example, if a channel is called C1:

SET_PARAMETER $Design.Constant.Value$ becomes: SET_PARAMETER $Design.ConstantC1.Value$
FUNCTION $Design.Device X_.Enable$ becomes: FUNCTION $Design.Device X_C1.Enable$
however:
SET_PARAMETER $var$ becomes: SET_PARAMETER $varC1$

In case of other actions, the channel name is just extended behind the specified action address. For example for channel C1:

SHOWPAGE $Page_ becomes: SHOWPAGE $Page_C1
ACTIONSEQUENCE $Design.My Action Start $ becomes: ACTIONSEQUENCE $Design.My Action Start C1$

Note: You may use a Channel Terminal ("Channel Terminal") to deliberately change channel names.

Behaviour if address points to a variable parameter list

If the action address refers to a variable parameter list ("Parameter List"), then an automatic address extension, based on the index of a channel is applied. It is tried to set the action value to individual values in the list that have the same order index the channel has. For example:

SET_PARAMETER $Design.Prepare Ranges and Offsets.Offsets$ for the first three channels becomes:
SET_PARAMETER $Design.Prepare Ranges and Offsets.Offsets.0$
SET_PARAMETER $Design.Prepare Ranges and Offsets.Offsets.1$
SET_PARAMETER $Design.Prepare Ranges and Offsets.Offsets.2$

In this case, the AutoExtendAddress property is ignored.
Note: this behaviour was added in Polybench 1.34; in older versions, lists cannot be addressed

Examples

Example: Action Trigger Demo
Example of the Action Trigger operator. Fish and heart images are switched by a signal controled Action Trigger.
Examples\DF0407011_001_ActionTrigger_Demo.xmc

Example: Action Trigger AutoExtendAddress Demo
Demonstrates the use of the AutoExtendAddress property of the Action Trigger. If AutoExtendAddress is set to True, then for each input channel, the channel name is added to the specified action address. In this example: the second channel is called 'C2', therefore the address is changed by putting 'C2' behind it, so the Action operator 'ActionC2' is called.
Examples\DF0407011_002_ActionTrigger_AutoExtendAddress_Demo.xmc