# send

The asynchronous operation belongs to the family of message-based communication operations. It is used to place a value on an outgoing message port.

- The operation can be used on connected ports.
- The operation is non-blocking (does not block TTCN3 program execution).
- In case of multiple connections the receiver may be addressed.

Related keywords:

- address
- create
- modifies
- system
- to

### port_reference.send ( value_part ) [ to address_reference ];

- port_reference points out the outgoing message port.

- The send keyword introduces the message sending.

- value_part is one of the following:

  - a literal value, a constant, a variable, an expression. (see the example1)
  - a specific value template (see the example 2)
  - a modified template (see the example 3)

- The optionalto keyword is used when a port is connected to several entities and identification of the communication partner is required.

- address_reference is one of the following:

  - a component reference (cf. create) or the keyword system, in case of one-to-many connections.
  - an address reference (cf. address) , when there are several entities within the system under test.

Example 1: literal value

Portus_PCO.send (charstring:"bla") to system;

The character string bla is sent over the port Portus_PCO to the test system interface. The port is connected to several components.

Example 2: template

template DefinedRecordType t_MeusTemplate (integer pl_param) := {
field1 := 16,
field2 := pl_param
}

Portus_PCO.send (t_MeusTemplate(116));

The parameterized template (t_MeusTemplate) has two integer fields. When sent as shown in the second line, the values 16 and 116 will be sent to the port Portus_PCO.

Example 3: modified template

Portus_PCO.send (modifies t_MeusTemplate(116) := {field1 := 117});

The template defined in example 2 is modified. When sent as shown, the values 117 and 116 will be sent to the port Portus_PCO.

BNF definition of send