FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
02-26-2024 04:32 PM
Hi everyone,
I have a ctrlx Drive with built-in ctrlX Core am using ctrlX OS version 2.4.
I am currently trying to create a simple node with the address "test/testbool" and the value datatype Bool, using the functionblock DL_CreateNode.
I copied the implementation from the documentation and adapted it slightly:
PROGRAM DL_test
VAR
m_fbCreateNode : CXA_Datalayer.DL_CreateNode;
m_Execute : BOOL;
m_ValueIn : BOOL;
m_ValueOut : BOOL;
m_address : STRING;
END_VAR
m_address := 'test/testbool';
m_ValueIn := TRUE;
m_Execute := TRUE;
m_fbCreateNode(Execute:= m_Execute, NodeName:= m_address, ValueIn:= m_ValueIn, ValueOut:=m_ValueOut);
IF (m_fbCreateNode.Done = TRUE) OR (m_fbCreateNode.Error = TRUE) THEN
m_Execute := FALSE;
m_fbCreateNode(Execute:= m_Execute, NodeName:= m_address, ValueIn:= m_ValueIn, ValueOut:= m_ValueOut);
END_IF
Unfortunately, the function block keeps reporting the error ACCESS-ERROR.
So far I have only been able to run functionblocks that only have read access to the data layer.
I would appreciate any helpful input.
Thanks
Regards
Thomas
Solved! Go to Solution.
02-26-2024 05:05 PM - edited 02-26-2024 05:07 PM
The data layer itself is a broker and not holding any data so the function block DL_CreateNode is not able to add nodes to the data layer but is executing an create function provided by a program. You can check in the data layer viewer in the web interface of the ctrlX OS if an read/write/create can be executed on any node via its metadata.
You can use the "ctrlX OS - PLC" app to add nodes to the data layer see "Publish variables to the Data Layer [DOCU] - [VIDEO]"
You could also use the "ctrlX OS - Key Value Database" app as a provider and send the create command to it.
02-27-2024 09:03 AM
OK, I understand, thank you very much for your answer.
I had previously only used the Python SDK to register nodes on the Datalyer and therefore I thought I needed a function block to register my plc data.
However, I have to say that the documentation of the function block DL_CreateNode "The function block DL_CreateNode creates a new node." is a bit confusing for me.
02-27-2024 09:33 AM
I agree. Could you send me a link to where you found this documentation? Then I will try to rework it.
02-27-2024 10:28 AM
sure: https://docs.automation.boschrexroth.com/doc/3535968467/dl-createnode/latest/en/
also in Advanced function block "DL_CreateNodeValue": https://docs.automation.boschrexroth.com/doc/3432377361/dl-createnodevalue/latest/en/