beautypg.com

11 entering and developing macros, 1 creating a macro file – KEYENCE KV Series User Manual

Page 96

background image

Chapter 2 Editor

2-72

2

2.11

Entering and Developing Macros

The Ladder Builder for KV is equipped with a macro function. By using macros,
programs in which the same process is repeated many times and for which there are
extended instructions can be entered efficiently. The Ladder Builder for KV is
equipped as standard with the macro file to enter frequently used circuits.

2.11.1 Creating a macro file

To use a macro, first create a macro file saving the contents to be processed in the
macro.
To create a macro, perform the following procedure.

1. Select "New" from the "File" menu, and open a new ladder program window in

accordance with the model.

2. Place the cursor in the first line. Select "Edit Line Comment" from the "Comment"

menu.

The "Enter Line Comment" dialog box is displayed.

3. In the first line, enter the macro name, the number of arguments and the com-

ment in the following format as the macro start declaration line.

@ Macro name, Number of arguments, Comment

Include "@" at the beginning.

@TEST.4.test macro

Number of
arguments

Comment

Macro name

Enter up to 8 characters. Do not enter spaces.

Number of arguments

Enter the number of devices to be variable. Temporary
devices (shown below) contained in a ladder diagram can be
replaced with arbitrary devices (up to 10 devices).

Comment

Enter a comment on an argument, etc.

Separate each item with a comma (,).

KVSKA Chap 02.P65

08.3.11, 11:28 AM

72