FB_TermCoeRead_TcPfw()
A function block of this type is used by FB_TempCtrlCallback_TcPfw for read access to EL terminals.
Syntax
VAR_INPUT
Execute : BOOL;
TermType : E_TcPfw_TerminalType:=eTcPfwTermT_NoTerminal;
Pdata : POINTER TO BYTE:=0;
ByteCount : BYTE:=0;
Index : WORD:=0;
Subindex : BYTE:=0;
END_VAR
VAR_IN_OUT
TempIn : ST_TcPfw_TempCtrlInput;
END_VAR
VAR_OUTPUT
Busy : BOOL:=FALSE;
Done : BOOL:=FALSE;
CommandAborted: BOOL:=FALSE;
Error : BOOL:=FALSE;
ErrorID : UDINT:=0;
END_VAR
Inputs
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge starts the process. |
TermType | E_TcPfw_TerminalType | The coded type of the addressed terminal. |
Pdata | POINTER TO BYTE | The destination address for the read data. |
ByteCount | BYTE | The size of the data to be read in bytes. |
Index | WORD | The CoE address according to the object directory of the terminal. |
Subindex | BYTE | The CoE address according to the object directory of the terminal. |
Inputs/outputs
Name | Type | Description |
---|---|---|
TempIn | ST_TcPfw_TempCtrlInput | The input process image of the terminal. |
Outputs
Name | Type | Description |
---|---|---|
Busy | BOOL | The ongoing activity of the function block is signaled here. |
Done | BOOL | The successful completion of the operation is reported here. |
CommandAborted | BOOL | A TRUE indicates here that the process was aborted. |
Error | BOOL | A TRUE indicates here the occurrence of a problem. |
ErrorID | UDINT | In the event of an error, coded information is provided here. |
Behavior of the function block:
A rising edge at Execute causes the function block to perform a series of checks.
- The subindex must be in the range 0 to 127 (inclusive).
- ByteCount must be greater than 0.
- Pdata must not be 0.
- TermType must identify an EL terminal. Only these support the CoE communication mechanism used here.
If one of the above conditions is not met, an error is reported. Otherwise, the access is transmitted to the terminal. The result of the transmission is provided at the outputs.
In addition to the above-mentioned error possibilities, problems can occur during transmission. Furthermore, the terminal can report a problem (addressing, values, access type). |
A CoE access requires that ST_TcPfw_TempCtrlInput.EL_AdsAddr is linked. |