GE PACSystems RX7i Cpu Programmer's Reference Manual page 124

Hide thumbs Also See for PACSystems RX7i:
Table of Contents

Advertisement

Programming Drum in Parameterized Blocks
Different guidelines and rules apply depending on whether you want to use the parameterized block
in more than one place in your program logic.
Parameterized block called from one block
If your parameterized block that contains a Drum function will be called from only one logic block,
follow these rules:
1. Call the parameterized block exactly one time per execution of its source block.
2. Choose a reference address for the Drum control block that will not be manipulated anywhere
else. The reference address may be %R, %P, %L, %W, or symbolic.
Note: %L memory is the same %L memory available to the source block of type Block. %L memory
corresponds to %P memory when the source block is _MAIN.
Parameterized block called from multiple blocks
When calling the parameterized block from multiple blocks, it is imperative to separate the Drum
reference memory used by each call to the parameterized block. Follow these rules and guidelines:
1. Call the parameterized block exactly one time per execution of each source block that it appears
in.
2. Choose a %L reference or parameterized block formal parameter for the Drum control block. Do
not use a %R, %P, %W, or symbolic memory reference.
Notes:
The strongly recommended choice is a %L location, which is inherited from the parameterized
block's source block. Each source block has its own %L memory space except the _MAIN block,
which has a %P memory area instead. When the _MAIN block calls another block, the %P
mappings from the _MAIN block are accessed by the called block as %L mappings.
If you use a parameterized block formal parameter (word array passed-by-reference), the actual
parameter that corresponds to this formal parameter must be a %L, %R, %P, %W, or symbolic
reference. If the actual parameter is a %R, %P, %W, or symbolic reference, a unique reference
address must be used by each source block.
Recursion
If you use recursion (that is, if you have a block call itself either directly or indirectly) and your
parameterized block contains a Drum function, you must follow two additional rules:
Program the source block so that it invokes the parameterized block before making any recursive
calls to itself.
Do not program the parameterized block to call itself directly.
Using Drum in UDFBs
UDFBs are user-defined logic blocks that have parameters and instance data. For details on these
and other types of blocks, refer to Chapter 2.
When a Drum function is present inside a UDFB, and a member variable is used for the control block
of a Drum function, the behavior of the Drum function may not match your expectations. If multiple
instances of the UDFB are called during a logic sweep, only the first-executed instance will update
the timer in the Drum function. If a different instance is then executed, the timer value will remain
unchanged.
In the case of multiple calls to a UDFB during a logic scan, only the first call will add elapsed time to
its timer functions. This behavior matches the behavior of the Drum function timer in a normal
program block.
GFK-2950C
Chapter 4. Ladder Diagram (LD) Programming
February 2018
109

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pacsystems rx3iPacsystems rsti-ep

Table of Contents