Titan



getreply


The operation belongs to the family of procedure-based communication operations. It is used to handle replies from a previously called procedure.

Related keywords:


port_reference.getreply [ ( template_instance  [ value value_match ] ) ] [ from address_reference ] [ -> assignment_part ];  


Example 1: in-line signature template and parameter redirect

signature S_MyProc (out integer pl_MyPar1, inout boolean pl_MyPar2, in charset pl_MyPar3) return float;

MujPort_PCO.getreply(S_MyProc:{ 14 .. 143, ?, ?}) from system -> param (vl_MyPar1, vl_MyPar2, vl_MyPar3);

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).
In the second line, the response is accepted at  the port MujPort_PCO. The port is connected to several components, but communication is restricted to one component, here to the test system interface. The value of the last two parameters does not matter, but the first one must be between 14 and 143 for the response to be accepted. The parameter values are stored in the variables vl_MyPar1, vl_MyPar2 and vl_MyPar3, respectively.


Example 2: signature template, value match and address redirect

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

MujPort_PCO.getreply (t_NiaTemplate(true) value 1.1) -> sender v_address;

The parameterized template (t_NiaTemplate) has three fields. Replies are accepted where the first parameter is between one and six; the second must have the value true and the last parameter is don't care because it is defined as an in parameter. Another requirement to be met that the returned value must be equal to 1.1. The address of the component responding to the procedure call is stored in the variable v_address.


Example 3: modified signature template and value redirect

MujPort_PCO.getreply (modifies t_NiaTemplate(false) := {field1 := 6}) -> value v_Ile_Flottante;

The template defined in example 2 is modified. The response is now accepted when the first and the second parameters have the values six and false, respectively. The returned floating point value is stored in the variable v_Ile_Flottante


Example 4: receive on any port

any port.getreply (t_NiaTemplate(true));

The response matching the template t_NiaTemplate will be accepted on any port.


Example 5: Accepting any call

MujPort_PCO.getreply;

Removes the top reply from MujPort_PCO.



BNF definition of getreply