FB_S7CommSingleRequest
With the function block FB_S7CommSingleRequest, a read/write request can be carried out on a data point of an S7 communication link. Via the output bError, it is possible to tell whether the request was successfully carried out. Any errors occurring at the time of the request are displayed via the output sErrorTxt and nErrorID.
Syntax
Definition:
VAR_INPUT
bExecute : BOOL;
END_VAR
VAR_OUTPUT
bError : BOOL;
sErrorTxt : STRING;
nErrorId : WORD;
bBusy : BOOL;
END_VAR
Inputs
Name | Data type | Description |
---|---|---|
bExecute | BOOL | The function block is executed by a rising edge at this input. |
Outputs
Name | Data type | Description |
---|---|---|
bError | BOOL | Switches to TRUE if an error occurs during execution. |
sErrorTxt | STRING | Contains the error text in the event of an error. |
nErrorId | WORD | Outputs an error code in the event of an error. |
bBusy | BOOL | TRUE until the function block has executed a command. As long as bBusy = TRUE, the function block will not accept any new commands. |
Methods
Name | Definition location | Description |
---|---|---|
Local | Adds a read command for a particular S7 data point to the request. | |
Local | Adds a read command for a particular BIT type S7 data point to the request. | |
Local | Adds a read command for a particular STRING type S7 data point to the request. | |
Local | Adds a write command for a particular S7 data point to the request. | |
Local | Adds a write command for a particular BIT type S7 data point to the request. | |
Local | Adds a write command for a particular STRING type S7 data point to the request. | |
Local | Removes a variable from a read request. | |
Local | Removes a variable from a write request. |
Requirements
Development environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64) | Tc3_S7Comm (Communication) |