ReadCrcErrors (FB)ΒΆ
FUNCTION_BLOCK ReadCrcErrors EXTENDS ETrigA
This function block is for reading the the crc counters of EtherCAT slaves.
Example:
Following example code reads the crc error counters
PROGRAM PLC_PRG
VAR
etcReadCrc : ReadCrcErrors;
xRead : BOOL;
END_VAR
etcReadCrc(xExecute := xRead, usiCom:=1, wSlaveAddress := 1002,
xAutoIncAdr := FALSE, udiTimeout := 500);
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xExecuteBOOLRising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone,xError,iError) are present at the outputs for exactly one cycle.ETrigA
xAbortBOOLTRUE: Action is stopped immediately and all outputs are reset to their initial values.ETrigA
Output
xDoneBOOLTRUE: Action successfully completedETrigA
xBusyBOOLTRUE: Function block activeETrigA
xErrorBOOLTRUE: Error occurred, function block aborts actionFALSE: No errorETrigA
xAbortedBOOLTRUE: Action aborted by userETrigA
Input
usiComUSINT1
index of master 1: first Ethercat master
wSlaveAddressWORDaddress either auto increment address or physical address of device
xAutoIncAdrBOOLflag that determines which way to use the given address
udiTimeOutUDINTTimeout for operation in ms
Output
usiCrcPortAUSINTInvalid frame counter of Port A (counting is stopped when 0xFF is reached).
usiCrcPortBUSINTInvalid frame counter of Port B (counting is stopped when 0xFF is reached).
usiCrcPortCUSINTInvalid frame counter of Port C (counting is stopped when 0xFF is reached).
usiCrcPortDUSINTInvalid frame counter of Port D (counting is stopped when 0xFF is reached).
uiWorkingCounterUINTworking counter of received command