SingleRequest vs. CyclicRequest

When accessing data points on an S7 Controller via an I/O mapping (see chapter about Mapping vs. PLC library), various access types can be configured. Their mode of operation is described in more detail below. The following table compares the two types of access.

Request

Trigger

Single

via SendRequest variable

Cyclic

via configurable CycleTime

SingleRequest

In the case of SingleRequest, the data points are configured and added to the process image. However, read and write access is “on demand,” i.e., when a certain condition is met. This condition can be produced using the status and control variables. For example, a request is executed exactly when SendRequest is one greater than ReceiveCounter. The overflow of the variables with the data type BYTE also need to be observed here, i.e. 0 > 255.

SingleRequest vs. CyclicRequest 1:

The following table provides an overview of this:

Variable

Data type

Description

Control.SendRequest

BYTE

By incrementing these variables from the application code, a read/write command (request) is triggered. As soon as the associated response has been received from the S7 Controller, the input variable, Status.ReceiveCounter is also incremented by 1 accordingly. The application thus knows that the read/write operation was successful.

Control.WriteToS7Enable

BIT

Write commands are only executed if this variable was set to TRUE.

Status.ReceiveCounter

BYTE

see Control.SendRequest above

Status.Error

WORD

When an error occurs whilst working through a command, the error code associated with this is displayed here. A description of the error codes is stored in the comment box.

CyclicRequest

In the case of a CyclicRequest, the read or write command is worked through cyclically. The cycle time can be configured via a parameter. If the cycle time is set faster than the real-time task of the system, then the request runs as quickly as possible, i.e. a new request is sent as soon as the previous one has been answered by the remote system.

SingleRequest vs. CyclicRequest 2: