integration_with_other_systems
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
integration_with_other_systems [2020/05/22 10:14] – [GET example] emozolyak | integration_with_other_systems [2021/06/29 14:00] – [Implementing other requests like PUT] emozolyak | ||
---|---|---|---|
Line 56: | Line 56: | ||
===== Implementing other requests like PUT ===== | ===== Implementing other requests like PUT ===== | ||
- | To implement other requests, you can indicate for cURL call that you need custom | + | To implement other requests, you can use special field in the cURL for the custom |
<code lua> | <code lua> | ||
Line 79: | Line 79: | ||
INFO(" | INFO(" | ||
end | end | ||
+ | </ | ||
+ | |||
+ | <code lua> | ||
+ | function main (userId) | ||
+ | -- Add your code here | ||
+ | INFO(" | ||
+ | | ||
+ | write_reg_with_API(1, | ||
+ | | ||
+ | end | ||
+ | |||
+ | function write_reg_with_API(reg_id, | ||
+ | | ||
+ | c = cURL.easy_init() | ||
+ | | ||
+ | c: | ||
+ | c: | ||
+ | | ||
+ | c: | ||
+ | c: | ||
+ | | ||
+ | c: | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }) | ||
+ | | ||
+ | c: | ||
+ | c:close() | ||
+ | end | ||
+ | |||
</ | </ | ||
===== Example - connecting to a remote module via its web server ===== | ===== Example - connecting to a remote module via its web server ===== | ||
Line 100: | Line 131: | ||
{{ :: | {{ :: | ||
+ | |||
+ | ===== Notes on cURL usage ===== | ||
+ | |||
+ | <WRAP center round important 80%> | ||
+ | In the fw of 4.0 version, the following issue was reported: | ||
+ | When there are multiple cURL requests from the WebHMI to the unavailable resource, a system crash may happen. The timeout settings won't affect the sysem behaviour. Use this feature with care when you need cyclical calls of multiple cURLs in your scripts: | ||
+ | * use one script which detect availablity of the resource and locks following execution for a while | ||
+ | * use external watchdog circuit to reset WebHMI if you use it to control mission - critical system. | ||
+ | |||
+ | </ | ||
+ | |||
integration_with_other_systems.txt · Last modified: 2024/04/04 10:18 by emozolyak