Ladder Program Example - Omron CS1W-MC221 - 02-2008 Operation Manual

Motion control units
Table of Contents

Advertisement

Saving Data
Transfer Data
4-3-3

Ladder Program Example

Example
Program
Execution
Flag
X-axis Busy Flag Y-axis Busy Flag
R1
R3
R2
!Caution Do not attempt to save data to flash memory during program execution or
222
Set the following data starting at the word specified for the source start word
address (S) and execute the IOWR instruction.
Set X =to 1 (S + 1: 0000, S: 0001) when saving (writing) position data and
system parameters to flash memory. S is the source start word address (S)
set in the IOWR instruction.
Refer to the following examples of actual data transfer using an MC Unit with
the unit number 0 mounted in a CS. In these examples, the IOWR operand
and transfer data are both assumed to be correct.
When debugging, write ladder code that will check the Error Flag and bit 14 of
word n + 10/n + 18.
Saving Position Data to Flash Memory
Execution condition
25506 (=)
Settings in DM Area
Description
When task 1 is not being executed in memory (Execution Flag OFF) and none
of the axes is moving (Busy Flags OFF), then the data will be saved to flash
memory.
while a motor is operating. Doing so can result in unexpected operation.
Note It normally requires from one to two seconds to save data to flash memory,
but a maximum of 30 seconds can sometimes be required.
15
S+1
00 15
0
0
0
0
0
Work bit
DIFU
R1
Set the data
required for transfer.
Address (6100) for saving position data to
IOWR
flash memory. (17D4 Hex (6100)).
#17D4
Set the address of the first source word of
D00100
the position data.
#00020000
Set the source unit number to 0 and a
total of 2 words to be transferred.
R3
OUT (Work bit)
R2
OUT (Work bit)
Save to flash memory.
0001
D0100
D0101
0000
Section 4-3
S
03 00
0
0
X

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs1w-mc221Cs1w-mc221-v1Cs1w-mc421Cs1w-mc421-v1

Table of Contents