FB_S7CommCyclicRequest
Cyclic processing (read/write) of data points of an S7 communication connection can be configured with the function block FB_S7CommCyclicRequest. The output bError 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;
nCycleTimeMs : UDINT;
END_VAR
VAR_OUTPUT
bError : BOOL;
sErrorTxt : STRING;
nErrorId : WORD;
bBusy : BOOL;
nReceiveCounter : BYTE;
END_VAR
Inputs
Name | Data type | Description |
---|---|---|
bExecute | BOOL | The function block is executed by a rising edge at this input. |
nCycleTimeMs | UDINT | Cycle time to be used in [ms]. |
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. |
nReceiveCounter | BYTE | Counter for responses received by the S7 Controller. This can be used to check whether a response was received in the cyclic processing. |
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 on a STRING-type S7 data point to a 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 on a STRING-type S7 data point to a 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) |