FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
09-01-2022 12:14 PM
I want to read values in the datalayer via the RestAPI. This works for single variables without problems. I would like to read whole nodes with subnodes and associated variables and get the result as json. Based on the example project allprovider.data (main node "sdk-cpp-alldata", 2 subfolders "dynamic" and "string", each containing different variables) the response of the Get command as json should look something like this.
{
„sdk-cpp-alldata“: {
„type“: „arstring“,
„value“: [
„dynamic“: {
„bool8“: {
„type“: „bool8“,
„value“: true
}
„int16“: {
„type“: „int16“,
„value“: 100
}
…
}
„static“: {
…
}
}
}
}
The Background is that I want to execute only one http get command. Then I want to process the whole json so that I can read all variables from it. Is this possible and if so how?
Solved! Go to Solution.
09-01-2022 01:07 PM - edited 09-19-2022 02:26 PM
This is not possible in general for each node. The provider of these node would have to implement this function (like in Data Layer under framework/bundles). Right now you would have to do a browse and then see all the nodes below and decide from which you like to read the value or do another browse.
We are actually working on a bulk read function that will be released end of November in version 1.18 of the system. But you will have to tell the read command always which pathes should be read.
03-15-2023 05:11 PM
Just posted a example for bulk read and subscribe in this topic.