MC_AxUtiReadCoeEncTerm_BkPlcMc (from V3.0)
The function block reads the contents of a register from the EL terminal, which is used as encoder interface for the axis.
Inputs
VAR_INPUT
Execute: BOOL;
Pdata: POINTER TO BYTE:=0;
ByteCount: BYTE:=0;
Index: WORD:=0;
Subindex: BYTE:=0;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge at this input starts the read process. |
Pdata | POINTER | Here, the address of the variable is specified, in which the read value is to be output. |
ByteCount | BYTE | Here, the size of the variable is specified in bytes. |
Index | WORD | Here, the addressing of parameter in the terminal is specified. |
Subindex | BYTE |
Inputs/outputs
VAR_INOUT
Axis: Axis_Ref_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis_Ref_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Busy: BOOL;
Done: BOOL;
CommandAborted: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
Done | BOOL | Successful loading of the parameter is indicated here. |
CommandAborted | BOOL | Indicates abortion of the read operation. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
Behavior of the function block
On a rising edge at Execute the function block checks the transferred axis interface. A number of problems can be detected and reported during this process:
- If the axis is enabled for operation, the system responds with Error and ErrorID:=dwTcHydErrCdNotReady.
- If Index or Subindex are out of range the system responds with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
- If ByteCount or Pdata are out of range the system responds with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
- If an I/O module, which does not support parameter communication, is set as nEncoder_Type in the axis parameters, the system responds with Error and ErrorID:=dwTcHydErrCdNotCompatible.
- If problems occur during the ADS communication with the terminal, the corresponding ADS error code is returned as ErrorID, and Error is indicated. The following codes may occur:
- 16#0006 = 6 = The port number of the ADS address used is invalid: Check mapping of the InfoData element of the terminal!
- 16#0007 = 7 = The AmsNetID of the ADS address used is invalid: Check mapping of the InfoData element of the terminal!
- 16#0702 = 1794 = dwTcHydAdsErrInvalidIdxGroup = The terminal does not support the CoE protocol.
- 16#0703 = 1795 = dwTcHydAdsErrInvalidIdxOffset = The address in index and subindex is not supported in the terminal.
- 16#0745 = 1861 = dwTcHydAdsErrTimeout = Timeout.
A falling edge at Execute clears all the pending output signals. If Execute is set to FALSE while the loading process is still active, the process that had started continues unaffected. The signals provided at the end of the operation (Done, CommandAborted, Error, ErrorID) are made available for one cycle.