FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
03-13-2023 02:21 PM - edited 03-13-2023 02:26 PM
Hello, we have basically been able to establish communication via RestAPI. We could already read out single values/variables from the nodes of the PLC.
However, we have not yet found a way to read or write all variables of the GVL as a block. The Swagger-Docu doesn't give us much information.
We tried to create a subscription, that worked too, but nothing happens when when we start it.
Anyone can help?
Solved! Go to Solution.
03-13-2023 04:21 PM - edited 03-15-2023 05:15 PM
In short you cannot read out a whole structure just using the head node. See this topic.
You could do a bulk read or bulk subscribe. For this case you will have to give all paths of all nodes and subnodes you like to get to the read/subscribe function.
Read, response is a single http standard:
https://127.0.0.1:8443/automation/api/v2/bulk?type=read
[
{
"address": "framework/metrics/system/cpu-utilisation-percent",
"type": "double"
},
{
"address": "framework/metrics/system/memfree-mb",
"type": "double"
},
{
"address": "framework/metrics/system/memused-percent",
"type": "double"
}
]
Subscribe, response is a server send event (SSE) stream:
https://127.0.0.1:8443/automation/api/v2/events?nodes=datalayer/retain/stats/sync-counter,datalayer/retain/stats/free,framework/metrics/system/cpu-utilisation-percent&publishIntervalMs=1000