1) edit read data function readformatevent(), Comment description, Format – KEYENCE SR-700 Series User Manual

Page 3: Comment description format

Advertising
background image

3

E SR SCRIPT RM

(1) Edit read data function readformatEvent()

This operates when "Edit data by script" is enabled on the code reader setting.

Format

* Up to 9990 characters can be assigned to return.

(2) Edit image file name function nameformatEvent(idx)

This operates when "Edit image file name by script (FTP transmission only)" is
enabled on the code reader setting.

Format

Up to 180 characters can be assigned to return.
File names are restricted by the FTP server and OS activating the FTP server. Use
the following characters for file names. If characters other than these are used, test
to check if operation is normal under the operation environment.

z

Usable characters

abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789

Reference

• More than one "Variable" and "Process" can be written. For how to

define variables, refer to

"2-1 Naming rules" (Page 4).

• A different function among functions can be called.

"Calling the

function" (Page 12)

• Directories can be specified in file names.

To put a image file named "a" into the folder named [image] in the
root folder, specify the value such as image\\a in return.
Note if the applicable folder does not exist in the root folder, it does
not operate normally.

• On the SR-700 Series, "function nameformatEvent" cannot be used.

function readformatEvent()

Variable declaration

Process

return

(variable)

The value entered into return is output as "Read
data".

end

Example

function readformatEvent()

local a

Declares variable a.

a="successful reading!"

Assigns "successful reading !" to variable a.

return

(a)

The value stored in a is output as "Read data".

end

function nameformatEvent()

Variable declaration

Process

return

(variable)

The value entered into return is output as "Image
file name".

end

Example

function nameformatEvent( idx )

local b

Declares variable b.

b="image file"

Assigns "image file" to variable b.

return

(b)

The value stored in b is output as "Image file
name".

end

Comment description

Format

z

1-line comment

z

Multiple-line comment

-- Comment

Character strings written after -- are treated as the comment.

-- [[

Character strings surrounded with --[[ ]] are treated as the
comment.

Comment

Comment

]]

Advertising
This manual is related to the following products: