Chapter 8. Structured Text (ST) Programming
GFK-2950C
February 2018
371
Calls to Standard Function Blocks
Standard function blocks are instructions that have instance data in the form of a structure variable.
(For more information on function blocks and their instance data, refer to
in Chapter 2.) Standard function blocks are called in the same way that a UDFB is called.
PACSystems controllers support three standard function blocks:
Pulse timer
(TP)
Generates output pulses of a given duration
Refer to
On-delay
timer (TON)
Delays setting an output ON for a fixed period after an
input is set ON.
Refer to
in Chapter 4
Off-delay
timer (TOF)
Delays setting an output OFF for a fixed period after
an input goes OFF so that the output is held on for a
given period longer than the input.
Refer to
in Chapter 4
Format of Calls to Standard Timer Function Blocks
Notes
: TOF, TON and TP have the same input and output parameters, except for the instance
variable, which must be the same type as the instruction.
Writing or forcing values to the instance data elements IN, PT, Q, ET, ENO or TI may cause
erratic operation of the timer function block.
Instance data can be a variable or a parameter of the current UDFB or parameterized block.
Formal Convention
myTOF_Instance_Data(IN := inBool, PT := inDINT, ET => outDINT, Q => outBool, ENO =>
outBoolSuccess);
myTON_Instance_Data(IN := inBool, PT := inDINT, ET => outDINT, Q => outBool, ENO =>
outBoolSuccess);
myTP_Instance_Data(IN := inBool, PT := inDINT, ET => outDINT, Q => outBool, ENO =>
outBoolSuccess);
Note:
ENO is an optional BOOL output parameter. If ENO is used in a statement that uses the
formal convention, the state of
outBoolSuccess
is set to 1 (call was successful) or 0 (call
failed).
Informal Convention
myTOF_Instance_Data(inBool, inDINT, outDINT, outBool);
myTON_Instance_Data(inBool, inDINT, outDINT, outBool);
myTP_Instance_Data(inBool, inDINT, outDINT, outBool);
Note:
When using the informal convention, the operands must be assigned in the order shown
above (that is, IN, PT, ET, Q and ENO).
Block Types Supported for ST Calls
An ST block can call blocks of type Block, Parameterized Block, or user defined Function Block (UDFB)
or External Block (C block). For more information on block types, refer to Chapter 2.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...