Action Sequence Start
Overview
This operator can optionally be used at the beginning of an action sequence. It is either called by an ACTIONSEQUENCE action ("ACTIONSEQUENCE") of another object, triggered by another Action operator ("Action") that is connected at one of its inputs, or triggered by a pseudo-boolen signal ("Pseudo-booleans and triggers").Although an action sequence may also start with an ordinary Action operator, this operator offers a few special features to enhance working with action sequences.
The Action Sequence Start may also be used as an alternative Action Trigger ("Action Trigger"), when connected to a floating point signal output.
This operator does not do mathematical calculations.
This operator can only be used for Polybench 1.30.1 or higher.
Operator ports
Input action or S: Specific sample type, see below.Input action or S: Specific sample type, see below.
Output action: Action sequence blobs
Properties
Find more information about changing properties here: "Properties Viewer"Address of variable
type: Address, starts with '$' sign (see "Address - how to address objects and variable parameters")Fill in the address of a variable that is set to the incoming value.
You may type or paste the address, or you may press the small button on the right to open the Address Constructor ("Address Constructor")
Info of trigger channel
type: Select from the listIn case the Action Sequence Start is triggered by a signal: select which information of the channel that triggers should be copied to the variable.
Select one of those presets:
Index
Copy the index of the channel to the variable. The first channel uses index number 1.
Name
Copy the name of the channel to the variable.
TechnicalName
Copy the (hidden) technical name of the channel to the variable.
Index
Copy the index of the channel to the variable. The first channel uses index number 1.
Name
Copy the name of the channel to the variable.
TechnicalName
Copy the (hidden) technical name of the channel to the variable.
Delayed call time (ms)
type: Integer valueIf set to a value greater than 0, a call to start this action sequence is delayed with this time in milliseconds.
Note that the delay is not exact, and that the smallest delay is aproximately 150 ms.
If a value is specified in the ACTIONSEQUENCE call to this operator, then the value is determined at the time of calling, but the variable in this operator is set after the delay time has passed.
If a value is specified in the ACTIONSEQUENCE call to this operator, then the value is determined at the time of calling, but the variable in this operator is set after the delay time has passed.
Caption
type: Word or phraseThe 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 descriptionOptional documentation of this object. If this object is an operator, the Documentation text is displayed below the operator symbol.
Variable Parameters
Find more information about Variable Parameters here: "Variable Parameters"IncomingValue
type: See descriptionThe value that was sent by the object that called ACTIONSEQUENCE to this operator.
Address
type: Address, starts with '$' sign (see "Address - how to address objects and variable parameters")Fill in the address of a variable that is set to the incoming value.
You may type or paste the address, or you may press the small button on the right to open the Address Constructor ("Address Constructor")
Note that if you let another object write an address into this variable, that you have to use two '$' characters, or '$$'.
For example: you want to change the Address of $Design.Action 1. You will do that using another Action operator with the following settings: Action=SET_PARAMETER, Address=$Design.Action 1.Address, Value=$$New Address.
If you would write only one '$', then Polybench will replace the address text with the contents of that address, which is probably 'xxxxxx'.
Note that if you let another object write an address into this variable, that you have to use two '$' characters, or '$$'.
For example: you want to change the Address of $Design.Action 1. You will do that using another Action operator with the following settings: Action=SET_PARAMETER, Address=$Design.Action 1.Address, Value=$$New Address.
If you would write only one '$', then Polybench will replace the address text with the contents of that address, which is probably 'xxxxxx'.
Functions
Find more information about Functions here: "Operator Functions"Enable
Call this function so that this action sequence will run when called by an ACTIONSEQUENCE action.Disable
Call this function so that this action sequence will not run when called by an ACTIONSEQUENCE action.
Details
General behavior
An action sequence is a string of actions (See "Actions - Overview" for an overview) that are performed in the order of the Action operators in the string. Each action is defined by an Action operator ("Action").An action sequence may start with a general Action operator, but it is recommended to let it start with this Action Sequence Start operator.
The Action Sequence Start itself does not perform an action, like the Action operator does. It offers a few addtitional features for the sequence that follows this start operator:
- It can catch a Value that was sent with the ACTIONSEQUENCE action
- It can record the channel that provided the trigger, in case a signal triggers the action sequence
- It can be disabled, in a way that also Action Buttons automatically disable
The inputs can be connected to other Action operators, or to floating point signal operators. Both inputs can be connected independently and from different signal sources.
Catching a Value
An object that calls ACTIONSEQUENCE could specify a Value, just like for other actions, but the Action operators do not read that value. The Action Sequence Start actually does read that value, and offers to write the value to a variable of choice.Use the property Address of variable to specify a variable, or other variable parameter to which the value should be copied. For example:
Address of variable: $var1$
If you would put an Action Sequence Start operator on the Design page, and add an Action Button ("Action Button"), and set the Action properties like this:
Action: ACTIONSEQUENCE
Value: Hello World!
Address: $Design.Action Sequence Start
then, if you press the button, the Action Sequence Start is called, and it will then copy the Value to the variable $var1$.
You can check that using the Action Log (see Debug menu in the designer), by pressing F4. The log will show an entry like:
06:30:10.817 $var1$ = Hallo World! by Action Sequence Start
Enable or disable an action sequence
The Action Sequence Start operator offers the functions Enable and Disable that can be used to make an entire action sequence not available.If the Disable function has been called, and then an ACTIONSEQUENCE is called for this operator, then nothing will happen.
Just like with FUNCTION actions, any buttons that are set to do an ACTIONSEQUENCE on the Action Sequence Start operator will be disabled, if the operator is in disabled-state.
Trigger by a floating point signal
The Action Sequence Start also functions as an interface between floating point signals and action sequences. To trigger a single action as a result of a signal that changes its value from around or below zero to around or above one, normally an Action Trigger ("Action Trigger") is used.But if a signal trigger should start an action sequence, then the Action Sequence Start may be directly connected to a signal output. The signal output is allowed to have one or more channels.
Both inputs of the Action Sequence Start connect to both other action operators, or floating point operators.
As an extra feature, the index or name of the channel that triggers the action sequence is optionally written to the address of the variable, as set in the property Address of variable. The first channel uses index 0.
For example: an Action Sequence Start has property Address of variable set to $var$. Its input is connected to a multi-channel floating point signal operator.
If the second channel on the input is a signal that changes from value 0.0 to 1.0, then first the channel index 1 is written to $var$.
Then the sequence of actions that follow the Action Sequence Start is handled.
Merging action sequences
There are two ways action sequences can be merged to one action operator. The most common method is by using the lower input of the Action operator or the Action Sequence Start operator, as is shown in the next image.The other method is by using the Channel Merger. Normally the Channel Merger merges different sample streams in a way that all signal channels are put together in a new channel bus. In the case of action sequences, the output of the Channel Merger will not have multiple channels, but always one, because there is not something like parallel actions. As shown in the next image, the actions are merged over time and the result is equal to as shown in the above image.
Note that using the Channel Merger in this fashion is only possible in Polybench 1.32 and later.
Run an action sequence with a time delay
Sometimes it is required to run actions after a certain time delay. Because Action operators (such as this operator) do not use a concept of time, putting a "Delay" operator in an action sequence does not work as expected. The delay will not be in time, but in the number of sequential calls to the action sequence.However, starting from Polybench 1.34 it is possible to execute an action sequence after a time delay, by setting a delay time in the Action Sequence Start operator. A call to the Action Sequence Start, or a trigger, will only be continued in the action sequence following the Action Sequence Start operator after the set time delay. Calls to other action sequences will be handled normally and are not affected by a time delay of some of the Action Sequence Start operators.
Using the delayed call feature, it is possible to make an action sequence loop call, i.e. an action sequence calls itself. If the delay setting is greater than 200 ms, Polybench tries to keep the timing precize over a longer duration of time (since Polybench 1.34.1).
Please note that the delay in praxis is not exact and can differ a few hundred milliseconds, because Polybench gives signal sampling a higher priority than the handling of actions.
Examples
Example: Automatically make channels in viewer invisible
This app demonstrates how to hide signals in a viewer, based on a signal state.First, three sinus-signals are created. By toggling either of the three buttons, the signals can be made 0. A comparator checks if a signal is 0. A trigger is then generated, so that the Action Sequence Start copies the trigger channel index and starts the action operator at its output. That action calls the DisableChannel function of the Prepare Signal Graphics for the specified channel.
Examples\DF1000264_001_Zero_signals_invisible_demo.xmc