NETIO Lua Reference: Difference between revisions

From wiki.netio-products.com
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
* number [[Number devices.system.freeSpace|.freeSpace]] - free disk space
* number [[Number devices.system.freeSpace|.freeSpace]] - free disk space
* number [[Number devices.system.totalSpace|.totalSpace]] - total disk space
* number [[Number devices.system.totalSpace|.totalSpace]] - total disk space
* string [[String devices.system.serialNumber|.serialNumber]] <sup><code>3.3.0</code></sup> - returns serial number of the device (Eth Interface MAC address)
* string [[String devices.system.serialNumber|.serialNumber]] <sup><code>3.3.1</code></sup> - returns serial number of the device (Eth Interface MAC address)
* number [[Number devices.system.voltage|.voltage]] - socket's voltage
* number [[Number devices.system.voltage|.voltage]] - socket's voltage
* number [[Number devices.system.overallPowerFactor|.overallPowerFactor]] - overall power factor
* number [[Number devices.system.overallPowerFactor|.overallPowerFactor]] - overall power factor
Line 32: Line 32:
* function [[Function cgiGet()|cgiGet()]] <sup><code>2.3.5</code></sup> - send HTTP request and receive response
* function [[Function cgiGet()|cgiGet()]] <sup><code>2.3.5</code></sup> - send HTTP request and receive response
* table [[Table event.args|event.args]] - HTTP GET /event variables table
* table [[Table event.args|event.args]] - HTTP GET /event variables table
* function [[Function snmpGet()|snmpGet()]] - send SNMP request
* function [[Function snmpGet()|snmpGet()]] <sup><code>3.3.0</code></sup> - send SNMP request


== XML Processing <sup><code>2.3.6</code></sup> ==
== XML Processing <sup><code>2.3.6</code></sup> ==
Line 40: Line 40:
* function [[Function xml.parse()|.parse()]] - parses XML string into [[Function xml.parse()#XmlElement|XmlElement]] object
* function [[Function xml.parse()|.parse()]] - parses XML string into [[Function xml.parse()#XmlElement|XmlElement]] object


== JSON Processing <sup><code>3.3.0</code></sup> ==
== JSON Processing <sup><code>3.3.1</code></sup> ==
<big><b>json</b></big>  
<big><b>json</b></big>  
* function [[Function json.decode()|.decode()]] - parse json string into obj table
* function [[Function json.decode()|.decode()]] - parse json string into obj table
Line 47: Line 47:
(based on [http://dkolf.de/src/dkjson-lua.fsl/home dkjson])
(based on [http://dkolf.de/src/dkjson-lua.fsl/home dkjson])


== Modbus ==
== Modbus <sup><code>3.3.0</code></sup>==
<big><b>Read functions</b></big>  
<big><b>Read functions</b></big>  
* function [[Function modbusReadCoil()|modbusReadCoil()]] - read value from coil
* function [[Function modbusReadCoil()|modbusReadCoil()]] - read value from coil

Revision as of 13:04, 8 July 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.1

json

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

(based on dkjson)

Modbus 3.3.0

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