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-08-2022 04:25 PM
Hello,
I'd like to read out a single bit of a drive parameter.
The parameter is: S-0-0135 and bit 3 is to read out.
For that "IL_ECATSoeRead" is used.
The values don't fit.
The drive has: 0b1100.1000.0000.1000
In PLC it's: 0b0000.0000.0000.1111
or something else...What's wrong with that?
Greetings
Solved! Go to Solution.
09-14-2022 09:51 AM
The S-0-0135 is in standard part of your cyclic communication, so do not need to read it acyclic. See here my examples working for both:
Declaration:
PROGRAM POU
VAR
fb_IL_ECATSoeRead: IL_ECATSoeRead;
bExecute: BOOL;
bDone: BOOL;
bActive: BOOL;
bError: BOOL;
ErrorID: CXA_EthercatMaster.ERROR_CODE;
ErrorIdent: CXA_EthercatMaster.ERROR_STRUCT;
strMasterName: STRING := 'ethercatmaster';
uiSlaveAddress: UINT := 1001;
wValueRead: WORD;
cyclicS135: WORD;
bBitAcyclic: BOOL;
bBitCyclic1: BOOL;
bBitCyclic2: BOOL;
END_VAR
Implementation:
bBitCyclic1 := %IX100.3;
cyclicS135 := %IW100;
bBitCyclic2 := cyclicS135.3;
fb_IL_ECATSoeRead(
Execute:= bExecute,
Done=> bDone,
Active=> bActive,
Error=> bError,
ErrorID=> ErrorID,
ErrorIdent=> ErrorIdent,
ClientId:= ,
MasterName:= ADR(strMasterName),
AddressType:= ,
SlaveAddress:= uiSlaveAddress,
DriveNo:= ,
Element:= ,
Idn:= IL_ECATSoeIdnCoding(SOE_S_PARAM,0,135),
SizeOfValue:= SIZEOF(wValueRead),
ValueAdr:= ADR((wValueRead)),
Timeout:= ,
NoOfRecBytes=> ,
RecvElement=> );
bBitAcyclic := wValueRead.3;
Picture:
09-16-2022 04:15 PM
Thanks, using status_word is working