Moravian instruments, Inc., source: https://www.mii.cz/art?id=160&lang=409, printed: 30.04.2025 21:53:25
Main page▹Products▹Control Web Software System▹Control Web device drivers | 8.1.2019 |
---|
The S_MPI driver provides communication of Control Web application with SIMATIC S7 PLCs over the MPI or PROFIBUS protocol. |
Driver features
Warning: The driver requires the Simens PRODAVE S7 product installed on the computer. List of sections:
The PRODAVE S7 software supportControl Web MPI driver requires the Siemens PRODAVE S7 (v.5.5 and higher) product is installed on the computer. The PRODAVE is supplied in two versions. The cheaper PRODAVE S7 mini enables data transfer to/from S7-300/400/M7/C7 datablocks only. Only the Varea is supported in the case of S7-200 PLC. The full version of PRODAVE S7 supports also data transfer to/from M, A, E, T, Zand Sareas. Appropriate hardware is also required to communicate over the MPI interface. It is possible to use the PCI plug-in board CP5611 or the PCMCIA adapter CP5511. It is also possible to use external PC Adapter (MPI), which is connected to the standard PC serial interface RS-232C. It is of course necessary to install appropriate drivers for the used hardware.. Remark: It is not possible to use S7-200 with the PC Adapter (MPI). The Siemens PG/PC interface configurationIt is necessary to configure the PC/PC interface for the driver to work properly. Configuration tools can be found in the Windows Control Panel under the icon: It is necessary to choose so-called Access Point first. Choose the S7ONLINE from the combo-box: Then it is necessary to define other parameters. Select communication hardware and MPI interface. The CP5611 card is chosen as an example here: Another possibility is the PC Adapter (MPI): Clicking the Properties button opens dialog pox for particular hardware. It is important to define communication speed properly. Take care to define if the PC (PG/PC) is the only master in the MPI network. If you use S7-200, this option must be checked. The S_MPI driver creates the 'ERROR.DAT' file in the Control Web directory with error messages. The PRODAVE S7 software creates another two files 'ERROR.ENG' and 'ERROR.GER' with error messages in English and German languages. The 'ERROR.DAT' file can be replaced by one of these files, but it is necessary to keep the '.DAT' extension. How the driver worksIt is possible to read and/or write data from/to data areas D, V, M, A, E, T, Zand S. It is also possible to manipulate with individual bits of the M area. The driver automatically detects the version of PRODAVE S7 installed on the particular computer and uses only the functionality provided by the installed version. If the driver is configured to use unsupported data areas, it will generate an error during the application startup. The driver interprets PLC'sdata elements as boolean or numeric channels. Data element is usually a byte (in the D, V, M, A, E and Sareas) or word (in the T and Zareas). Numerical values can be of different types (int8, uint8, int16, uint16, int32, uint32, float32, float32s), depending on the number of data elements occupied. Also logical channels can be of different types (bits, sbit, bool8) depending on the interpretation (one bit or whole byte). If the whole byte is interpreted as one logical value then zero value means false, non-zero value means true. Driver data channels (number of channels and their types) are configured in the driver parameter file according to the user needs. Driver parametersThe driver parameter file defines various communication parameters and also individual channels. The whole parameter file is divided into individual sections. Section name is delimited by square brackets. Individual parameters within the section follows the parameter_name = parameter_value convention. Every parameter occupies exactly one line. Remark: Both section and parameter names are case-sensitive. Connections definition — section [Connection]All devices (PLCs), with which the driver has to communicate, are defined in this section. Every device has assigned name, which identifies it in the [Channels] section, and also device address and possibly another parameters identifying the device are defined here. Number of connections is limited to 32. Every connection is defined on the separate line according to the following syntax: [Connection] <Id> = station:<N>, segment:<N>, rack:<N>, slot:<N>, cpu:<N> <Id> = ... ...
The cpu parameter defines PLC series. The S7-200 is identified by the number 200, Higher models (S7-300/400/M7/C7) are identified by the number 300. It is also possible to use short notation, where on the right side of the equal sign are only numbers in the following orders: station, segment, rack, slot, cpu. Example of the [Connection] section parameters: [Connection] CPU314 = station:3, segment:0, rack:0, slot:2, cpu:300 or CPU314 = 3, 0, 0, 2, 300 Driver parameter definition — section [Settings]This section contains parameters, which configures the driver. Individual parameters and their possible values are: [Settings] DeviceName = <Device> ErrorFile = <File> SwapBytes = true | false MaxExceptions = <N> FinalizeAfterEachBlock = false | true Trace = none | log | xtrace | windows
Individual parameters description:
Example of the [Settings] section: [Settings] DeviceName = S7ONLINE ErrorFile = ERROR.DAT SwapBytes = false MaxExceptions = 1000 FinalizeAfterEachBlock = false Trace = none Channels definition — section [Channels]This section defines individual channels or group of channels and their representation in the PLC'smemory. Groups are defined in individual blocks. One block is defined by the range of channel numbers, connection identifier, PLC data area, data type and start and end addresses in the PLC data area. It is possible to define parameter bidirect, which eliminates collisions of bi-directional channels during overlapping read and write operations — there are two independent channel blocks for read and write created in the driver. Another optional parameter defines byte swapping for types longer than 1 byte. It is also possible to add a comment. Comments must be on separate lines and must begin with semicolon. One block represent maximal continuous data area transferred during one communication transaction from the communication point of view. However, the maximal size transferred also depends on the used protocol and on the lower layers. They can split the block to even smaller packets. Every channel group (block) is described on one line. Syntax for one block description is as follows. Optional parameters are in square brackets. [Channels] Block = <From>,<To>,<Con>,<Area>,<Type>,<Adr>[,Bidirect] [,SwapBytes] [,Id:<Name>] Block = ... ...
Remark: The sbit type can be applied only for M data area. The type is not defined for data areas T and Z — it is always uint16. Example of the [Channels] section: [Channels] Block = 200, 299, CPU315, M, sbit, 50 Block = 300, 347, CPU314, A, bits, 124 Block = 500, 547, CPU314, A, bits, 124 Block = 1100, 1999, CPU315, D100, uint16, 50, Id:InD100 Block = 2100, 2999, CPU315, D100, uint16, 50, Id:OutD100 Block = 3000, 3009, CPU315, Z, 0 Block = 4000, 4009, CPU315, T, 0 Driver channelsThe driver interprets various parts of PLC data areas as numeric of boolean channels. Channels are defined in the section [Channels] of the parameter file. However, some channels with fixed numbers are predefined and cannot be used for data transfer. Driver reserved channelsThe driver reserves channels with numbers from 1 to 99 for diagnostic and maintenance purposes. Never use channels with numbers lower than 100 in the data channels definition (in section [Channels]).
Automatic type conversionIt is necessary to create also the '*.DMF' file together with the parameter file to properly define channels for the Control Web application. The DMF file contains list od channels and their types — this definition enables syntax (proper channel numbers) and semantic (proper channel types and directions) checks during application compilation. The driver does not require strict type matching between parameter and DMF files. It is only recommended to assign boolean type to the bits, sbit or bool8 types. Another numeric types can be combined. For instance it is possible to define all numeric channels as real in the '*.DMF' file, while they are of type int16 in the PLC. Example of the automatic type conversion between real and int16 types Driver proceduresDriver proceduresThe application may call for the driver certain procedures using which it is possible to control the behavior of the driver or to gain important information. This is done by means of the system procedure: system.DriverQueryProc( DriverName : string; Param1 : any; &Param2 : any ) Parameters of the procedure have the following meaning:
DriverName and Param1 are typed as text strings. Param2 is of various type according to the meaning of the procedure. Some procedures serving for setting of parameters may finish in error. Overview and meaning of driver procedures (Param1 parameter)
Driver map file and data typesDMF file contains types and directions for individual channels. because the driver has a fixed set of maintenance channels and also a variable set of data channels, the DMF file should always contain part describing fixed set of channels and part describing actually defined data channels corresponding to channels defined in the [Channels] section in the parameter file.
Driver data types Driver exceptions and their handlingThe exception is raised when communication error appears. This exception can be handled by any virtual instrument within the application. The particular virtual instrument must define the driver_exception parameter with the driver symbolic name. In this case the instrument is activated when the exception appears. It is necessary to write the true value to the channel No. 2 or to invoke EnableException driver procedure. This enables generation of next exception (if any). It is possible to read channel No. 1 to obtain the exception state. Keep on mind the send_same_data parameter must be set to true if the instrument writes channel No. 2 (else the next write of the same value will be discarded). If the application does not handle exceptions, they are added to the queue. Maximal queue length is defined by the parameter MaxExceptions in the [Settings] section. Exception status codes
Error codesThe driver generates several error codes. The code of actual error can be read from the channel No. 6. Error code, together with the error description, can be also obtained by calling GetErrorCode and GetErrorString driver procedures. It the error condition occurs then an error message is also written to Log Window of the Control Web.
Example of driver usageThere are several examples of the driver usage in the package installation. These examples can be found in the 'EXAMPLES\S_MPI' directory. Examples also contain '*.DMF' and '*.PAR' files. It is necessary to modify these files according to actual device configuration. |