Chapter 8. Structured Text (ST) Programming
GFK-2950C
February 2018
381
8.2.9
ARG_PRES Statement
The ARG_PRES function determines whether an input parameter value was present when the
function block instance of the parameter was invoked. This may be necessary if the parameter is
optional (pass by value).
This function must be called from a function block instance or a parameterized block.
Format
ARG_PRES (IN :=In1, Q:>Out1, ENO:>Out2);
Where:
In1
Must be an input parameter of the function block that contains the ARG_PRES
instruction. Cannot be an array element or structure element. An alias to a
parameter should resolve only to the parameter name.
Can be a BOOL, DINT, DWORD, INT, REAL, UINT, WORD variable, variable array
head name or variable array head name element [000]. Input or output parameter
value of a function block instance or a parameterized block
Out2
A BOOL variable. True if the parameter is present, otherwise false.
Note:
ENO is an optional BOOL output parameter. If ENO is used in a statement that uses the
formal convention, the state of
Out2
is set to 1 (call was successful) or 0 (call failed).
Example
The parameter TempVal is an input to the function block CheckTemp. In the following code fragment,
ARG_PRES is used to determine whether a value existed for the parameter TempVal when an
instance of CheckTemp was invoked. If TempVal had a value, the BOOL output Temp_Pres is set to 1.
ARG_PRES (TempVal, Temp_Pres);
Содержание PACSystems RX7i
Страница 357: ......
Страница 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451...