GE PACSystems RX7i Cpu Programmer's Reference Manual page 29

Hide thumbs Also See for PACSystems RX7i:
Table of Contents

Advertisement

Chapter 2. Program Organization
If an input parameter is passed by reference or by value result, it requires an argument. All other
parameters of a UDFB are optional. That is, they do not have to be given arguments on each instance
of the UDFB. If no argument is given for an optional parameter, the variable element associated with
the parameter retains the value it previously had.
UDFB outputs cannot be passed as arguments to input parameters that are passed by reference or
passed by value result. This restriction prevents modification of a UDFB output.
Using Internal Member Variables with UDFBs
A UDFB can have any number of internal member variables. The values of internal variables are not
passed via the input and output parameters. An internal variable cannot have the same name as a
parameter of the UDFB it is defined in.
An internal variable can be:
Any basic type supported by PACSystems (BOOL, INT, UINT, DINT, REAL, LREAL, BYTE, WORD,
and DWORD).
A UDFB type. Such member variables are known as nested instances. For example, the function
block Motor can have an internal variable of type Valve, where Valve is a UDFB type. Note that
defining a member variable as a UDFB type does not create an instance.
A nested instance cannot be of the same type as the UDFB being defined because this would set
up an infinitely recursive definition. Nor can any level of a nested instance be of the same type as
the parent UDFB being defined. For example, the UDFB Motor cannot have an internal variable of
type Valve, if the Valve UDFB contains an internal variable of type Motor.
A UDT: a structured, user-defined data type consisting of elements of other selected data types.
A one-dimensional array.
Internal variables of TYPE BOOL can be retentive (default) or non-retentive. All other TYPEs must be
retentive.
Member variables corresponding to a UDFB's input parameters cannot be read or written outside of
the UDFB. (This is more restrictive than the IEC 61131-3 requirements for user defined function
blocks.) Member variables corresponding to the UDFB's output parameters can be read but not
written outside the UDFB.
Internal member variables that have basic types may be given initial values. The same initial values
apply to all instances of a UDFB. If an initial value isn't given, the internal member variable is set to
zero when the application transitions to RUN mode for the first time.
An internal member variable that is a nested instance has initial values as specified by its UDFB type
definition.
Initial values are not stored during a RUN mode store. They will not take effect until a STOP Mode
Store is performed.
14
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pacsystems rx3iPacsystems rsti-ep

Table of Contents