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.

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

DL_ReadNode access_error when reading

DL_ReadNode access_error when reading

ham1hel
Established Member

Hello
I've seen two cases when reading from the datalayer using DL_ReadNode where it seems the block or datalayer runns in to som sort of lock and throwing error instead of reading.

Once was when toggling the execute of the block without looking at the done flag which ofcourse is something you should not do but when detecting the issue and correcting it the block continued to give access_error until the CtrlX was restarted, then it started working.

I assume this has something to do with buffering but question is, is there any posibility to reset the block/buffer/datalayer in order to be able to read again without having to reboot the CtrlX?

(Note that the application is now running fine after correcting the check on the Execute flag so was not an issue with the permissions to read the datalayer)

4 REPLIES 4

CodeShepherd
Community Moderator
Community Moderator

Could not reproduce your behavior on my side. Test was done ctrlX COREvirtual and app versions 1.18, library 1.2.9.2

Could you give us some more information about your circumstances?

  • Which system version are you using?
    • system apps
    • PLC app
    • CXA_DataLayer library
  • Do you have some example code?
  • Which node was read?

See my test below:

Declaration:

 

PROGRAM PLC_PRG
VAR
	fbDL_ReadNode: DL_ReadNode;
	bExecute: BOOL;
	bDone: BOOL;
	bActive: BOOL;
	bError: BOOL;
	ErrorID: CXA_Datalayer.ERROR_CODE;
	ErrorIdent: CXA_Datalayer.ERROR_STRUCT;
	ValueRead: LREAL;
	diSize: DINT;
	bStop: BOOL;
END_VAR

 

Implementation:

 

IF bExecute AND NOT bStop THEN
	bExecute := FALSE;
ELSIF NOT bExecute AND NOT bStop THEN
	bExecute := TRUE;
END_IF

fbDL_ReadNode(
	Execute:= bExecute, 
	Done=> bDone, 
	Active=> bActive, 
	Error=> bError, 
	ErrorID=> ErrorID, 
	ErrorIdent=> ErrorIdent, 
	ClientId:= , 
	NodeName:= 'framework/metrics/system/cpu-utilisation-percent', 
	Value:= ValueRead, 
	Size=> diSize);

 

Hi, I also tried to reproduce the issue again and realized that the issue seems to be related to the clientId.

So if i for example declare:


posReadRead: DL_ReadNode;


and then


posReadRead( clientId:= 16#10010101, NodeName:='fieldbuses/ethercat/master/instances/ethercatmaster/realtime_data/input/data/IndraDrive_MPB20_21/AT.Position_feedback_value_1', Value:= readPos);


IF NOT posReadRead.Active AND NOT posReadRead.Execute THEN
posReadRead.Execute := TRUE;
END_IF

posReadRead.ErrorID;

IF posReadRead.Done OR posReadRead.Error THEN
posReadRead.Execute := FALSE;
END_IF

This gives me an access error when running the code 

If i then remove the clientId 

posReadRead( NodeName:='fieldbuses/ethercat/master/instances/ethercatmaster/realtime_data/input/data/IndraDrive_MPB20_21/AT.Position_feedback_value_1', Value:= readPos);

 
But error remained

ham1hel
Established Member

realized just passing 16#0 as clientId solves the issue for the customer so he does not have to reboot

CodeShepherd
Community Moderator
Community Moderator

You can also leave the Client ID empty as I did. Please beware that the data type is IL_HANDLE.

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