TCP Send and Receive Characters
Project Flow
1. Device Configuration
Select the TCP server, set the host address and port, and click the enable button.
2. TCP Send and Receive Characters
- Select the
Lua Scripttool, and set global variables for sending and global variables for judgment.
-- Set global variables for return
SetStringVariable("Return1", "Result is correct")
SetStringVariable("Return2", "Result is incorrect")
SetStringVariable("Return3", "There is a slight problem with the result")
-- Set global variables for judgment
SetFloatVariable("judge", 10.000)Select the
Receive Stringtool, choose the device, and set the timeout period and output.Select the
Lua Language Scripttool, write a script and ensure the script runs with OK result.
-- An OK script
println('Hello AI-Vision!')Select the
Send Stringtool, set the activation binding to the Result variable of the previous Lua script, and set the content to be sent as theReturn1global variable.Select the
Lua Language Scripttool, edit the script to set the running result as NG.Select the
Send Stringtool, set the activation binding to the Result variable of the previous Lua script, enable inverted activation, and set the content to be sent as theReturn2global variable.Select the
Judgmenttool and manually set a WARN.Select the
Send Stringtool, set the activation binding to the Warning variable of the previous judgment tool, and set the content to be sent as theReturn3global variable.
