1 debug methods, Operation check procedure, Debug methods – KEYENCE SR-700 Series User Manual

Page 13: 2 error message list, Error message list

Advertising
background image

13

E SR SCRIPT RM

6-1

Debug methods

This section describes debug methods when the script is executed.

Operation check procedure

1

Send the FmtSet.lua file to SR-1000/D100/750/700 Series using
AutoID Network Navigator.

2

Start the AutoID Network Navigator [Terminal] and click [LON] to
start reading.

3

Read with the code reader and check if the result is correctly
reflected.

• For editing read data

→ Check if the output data is correct.

• For editing image file name

→ When using the setting to send image files via FTP, check the name of

image file uploaded on the specified FTP server.

* While reading, if an error message such as "Load Error" is displayed, debug

according to the following debug methods.

*1 The time for script timeout should be 3 seconds.

Debug methods

„

Error details check

1

Send the "SCPERR" command to SR-1000/D100/750/700 Series with
AutoID Network Navigator [Terminal]. (Executing this command will
display the error details.)

2

"error ~~~ FmtSet.lua: ○ : ~~" is displayed. The number applied to ○
is the corresponding row in error.

Open FmtSet.lua with the text editor and repair the source code.

„

print(mes) display

(Page 12)

To check (debug output) the variable value in the source code of FmtSet.lua,
use the print function.

1

Write the print function on where the variable value is to be checked
in the source code of FmtSet.lua.

2

Send the "SCPDBG,1" command to SR-1000/D100/750/700 Series
with AutoID Network Navigator [Terminal]. (Executing this command
enables debug output when reading.)

3

Click [LON] to start reading.
The content specified as the argument of the print function is output.

Referring to this output result, open FmtSet.lua with the text editor and repair
the source code.

4

After the source code is repaired, send the "SCPDBG,0" command
and disable debug output.

Error message

Description

LoadError

Script file loading failed.

ReadResultScriptError

An error has occurred in
readformatEvent.

ImageResultScriptError

An error has occurred in
nameformatEvent.

TimeoutError

Script timeout error.
The script execution took too long.

*1

ScriptError

Other errors.

6-2

Error message list

After the "SCPDBG,1" command is executed, if the script file is sent to the code
reader, the following error messages are displayed.

Error message list

Load errors

Execution errors

Error message

Description

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: unfinished long comment near '<eof>'

“]]” of the comment “-[[ ]]” is missing.
Add “]]” to the end of the comment.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: 'end' expected (to close 'function' at
line 1) near '<eof>'

end is missing for “function” on the first
line.
Write end at the correct position.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: 'end' expected (to close 'for' at line 2)
near '<eof>'

end is missing for “for” on the second
line.
Write end at the correct position.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: ')' expected (to close '(' at line 1) near
'<eof>'

“)” for “(” is missing.
Write “)” at the correct position.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: <name> or '...' expected near 'end'

When declaring function, “)” for “(” is
missing.
Write “)” at the correct position.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: '=' expected near '+'

Grammatical error (Arithmetic expression
error).
Check if the arithmetic expression is
correct.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: '=' expected near '=='

Grammatical error (Is == used instead of
=?)
Correct == to =.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: 'then' expected near '='

Grammatical error (Is = used instead of
==?)
Correct = to ==.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: unexpected symbol near '='

Grammatical error (Is a value assigned to
the reserved word?)
Do not assign any value to the reserved
word.

error loading module 'FmtSet' from file 'FmtSet.lua':
FmtSet.lua:○: malformed number near '1.a'

Numerical value writing error.
Write numerical values correctly.

Error message

Description

FmtSet.lua:○: attempt to perform arithmetic on a
string value

Was the arithmetic expression written
with character strings?
Write it correctly.

FmtSet.lua:○: attempt to perform arithmetic on
global 'a' (a string value)

Was the arithmetic expression written
with character strings?
Write it correctly.

FmtSet.lua:○: attempt to concatenate a nil value

Concatenation failed.
Check if values other than character
strings are not specified.

FmtSet.lua:○: attempt to concatenate global 'a' (a
table value)

Concatenation failed.
Check if values other than character
strings are not specified.

FmtSet.lua:○: attempt to call global 'a' (a nil value)

Undeclared functions were called.
Check if the name of the function to call
is correct.

FmtSet.lua:○: attempt to call global 'a' (a number
value)

Undeclared functions were called.
Check if the name of the function to call
is correct.

FmtSet.lua:○: attempt to index global 'a' (a nil value)

Undeclared tables were called.
Check if the name of the table to call is
correct.

FmtSet.lua:○: attempt to index global 'a' (a string
value)

Undeclared tables were called.
Check if the name of the table to call is
correct.

FmtSet.lua:○: bad argument #1 to 'cos' (number
expected, got string)

Wrong argument.
Specify the correct argument.

FmtSet.lua:○: bad argument #2 to 'max' (number
expected, got nil)

Wrong argument.
Specify the correct argument.

Advertising
This manual is related to the following products: