Omron WS02-CXPC1-V9 - V9 Operation Manual page 72

Table of Contents

Advertisement

Instance Specifications
Accessing Function Block
Instance Area from the
User Program
Note
Comments
Creating Multiple
Instances
Calling the Same Instance
Making Multiple Instances
46
Item
Applicable areas
C (Counter Area) Counter Flag (1 bit) or counter PVs (16 bits)
Allocated words
C206 to C255 Counter Flag (1 bit) or counter PVs (16 bits)
(default)
If the user program contains an instruction to access the function block
instance area, an error will be displayed in the Compile Tab of the Output Win-
dow of CX-Programmer if the following operations are attempted.
• Attempting to write during online editing (writing not possible)
• Executing program check (Selecting Compile from the Program Menu or
Compile All PLC Programs from the PLC Menu)
Example: If W0 to W511 is specified as the non-retained area of the function
block instance area and W0.00 is used in the ladder program, an error will
occur when compiling and be displayed as "ERROR: [omitted]...- Address -
W0.00 is reserved for Function Block use].
Program
P_Off
FB
EN
ENO
W0.00
The allocations in the function block instance area for variables are automati-
cally reallocated when a variable is added or deleted. A single instance
requires addresses in sequence, however, so if addresses in sequence can-
not be obtained, all variables will be allocated different addresses. As a result,
unused areas will be created. If this occurs, execute the optimization opera-
tion to effectively use the allocated areas and remove the unused areas.
A comment of up to 30,000 characters long can be entered.
A single instance can be called from multiple locations. In this case, the inter-
nal variables will be shared.
Multiple instances can be created from a single function block definition. In
this case, the values of internal variables will be different in each instance.
Example: Counting Product A and Product B
Prepare a function block definition called Down Counter (CTD) and set up
counters for product A and product B. There are two types of programs, one
for automatic operation and another for manual operation. The user can
switch to the appropriate mode of operation.
In this case, multiple instances will be created from a single function block.
The same instance must be called from multiple locations.
Contents
1. 0
Instance data area
Non Retain
Retain
Timers
3.0
Counters
Compile error
Section 2-3
Start
Size
address
W0
512

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents