FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
01-11-2023 03:12 PM
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)
Solved! Go to Solution.
01-13-2023 08:46 AM - edited 01-13-2023 08:47 AM
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?
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);
01-13-2023 10:23 AM
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
01-13-2023 10:23 AM
realized just passing 16#0 as clientId solves the issue for the customer so he does not have to reboot
01-13-2023 10:36 AM
You can also leave the Client ID empty as I did. Please beware that the data type is IL_HANDLE.