# reply

The operation belongs to the family of procedure-based communication operations. It is used to reply to a previously accepted call according to the procedure signature.

- The operation can be used on connected procedure-based (or mixed) ports.
- It may return a value to the calling party.
- In case of multiple connections the receiver may be addressed.

Related keywords:

- address
- create
- modifies
- signature
- system
- to
- value

### port_reference.reply ( template_instance ) [ to address_reference ] [ value reply_value ];

- port_reference points out the port where the reply is sent through.

- The reply keyword introduces the response.

- template_instance is one of the following:

  - in-line signature template (see the example1);
  - a specific value signature template (see the example 2);
  - a modified signature template (see the example 3);

TITAN specific restriction compared to the standard:

- modified template is not implemented. When encountered in the TTCN-3 program, an error message will be generated.

- The optional to 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.

- The optional value keyword indicates that the called procedure returns a value. It is mandatory when the signature definition contains the keyword return.

- reply_value is the value the called procedure returns.

Example 1: in-line signature template

signature S_MyProc (out integer pl_MyPar1, inout boolean pl_MyPar2, in charset pl_MyPar3) return float;
MujPort_PCO.reply(S_MyProc:{ 19, true, -}) to system value 3.141;

The signature S_MyProc suitable for blocking communication is defined in the first line. It has three parameters (pl_MyPar1, pl_MyPar2 and pl_MyPar3) and it will return a floating point value. In the second line, the response to the procedure is call is sent at the port MujPort_PCO. The port is connected to several components therefore it must be addressed, in our case to the test system interface. The third parameter has no value assigned because it is an in parameter from the point of view of the called procedure. The second parameter (pl_MyPar2) has the value true, the first one equals 19.

Example 2: signature template

template S_MyProc t_NiaTemplate (boolean pl_param) := {
field1 := 16,
field2 := pl_param,
field3 := "massepain"
}

MujPort_PCO.reply (t_NiaTemplate(true)) value 2.71;

The parameterized template (t_NiaTemplate) has three fields. When the response is sent as shown in the second line, the values 16 and true will be sent to the port MujPort_PCO. The third parameter is don't care because it is defined as an in parameter. The returned floating point value equals 2.71.

Example 3: modified signature template

MujPort_PCO.call (modifies t_NiaTemplate(false) := {field1 := 166}) value 4.3316;

The template defined in example 2 is modified. When sent as shown, the values 116 and false will be sent to the port MujPort_PCO as first and second parameters. The returned floating point value equals 4.3316.

BNF definition of reply