Parameter Passing Mechanisms - GE PACSystems RXi User Manual

Distributed io controller
Table of Contents

Advertisement

6.1.7

Parameter Passing Mechanisms

All blocks (except _MAIN) have at least one parameter and thus are affected by parameter
passing mechanisms. A parameter passing mechanism describes the way that data is
passed from an argument in a calling block to a parameter in the called block, and from the
parameter in the called block back to the argument in the calling block.
PACSystems supports the following parameter-passing mechanisms: pass by reference,
pass by constant reference, pass by value, pass by value result, pass by result and pass by
initial-value result. An additional type, pass by friend, is available when the input Data Type is
a UDFB. A parameter is defined by its TYPE, LENGTH, and parameter passing mechanism.
When a parameter is passed by reference, the address of its argument is passed into
the function block instance or parameterized block. All logic within the called block that
reads or writes to the parameter directly reads or writes to the actual argument.
When a parameter is passed by constant reference, the CPU passes a reference
address pointer, symbolic variable pointer, or I/O variable pointer into the function block
instance or parameterized block. The instance or block can only read the reference
address or variable.
When a parameter is passed by friend (UDFB inputs only), the CPU passes a UDFB
instance variable pointer into the function block instance or parameterized block. The
instance or block can write to any output or member, whether public or private, of the
UDFB instance variable passed as a friend.
Tip: In the logic of a UDFB, when you want to pass the UDFB as a friend, assign the
pseudo-variable #This to the input that expects an instance variable of that UDFB type. In
the following example, the In2 input of the LDPSB parameterized block expects a UDFB
instance variable friend of the ABC data type. Inside the logic of ABC, assign #This to In2
in the call to LDPSB.
GFK-2816F
August 2015
Chapter 6. Program Organization
111

Advertisement

Table of Contents
loading

This manual is also suitable for:

Icrxictl000

Table of Contents