cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

CXA_Datalayer.DL_CreateNode - ACCESS-ERROR

CXA_Datalayer.DL_CreateNode - ACCESS-ERROR

Thomas_SF
Established Member

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

4 REPLIES 4

CodeShepherd
Community Moderator
Community Moderator

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.

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.

I agree. Could you send me a link to where you found this documentation? Then I will try to rework it.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist