Assign Literal Values
You can assign literal values to a signal or a port.
For this task, some ports and signals must be already
defined.
- Double-click the node Ports in the specification
tree. The Block Properties window is opened at
the Ports tab.
- Click Add Port
.
A new port is created.
- Change its name to s.
- Create another s1 port.

- Click OK. The two ports are available
in the specification tree.

Click Add Action
and select step S0 in the graph.
This dialog box appears:

If Show Label is selected and the Label field
is filled, the label will be displayed in the action. Otherwise, the
expression is displayed.
Select the type Pulse (or Sustain)
and enter the following values.

In this example, the value 5 is assigned to the signal s. A condition
has been added: the expression is executed, if and only if, the value
of the signal s1 is equal to true.
Click OK. The pulse action is represented
as follows in the editor:

In the specification tree, notice that the inference
mechanism has automatically computed the direction and the type of the
ports from their usage in the action.
s1 is read and compared to a Boolean value, so the port
is computed as a Boolean input. The value 5 is assigned to s, so the
port is computed as an output of the type Number.

Note: If the signals s and s1 were not defined in the
block, the action would be highlighted in red. The error message is
available by scrolling over the step. To solve the problem, you must
create the ports as explained in step 1.

Repeat step 4 to create a new action.
Fill the Action Properties dialog box as
follows:

Click OK. The Sustain action is represented
as follows in the editor:

Note:
N ( for non-stored) is the identifier of a Sustain action.

Assign Ports and Signals
You can assign the value of a port or a signal to another port or signal.
For this task, delete the action created above but do
not remove the ports s and s1.
Click Add Action
and select step S0 in the graph. The Action Properties dialog
box appears.
Select the type Pulse (or Sustain)
and enter the following values.

Click OK. The pulse action is represented
as follows in the editor:

The value of s1 is assigned to s.
You can also assign an element of a structure or a tuple
(see a typical example below).
Click directly the element of the structure or the tuple
in the specification tree to fill the Action Properties dialog
box.


Assign Structured Data Types
You can assign a structured data type to a port or a signal.
For this task, delete the action created above but do
not remove the 2 ports s and s1.
Click Add Action
and select step S0 in the graph. The Action Properties dialog
box appears.
Select the type Pulse (or Sustain)
and enter the following values.

Click OK. The pulse action is represented
as follows in the editor:

Notice that the computed type of s is a data composite
type.

Assign Function Result
You can assign the result of a function to a port or a signal.
For this task, create a new function in the specification
tree.
- In the contextual menu of the block, select
Insert ... > Functions ... > Function.
- If the Position dialog box appears,
select Before and click OK.
- In the Function Properties dialog
box, rename the function to Plus.
- Define the input parameters of the
function as follows:

- Define the Result of the function as follows:

- Click OK. The function is added
to the specification tree.

Click Add Action
and select step S0 in the graph. The Action Properties dialog
box appears.
Select the type Pulse (or Sustain)
and enter the expression as follows:

Click OK. The pulse action is represented
as follows in the editor:

If the function is created with the option Named
Interface (see step 1.d), the input parameters of the
function are structured. In this case, the function must be called with
the following syntax.


Assign Constants
You can assign the value of a constant to a port or a signal.
For this task, create a new constant in the specification
tree.
- In the contextual menu of the block, select
Insert ... > Constants ... > Constant.
- If the Position dialog box appears,
select Before and click OK.
- In the Constant Properties dialog
box, add a constant value and click OK. The constant
is added to the specification tree.

Click Add Action
and select step S0 in the graph. The Action Properties dialog
box appears.
Select the type Pulse (or Sustain)
and click the signal and the constant in the specification tree to fill
Expression.

Click OK. The pulse action is represented
as follows in the editor:


Assign Parameters Defined as Constants or Functions
Parameters are used in the same way as predefined constants and functions.
For this task, you need to define two block parameters, one parameter has to be a constant, the other one has to be a function. You can used the constant PI and the function Plus defined in the previous tasks as default values for the parameters. - Open the Block Properties window and add the two parameters.

- Click OK. The parameters are visible in the specification tree.

Click Add Action
and select step S0 in the graph. The Action Properties dialog
box appears.
Select the type Pulse (or Sustain)
and click the signal and the constant parameter in the specification tree to fill
Expression.

Click OK. The pulse action is represented
as follows in the editor:

Click again Add Action
and select step S0 in the graph. The Action Properties dialog
box appears.
Select the type Pulse and click the signal s1 and the function parameter in the specification tree to fill
Expression.

Click OK. The pulse action is represented
as follows in the editor:

|