Changes for page 01 Lua Functions

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

From version 5.13
edited by Stone Wu
on 2022/07/12 09:45
Change comment: (Autosaved)
To version 5.11
edited by Stone Wu
on 2022/07/12 09:35
Change comment: (Autosaved)

Summary

Details

Page properties
Content
... ... @@ -1300,11 +1300,10 @@
1300 1300  
1301 1301  [[http:~~/~~/w3.impa.br/~~~~diego/software/luasocket/http.html#request>>url:http://w3.impa.br/~~diego/software/luasocket/http.html#request]]
1302 1302  
1303 -== **https request** ==
1303 +== https request ==
1304 1304  
1305 1305  Example:
1306 1306  
1307 -{{code language="LUA"}}
1308 1308  local json = require("json")
1309 1309  
1310 1310  local https = require("https")
... ... @@ -1311,7 +1311,7 @@
1311 1311  
1312 1312  functions https_demo.main()
1313 1313  
1314 -local url = "https://XXXXXXXXXXXXXXXXXXXXXXXXXX"
1313 +local url = "https:~/~/XXXXXXXXXXXXXXXXXXXXXXXXXX"
1315 1315  
1316 1316  local body = {}
1317 1317  
... ... @@ -1344,7 +1344,6 @@
1344 1344  end
1345 1345  
1346 1346  end
1347 -{{/code}}
1348 1348  
1349 1349  (((
1350 1350  = **8 Internal register** =
... ... @@ -1352,50 +1352,41 @@
1352 1352  
1353 1353  The internal registers of the box are divided into bit addresses and word addresses, which can be accessed in two ways (taking HDW as an example):
1354 1354  
1355 -**Access by word, prefix @W_HDW.**
1353 +**~1. **Access by word, prefix @W_HDW,
1356 1356  
1357 1357  For example: @W_HDW0 represents the first word of the system data area, @W_HDW1 represents the second word of the system data area.
1358 1358  
1359 -**Access in bit mode, the prefix is @B_HDX, the number in front of "." indicates the number of the word, and the number behind is the bit number of the word.**
1357 +**2. **Access in bit mode, the prefix is @B_HDX, the number in front of "." indicates the number of the word, and the number behind is the bit number of the word.
1360 1360  
1361 1361  For example: @B_HDX1020.12, its meaning is to access the system data area in bit mode, the specific location is the 13th bit of the 1020th word.
1362 1362  
1363 -(% class="box infomessage" %)
1364 -(((
1365 1365  **✎Note: **
1366 1366  
1367 -* The address in @B_HDX is taken from the word in @W_HDW, so pay special attention when using the address.
1368 -** For example, @B_HDX1020.12 is to access the 13th bit of the 1020th word. The value of this bit is the same as the word obtained by @W_HDW001020. The 13th bit of this word is actually the same bit as @B_HDX1020.12.
1369 -* The address of the bit address @B_HDX has a decimal point, while the word address is an integer.
1370 -)))
1363 +**~1. **The address in @B_HDX is taken from the word in @W_HDW, so pay special attention when using the address.
1371 1371  
1365 +For example, @B_HDX1020.12 is to access the 13th bit of the 1020th word. The value of this bit is the same as the word obtained by @W_HDW001020. The 13th bit of this word is actually the same bit as @B_HDX1020.12.
1372 1372  
1373 -(% class="box errormessage" %)
1374 -(((
1367 +**2.**The address of the bit address @B_HDX has a decimal point, while the word address is an integer.
1375 1375  
1376 -)))
1377 -
1378 1378  (((
1379 -== **bvData storage area(HDW/HDX)** ==
1370 +== **8.1 Data storage area(HDW/HDX)** ==
1380 1380  )))
1381 1381  
1382 1382  The system storage area (HDW) of the V-BOX is used to store temporary data:
1383 1383  
1384 -1. Access by word, the number range is: "@W_HDW0"-"@W_HDW299999".
1385 -1. Access in bit mode, the number range is: "@B_HDX0.0"-"@B_HDX299999.15".
1375 +~1. Access by word, the number range is: "@W_HDW0"-"@W_HDW299999".
1386 1386  
1377 +2. Access in bit mode, the number range is: "@B_HDX0.0"-"@B_HDX299999.15".
1378 +
1387 1387  (((
1388 1388  == **8.2 Special data area (HSW/HSX)** ==
1389 1389  )))
1390 1390  
1391 -(% class="box errormessage" %)
1392 -(((
1393 1393  **✎Note: **
1394 1394  
1395 -* //HSW// is a system special register, so please refer to the system special register table during use. Do not use addresses that are not mentioned in the table, and use the addresses stated in the table with caution (example: restart ("@W_HSW0") Writing a value of 1 will cause V-BOX to restart).
1396 -* //Without any conditions. Direct use ("@W_HSW0") will cause the V-BOX to restart continuously.// When using ("@W_HSW0") address, please add judgment conditions, such as: connection to MQTT fails, there is no network, the value of a PLC address meets the condition or counts to a certain value.
1397 -)))
1385 +//HSW// is a system special register, so please refer to the system special register table during use. Do not use addresses that are not mentioned in the table, and use the addresses stated in the table with caution (example: restart ("@W_HSW0") Writing a value of 1 will cause V-BOX to restart).
1398 1398  
1387 +//Without any conditions. Direct use ("@W_HSW0") will cause the V-BOX to restart continuously.// When using ("@W_HSW0") address, please add judgment conditions, such as: connection to MQTT fails, there is no network, the value of a PLC address meets the condition or counts to a certain value.
1399 1399  
1400 1400  1.The system data area (HSW) of the box is used for system special registers (system reserved). Use //addr_getword// to obtain the following register information:
1401 1401