EasyManuals Logo

Omron CPM1 Programming Manual

Omron CPM1
541 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #348 background imageLoading...
Page #348 background image
327
Special Instructions Section 5-26
5-26-4 MACRO – MCRO(99)
Limitations DM 6144 to DM 6655 cannot be used for O1. The CPM1/CPM1A/SRM1 PCs
support only subroutine numbers 000 through 049.
Description The MACRO instruction allows a single subroutine to replace several subrou-
tines that have identical structure but different operands. There are 4 input
words, IR 096 to IR 099 (IR 232 to IR 235 in the CPM1/CPM1A/SRM1), and 4
output words, IR 196 to IR 199 (IR 236 to IR 239 in CPM1/CPM1A/SRM1
PCs), allocated to MCRO(99). These 8 words are used in the subroutine and
take their contents from I1 to I1+3 and O1 to O1+3 when the subroutine is
executed.
When the execution condition is OFF, MCRO(99) is not executed. When the
execution condition is ON, MCRO(99) copies the contents of I1 to I1+3 to IR
096 to IR 099, copies the contents of O1 to O1+3 to IR 196 to IR 199, and
then calls and executes the subroutine specified in N. When the subroutine is
completed, the contents of IR 196 through IR 199 is then transferred back to
O1 to O1+3 before MCRO(99) is completed.
Note Refer to page 130 for more details on MCRO(99).
Example In this example, the contents of DM 0010 through DM 0013 are copied to IR
096 through IR 099, the contents of DM 0020 through DM 0023 are copied to
IR 196 through IR 199, and subroutine 10 is called and executed. When the
subroutine is completed, the contents of IR 196 to IR 199 are copied back to
DM 0020 to DM 0023.
I1: First input word
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
O1: First output word
IR, SR, AR, DM, HR, LR
MCRO(99)
N
I1
O1
@MCRO(99)
N
I1
O1
N: Subroutine number
000 to 127
MCRO(99) 10
DM 0010
DM 0020
SBN(92) 10
RET(93)
END(01)
Main program
Subroutine
Main program

Table of Contents

Other manuals for Omron CPM1

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CPM1 and is the answer not in the manual?

Omron CPM1 Specifications

General IconGeneral
ModelCPM1
ManufacturerOmron
Instruction SetBasic and advanced instructions
Power Supply100 to 240 VAC or 24 VDC
CommunicationRS-232C
I/O Points10, 20, 30, or 40 points depending on the model
TimersYes, multiple timers available
CountersYes, multiple counters available
Input Voltage24V DC
Output TypeRelay or transistor
Number of I/O Points10, 20, 30, 40
Communication PortsRS-232C (optional)
Operating Temperature0°C to 55°C
Storage Temperature-20°C
Humidity10% to 90% (non-condensing)
DimensionsVaries depending on the model
WeightVaries depending on the model
Program Memory2048 steps (2K steps)

Related product manuals