Changes for page 01 Lua Functions

Last modified by Theodore Xu on 2023/10/26 10:51

From version 5.29
edited by Stone Wu
on 2022/07/12 10:40
Change comment: (Autosaved)
To version 5.33
edited by Stone Wu
on 2022/07/12 10:50
Change comment: (Autosaved)

Summary

Details

Page properties
Content
... ... @@ -1781,9 +1781,9 @@
1781 1781  end
1782 1782  {{/code}}
1783 1783  
1784 -= **11 Special function for V-NET** =
1784 += **10 Special function for V-NET** =
1785 1785  
1786 -**normal_get_alldata()**
1786 +== **normal_get_alldata()** ==
1787 1787  
1788 1788  **Function: **Obtain the data of all the monitoring points
1789 1789  
... ... @@ -1793,7 +1793,66 @@
1793 1793  
1794 1794  Succeed: table two-dimensional arrays, as follows:
1795 1795  
1796 -* Each item is a monitoring point and contains 4 attributes: ID, status, tag name, value)
1797 -* Status contains 3 enumerated values (0: offline, 1: online, 2: timeout) Customization returns an empty table if there is no configuration, and vice versa, with "field name/field content"
1796 +* Each item is a monitoring point and contains 4 attributes:
1797 +** 1: ID
1798 +** 2: status
1799 +** 3: tag name
1800 +** 4: value
1801 +* Status contains 3 enumerated values
1802 +** 0: offline
1803 +** 1: online
1804 +** 2: timeout
1805 +* Customization returns an empty table if there is no configuration, otherwise returns "field name/field content"
1798 1798  
1799 -Failed: multi, error code
1807 +For example:
1808 +
1809 +{
1810 +
1811 +[1]= {[1]=1234, [2]=1, [3]='temp', [4]='23.5'},
1812 +
1813 +[2]= {[1]=1235, [2]=1, [3]='humi', [4]='67'},
1814 +
1815 +...
1816 +
1817 +[n]= {[1]=xxxx, [2]=x, [3]='xxxx', [4]='xx.x'},
1818 +
1819 +}
1820 +
1821 +Failed: table, empty table
1822 +
1823 +== **normal_setdata_byname(string name, string data)** ==
1824 +
1825 +**Function:** Write data to the monitoring point name
1826 +
1827 +**Parameter:**
1828 +
1829 +name: the name of monitoring point
1830 +
1831 +data: the data to be written
1832 +
1833 +**Return:**
1834 +
1835 +Succeed: string: The value of the monitor point before it is written
1836 +
1837 +Failed: mil
1838 +
1839 +== **normal_getdata_byname(string name)** ==
1840 +
1841 +
1842 +**Function:** Read the data of the monitoring point name
1843 +
1844 +**Parameter:**
1845 +
1846 +name: the name of monitoring point
1847 +
1848 +**Return:**
1849 +
1850 +Succeed: string
1851 +
1852 +Failed: mil
1853 +
1854 += **11 MySQL database operation** =
1855 +
1856 +== **luaMySql.init(string sourcename, string username, string password, string host, number port, string character)** ==
1857 +
1858 +