Skip to content

Support Lua Script Programming

Examples are valid for:

TMflow Software version: 2.24 or above.

TM Robot Hardware version: HW5.0 or above

Note that older or newer software versions may have different results.


Lua is a lightweight, efficient, and simple scripting language. Its ease of learning and use has made it widely adopted in the industry. TMflow 2.24 introduces HPScript Node, which allows users to write robot arm action scripts directly in Lua.

Beyond Lua’s native standard libraries (such as string and math), the HPScript Node also integrates dedicated libraries for the robot arm.

  • Servo: This library provides various functions related to robot arm motion.
  • Controller: This library provides functions related to the control box, such as I/O control or getting position.
  • System: This library offers system-related functions, including time interval synchronization, conditional waiting, or writing messages to the log file.
  • Memory: HPScript Node cannot directly use project or global variables. Instead, it must interact with the project through a special memory area. For example, an HPScript Node can write data to an address of that memory during its execution. After leaving HPScript Node, the data can then be retrieved using relevant TMscript functions (e.g., HPScript_GetMemByte).
  • Com: Users can designate COM2 for exclusive use by the HPScript Node in the I/O Setup. Once this is done, the Com library’s functions can be used within the node to operate COM2.

 

In addition, HPScript runs with low latency of 1 millisecond, making them ideal for applications that require a fast response between signals and motion for precise robot control.

 

Powered by BetterDocs