WWW.NNC.IR
Basic Knowledge For Macro Customize
Functions
197
5
Optimizing Scenes (Measurement Flows) (Macro Customize
Functions)
Vision System FH/FZ5 Series
User’s Manual (Z340)
Creating serial command
Command parameters
Received text string is split by space character(" ") into command and parameters, and stored in the
predefined variables shown below:
When the system received the string as above, parameters are set like this :
Example: The command "SC 1" that switches scene 1
Response output
Result of the command procedure can be returned to the system by setting the value on these variables.
Example: The command "TEST"
Command and response will be like this :
Variable name Type Content
ArgumentsLength& Integer Number of parameters (0 to 32)
ArgumentString$() Array of text string
Array of parameters (string)
Allocate a number of array elements equal to the number
of parameters.
ArgumentValue#() Array of real numbers
Array of parameters converted to number
*1: If conversion fails, set to 0.
Allocate a number of array elements equal to the number
of parameters.
"AAA param0 param1 param2"
ArgumentsLength&: 3 (number of parameters)
ArgumentString$(0): param0 (String type)
ArgumentString$(1): param1 (String type)
ArgumentString$(2): param2 (String type)
ArgumentValue#(0): numeric value converted from param0 (0 when conversion failed)
ArgumentValue#(1): numeric value converted from param1 (0 when conversion failed)
(2): numeric value converted from param2 (0 when conversion failed)
ScaneChange ArgumentValue#(0)
Variable name Type Content
ResponseString$ Text string Output data
ResponseCode& Integer
Result of command
• 0 : success (returns "OK")
• non 0 : fail (returns "NG")
ResponseString$ = "TestString"
-> TEST
<- TestString
<- OK