Changes for page 01 Lua Functions
Last modified by Theodore Xu on 2023/10/26 10:51
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1300,10 +1300,11 @@ 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"}} 1307 1307 local json = require("json") 1308 1308 1309 1309 local https = require("https") ... ... @@ -1310,7 +1310,7 @@ 1310 1310 1311 1311 functions https_demo.main() 1312 1312 1313 -local url = "https: ~/~/XXXXXXXXXXXXXXXXXXXXXXXXXX"1314 +local url = "https://XXXXXXXXXXXXXXXXXXXXXXXXXX" 1314 1314 1315 1315 local body = {} 1316 1316 ... ... @@ -1343,6 +1343,7 @@ 1343 1343 end 1344 1344 1345 1345 end 1347 +{{/code}} 1346 1346 1347 1347 ((( 1348 1348 = **8 Internal register** = ... ... @@ -1350,41 +1350,50 @@ 1350 1350 1351 1351 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): 1352 1352 1353 -** ~1. **Access by word, prefix @W_HDW,1355 +**Access by word, prefix @W_HDW.** 1354 1354 1355 1355 For example: @W_HDW0 represents the first word of the system data area, @W_HDW1 represents the second word of the system data area. 1356 1356 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.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.** 1358 1358 1359 1359 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. 1360 1360 1363 +(% class="box infomessage" %) 1364 +((( 1361 1361 **✎Note: ** 1362 1362 1363 -**~1. **The address in @B_HDX is taken from the word in @W_HDW, so pay special attention when using the address. 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 +))) 1364 1364 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. 1366 1366 1367 -**2.**The address of the bit address @B_HDX has a decimal point, while the word address is an integer. 1373 +(% class="box errormessage" %) 1374 +((( 1368 1368 1376 +))) 1377 + 1369 1369 ((( 1370 -== ** 8.1Data storage area(HDW/HDX)** ==1379 +== **bvData storage area(HDW/HDX)** == 1371 1371 ))) 1372 1372 1373 1373 The system storage area (HDW) of the V-BOX is used to store temporary data: 1374 1374 1375 -~1. Access by word, the number range is: "@W_HDW0"-"@W_HDW299999". 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". 1376 1376 1377 -2. Access in bit mode, the number range is: "@B_HDX0.0"-"@B_HDX299999.15". 1378 - 1379 1379 ((( 1380 1380 == **8.2 Special data area (HSW/HSX)** == 1381 1381 ))) 1382 1382 1391 +(% class="box errormessage" %) 1392 +((( 1383 1383 **✎Note: ** 1384 1384 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). 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 +))) 1386 1386 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. 1388 1388 1389 1389 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: 1390 1390