Difference between revisions of "NETIO Lua Reference"

From wiki.netio-products.com
Jump to navigation Jump to search
(Socket Communication)
Line 46: Line 46:
  
 
(based on [http://dkolf.de/src/dkjson-lua.fsl/home dkjson])
 
(based on [http://dkolf.de/src/dkjson-lua.fsl/home dkjson])
 +
 +
== Modbus ==
 +
<big><b>Read functions</b></big>
 +
* function [[Function modbusReadCoil()|modbusReadCoil()]] - read value from coil
 +
* function [[Function modbusReadDiscreteInput()|modbusReadDiscreteInput()]] - read value from discrete input
 +
* function [[Function modbusReadHoldingRegister()|modbusReadHoldingRegister()]] - read value from holding register
 +
* function [[Function modbusReadInputRegister()|modbusReadInputRegister()]] - read value from input register
 +
 +
<big><b>Write functions</b></big>
 +
* function [[Function modbusWriteSingleCoil()|modbusWriteSingleCoil()]] - write value to single coil
 +
* function [[Function modbusWriteSingleRegister()|modbusWriteSingleRegister()]] - write value to single register
  
 
== Standard Lua Functions ==
 
== Standard Lua Functions ==

Revision as of 12:19, 20 June 2019

Outlet Management

devices.system

Socket System Management

devices.system


Socket Communication

XML Processing 2.3.6

xml

  • function .escape() - escapes XML string to fit xml node contents
  • function .check() - tests if string is well-formed XML
  • function .parse() - parses XML string into XmlElement object

JSON Processing 3.3.0

json

  • function .decode() - parse json string into obj table
  • function .encode() - generate JSON string from table

(based on dkjson)

Modbus

Read functions

Write functions

Standard Lua Functions

Miscellaneous

  • function log() - insert a record to the socket's event log
  • function logf() - insert a formated record (incl. numbers) to the socket's event log
  • function delay() - execute function with delay (seconds)
  • function milliDelay() - execute function with delay (milliseconds)
  • function toboolean() - converts any variable to boolean type