[Up]
2.1 Adding the S7Drv driver
The project main file with the S7Drv driver included is shown in Figure 2.1. Configuration for the Client mode is shown.
There are 2 blocks which must be added to the project to include the driver. First the MODULE block is attached the the Modules output of the EXEC function block. It must be renamed to S7Drv.
The other block of type IODRV is named S7C and it is connected to the Drivers output of the main EXEC block. The three most important parameters are:
- – name of the module linked to the driver, in this case S7Drv – the name is CASE SENSITIVE!
- – class of the driver, which defines the role of the target device:
- S7cDrv – for Client mode (emulation of PG)
- S7sDrv – for Server mode (emulation of PLC)
The name is CASE SENSITIVE!
- – name of the driver configuration file (*.rio, REX Input/Output), which is discussed in chapter 3
The name of this block (S7C, see Fig. 2.1), is the prefix of all input and output signals provided by this driver.
The above mentioned parameters of the IODRV function block are configured in the RexDraw program as shown in Figure 2.2. The Configure button opens the configuration dialog of the S7Drv driver, which is described in chapter 3.
The Client mode of the S7Drv driver supports the so-called synchronized execution of communication and control tasks. This can be achieved by using the TIODRV function block instead of the IODRV block. The parameters are the same, only the TIODRV block provides the Tasks output, which can be used for connecting IOTASK function block. The parameters are analogous to the TASK block. In this mode the driver reads all inputs first, executes the task defined by the IOTASK block and afterwards sets all outputs and waits for the next period. It is necessary to take into account that in the case of communication failure the IOTASK will not be executed until the communication timeout expires. This approach is therefore applicable mainly for communication periods longer than 10 seconds.
[Back to top] [Up]