FB_S7CommSingleRequest

With the FB_S7CommSingleRequest function block, a read/write request can be carried out on a data point of an S7 communication connection. The bError output states 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 read command to the request in an optimized manner if several data points located consecutively in the memory of the S7 Controller are to be read. | |
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 | Adds a read command to the request in an optimized manner if several data points located consecutively in the memory of the S7 Controller are to be written. | |
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) |