![background image](http://html1.mh-extra.com/html/omron/cs1-h-series/cs1-h-series_operation-manual_742526048.webp)
33
Instance Specifications
Section 2-2
Accessing Function Block
Instance Area from the
User Program
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].
Note
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.
Comments
A comment of up to 30,000 characters long can be entered.
Creating Multiple
Instances
Calling the Same Instance
A single instance can be called from multiple locations. In this case, the inter-
nal variables will be shared.
Making Multiple Instances
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.
FB
EN ENO
1.0
P_Off
3.0
W0.00
W0
512
Program
Compile error
Instance data area
Non Retain
Retain
Timers
Counters
Start
address
Size
Содержание CS1-H Series
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ...viii TABLE OF CONTENTS...
Страница 15: ...xvi Application Precautions 4...
Страница 151: ...136 Procedures Section 3 2...
Страница 153: ...138 Data Types Appendix A...
Страница 177: ...162 External Variables Appendix C...
Страница 181: ...166 Revision History...