1 overview, Definition of script file, Related software – KEYENCE SR-700 Series User Manual

Page 2: 2 script execution flow, Steps before executing the script, Operations when executing the script, 3 what script can do, Examples of what the script can do, 4 script file configuration, Script file configuration

Advertising
background image

2

E SR SCRIPT RM

1-1

Overview

Definition of Script file

The Script explained in this manual is a simple programming language operating
on the SR-1000/D100/750/700 Series.
Compared to using the setting software (AutoID Network Navigator), using the
script enables more flexible operations for the (1) Edit output data, (2) Edit image
file name, and (3) Control output terminals functions.

Related software

„

AutoID Network Navigator

Software to set the SR-1000/D100/750/700 Series

„

FileView

Use this to send/receive the script file to/from the SR-1000/D100/750/700 Series.

* For detailed operation procedures for the AutoID Network Navigator and

FileView, refer to the corresponding user's manual.

1-2

Script execution flow

Steps before executing the script

[1] Creating the script file

Create the script file (FmtSet.lua) and write the program using a text editor such
as notepad.exe. (This manual describes writing methods for programming.)

[2] Changing the script execution setting

Using the AutoID Network Navigator, set the script execution setting of the
SR-1000/D100/750/700 Series to "Enable".

[3] Transferring the script file

Transfer the script file (FmtSet.lua) to the SR-1000/D100/750/700 Series.

For setting procedures for the AutoID Network Navigator, refer to the
corresponding user's manual.

Operations when executing the script

The script is executed when a code is read.

[1] Creating the script file

[2] Changing the script execution setting

[3] Transferring the script file

SR-1000

SEL

MENU

SR-1000

SEL

MENU

[1] Reading a code

[2] Executing the script when reading.

[3] Sending the script execution result

1234567890

1 2 3 4 5 6 7 8 9

Header 1239 Terminator

The header and the terminator
are appended to the script
execution result and data is
output.

SR-1000

SEL

MENU

SR-1000

SEL

MENU

1-3

What Script can do

Examples of what the script can do

• Extracting arbitrary portion of read data
• Appending arbitrary character strings to read data
• Comparing data and outputting result data
• Four arithmetic operations
• Changing image file names for FTP transmission
• Comparing data and generating output from the output terminals

* "Additional information" set with AutoID Network Navigator cannot be used in

combination with the script.

1-4

Script file configuration

This describes the configuration of the script file (FmtSet.lua).

Script file configuration

FmtSet.lua file, the script program handled by SR-1000/D100/750/700 consists of
the following 3 parts.

(1) function readformatEvent()……………… Edit read data
(2) function nameformatEvent( idx ) ……… Edit image file name
(3) User-defined function …………………… User-defined function that can

be called for (1) and (2)

The process is written in the above parts in combination with variables or functions
provided by the SR-1000/D100/750/700 system.

*1 Multiple user-defined functions can be written as necessary. Skip this if not

used.
For writing procedure of user-defined functions, refer to

"5-5 User-defined

function" (Page 12).

Reference

• The SR-700 Series is not equipped with a function for transmitting

images to FTP servers, so the "(2) Edit image file name" function
cannot be used.

• The "Control output terminals" function is only supported by the

SR-1000/700 Series.

FmtSet.lua file

SCPVERSION="1.00"

The file version can be determined

arbitrarily.

(Can be omitted.)

function readformatEvent()

Process

end

(1) Edit read data

(control output terminals)

function nameformatEvent( idx )

Process

end

(2) Edit image file name

function

User-defined function

Process

end

User-defined function that can be called

for (1) and (2) (Can be omitted.)

*1

--Comment

Putting 2 hyphens at the beginning

enables writing comment.

Advertising
This manual is related to the following products: