Chapter 2. Program Organization
GFK-2950C
February 2018
17
Using Parameters with an External Block
An external block may be defined to have between zero and 63 formal input parameters and
between one and 64 formal output parameters. A ‘power
-
flow out’ (or OK) parameter, named Y0
, is
automatically defined for every external block. Y0 is a BOOL parameter of LENGTH 1, and indicates
the successful execution of the block. It can be read and written to by the external block’s logic.
The following table gives the TYPEs, LENGTHs, and parameter-passing mechanisms allowed for
external block parameters.
Type
Length
Default Parameter Passing Mechanism
BOOL
1 to 256
INPUTS: by reference
OUTPUTS: by reference; except Y0, which is by initial-value result
BYTE
1 to 1024
INPUTS: by reference
OUTPUTS: by reference
INT, UINT, and WORD
1 to 512
INPUTS: by reference
OUTPUTS: by reference
DINT, REAL, and
DWORD
1 to 256
INPUTS: by reference
OUTPUTS: by reference
LREAL
1 to 128
INPUTS: by reference
OUTPUTS: by reference
UDT
3
1 to 128
INPUTS: by reference
OUTPUTS: not allowed
The PACSystems default parameter passing mechanisms correspond to the way that external block
parameters are passed on 90-70 controllers. The parameter passing mechanisms of formal
parameters cannot be changed from their default values.
You must define a name for each formal input and output parameter.
Arguments, or
actual parameters
, are passed into an external block whenever an external block call
is executed.
Arguments may be any valid reference address including an indirect reference, may be flow, or may
be a constant if the corresponding parameter’s LENGTH is 1.
3
To use a UDT, you must include the UDT definition as a C structure in the external block. For details, refer to
Using a UDT
as a C block input parameter data type
in the online help.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...