Example Programs - Omron CJ2 - 02-2010 User Manual

Cj2 cpu unit software
Table of Contents

Advertisement

10 CPU Unit Functions

Example Programs

Example Program 1
In the following example, program/network symbol files ABC.OBJ and XYZ.OBJ are stored in the
Memory Card and one program or the other is selected depending upon the value of D0. D0 is set to
#1234 to select ABC.OBJ or to #5678 to select XYZ.OBJ.
Another task is started to perform any processing required before program replacement, including
set the IOM Hold Bit.
Main Task (Cyclic Task 0)
Task Protecting Data during Program Replacement
(Cyclic task 31, standby status at startup)
10-46
A200.11
First Cycle Flag
A343.15
A343.13
a
Memory Card
File Memory
Detected
Operation
Flag
Flag
A650.15
Main processing program
ON
Always ON Flag
MOV
← Program version
← Version storage area
A650.15
Replacement
Start Bit
MOV
#A5A5
A651
=
Writes the file name
"ABC" in A654 to
D00000
A657.
#1234
=
Writes the file name
"XYZ" in A654 to
D00000
A657.
#5678
TKON
31
END
Processing to protect
data before program
replacement begins
A500.12
IOM Hold Bit
Outputs to required
loads during
program
replacement.
END
CJ2 CPU Unit Software User's Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents