User Tools

Site Tools


lua:introduction_to_lua_programming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lua:introduction_to_lua_programming [2021/07/22 07:34] – ↷ Links adapted because of a move operation atolstovlua:introduction_to_lua_programming [2022/01/17 20:58] (current) – ↷ Links adapted because of a move operation 127.0.0.1
Line 1: Line 1:
 +{{ network:lua_logo.png?nolink&100|}} 
 +
 ====== Introduction to Lua programming ====== ====== Introduction to Lua programming ======
-WebHMI allows you to create custom programs (scripts) in [[https://en.wikipedia.org/wiki/Lua | Lua]] 5.1 language. The scripts are managed in the **Setup -> Scripts** menu item. +WebHMI allows you to create custom programs (scripts) in [[https://en.wikipedia.org/wiki/Lua | Lua]] 5.1 language.  
 +The scripts are managed in the **Setup -> Scripts** menu item. 
  
 If you have no experience with Lua language read this tutorial at first  [[ https://gist.github.com/pateltej/bfec90ff449595f12236 | Lua in 15 minutes]].  If you have no experience with Lua language read this tutorial at first  [[ https://gist.github.com/pateltej/bfec90ff449595f12236 | Lua in 15 minutes]]. 
Line 51: Line 54:
 For the convenience of working with registers from Lua programs, each register can be assigned a symbolic name and be accessed from Lua with this name. This name is specified in the register settings in the **Script alias** field: For the convenience of working with registers from Lua programs, each register can be assigned a symbolic name and be accessed from Lua with this name. This name is specified in the register settings in the **Script alias** field:
  
-{{ :alias_in_reg_list2.png?800 |}}+{{ network:alias_in_reg_list2.png?800 |}}
  
 In the example above, alias "systemTime" was used in GetReg function to read system time from internal WebHMI register with id = 1. In the example above, alias "systemTime" was used in GetReg function to read system time from internal WebHMI register with id = 1.
lua/introduction_to_lua_programming.1626939277.txt.gz · Last modified: 2021/07/22 07:34 by atolstov

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki