FB_SoEReadDiagNumberList
The functionblock FB_SoEReadDiagNumberList can be used to read the history of the diagnose numbers as a list (S-0-0375).
VAR_INPUT
VAR_INPUT
NetId : T_AmsNetId := '';
Execute : BOOL;
Timeout : TIME := DEFAULT_ADS_TIMEOUT;
pDiagNumber : POINTER TO ST_SoE_DiagNumList;
Size : UDINT;
END_VAR
NetId: A string containing the AMS network identifier of the PC.
Execute: The block is activated by a rising edge at this input.
Timeout: Maximum time allowed for the execution of the function block.
pDiagNumber: Pointer to the list of the last max. 30 error numbers. The list consists of the actual and maximum number of bytes in the list, and of the last 30 list entries
Size: Size of the list in bytes (as Sizeof())
VAR_IN_OUT
VAR_IN_OUT
Axis : AXIS_REF; (* Axis reference *)
END_VAR
Axis: Axis structure (see TcMC2.lib).
VAR_OUTPUT
VAR_OUTPUT
Busy : BOOL;
Error : BOOL;
AdsErrId : UINT;
SercosErrId : UINT;
Attribute : DWORD;
END_VAR
Busy: This output is set when the function block is activated and remains set until an acknowledgement is received.
Error: This output is set up after the bBusy output has been reset if there has been an error in transmission of the command.
AdsErrId: Supplies the ADS error code associated with the most recently executed command if the Error output is set.
SercosErrId: Supplies the Sercos error code associated with the most recently executed command if the Error output is set.
Attribute: Supplies the Sercos parameter attribute.
Sample
fbDiagNumberList : FB_SoEReadDiagNumberList;
DiagNumberList : BOOL;
stDiagNumberList : ST_SoE_DiagNumList;
(* NcAxis *)
Axis : AXIS_REF;
IF DiagNumberList THEN
fbDiagNumberList(
Axis := Axis,
Execute := TRUE,
Timeout := DEFAULT_ADS_TIMEOUT,
pDiagNumber:= ADR(stDiagNumberList),
Size := SIZEOF(stDiagNumberList),
);
IF NOT fbDiagNumberList.Busy THEN
fbDiagNumberList(Axis := Axis, Execute := FALSE);
DiagNumberList := FALSE;
END_IF
END_IF