KEYENCE KV Series User Manual

Page 97

Advertising
background image

Chapter 2 Editor

2-73

1

2

4. Under the macro start declaration line, enter the symbol to be processed by the

macro. At this time, describe the devices to be treated as arguments as tempo-
rary devices.

What are temporary devices?
Temporary devices indicate devices described temporarily when actual devices
are not yet determined. Up to 1,000 temporary devices from "@0" to "@999" can
be described. Each temporary device will be automatically replaced while a
macro is developed.

Note: Up to 10 devices from "@0" to "@9" can be used in each macro. When using
them, make sure to assign temporary devices sequentially starting from "@0".

5. In the last line, enter two "@" symbols from "Edit Line Comment" as the macro

end declaration line.

Example

Macro which writes data (constant) to the DM0000 when three relays are turned on
(Four arguments are used.)

6. Two or more macros can be described in one macro file. When describing

another macro, repeat steps 3 to 5 above.

Note: Make sure to describe each macro in the portion between the macro start
declaration line and the macro end declaration line.

7. Select "Save As" from the "File" menu, and save the file with the desired macro

file name. The extension of the file name is "ldr" which is the same as the exten-
sion for a ladder program.

Creation of the macro file is now completed.
The Ladder Builder for KV is equipped with the macro file "IMACRO.LDR" to enter
frequently used circuits. Use this file when entering circuits.

Note 1: The macro start declaration line is entered as a line comment. Enter up to
70 characters.

Note 2: Timer/counter instructions cannot use temporary devices.

Macro start
declaration
line

Macro

Macro end
declaration
line

KVSKA Chap 02.P65

08.3.11, 11:28 AM

73

Advertising