PmS5PG - Driver for communication over PG port with Siemens Simatic S5 PLC devices

Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communication using the PROMOTIC drivers.
Basic properties of the driver:
- Using this driver is bound to purchase the license: PmS5PG. With the freeware version PmFree, or when developing the application (with development environment for tersting purposes), this component is always functional.
- The driver operates the subset of the AS511 protocol that is used by the SIMATIC devices of the S5 series.
- The communication is done via the computer's serial port (COM1, COM2 ...).
- The PROMOTIC application is the MASTER (i.e. it initiates the data transfer) from this communication point of view.
- This is a point-to-point communication type, i.e. one PmComm object can communicate only with one device (the protocol does not support multiple device adressing).
- The driver is incorporated into the PROMOTIC system by means of the PmComm object.

The driver supports to usage of PmCommMsg object. The PmCommData object cannot be used.

For easy integration of this driver into the application it is handy to use: Preconfigurations in group "Siemens Simatic PLC"

- The driver can read only data blocks, it cannot read markers and flags.
- The driver doesn't set automatically the data on the Data-sent and Data-received pages. The designer has to set these data by himself according to the description below.
Because the format of data stored in the Simatic devices is different for some data types (long, real number, time) than for computers of the PC type, it is necessary to transform values of these types. The driver itself doesn't do these transformations but for example the Pm.TransformValue method can be used for it after receiving data in the application.
Description and recommended values for the Protocol parameters:
Response receipt timeoutThe time (in milliseconds) the driver is waiting for the response on sending the message. If no response comes during this time, the transfer of the message is terminated (onEndOfTransfer event fires with error 24 or 66).
PLC typeit is possible to select "AG90,AG95,AG100" or "greater than AG100". Practically the correctness of the choice must be checked. There are some symptoms that for example for AG115 it is necessary to select the first option.
AG90, AG95, AG100
> AG100

The communication description by the PmCommMsg objects

The description of the messages:

It is supposed that all items of the Data-sent and Data-received pages have the range of 2 bytes, which means the Integer data type.

Reading the content of the data block (hereafter only DB):

1.item Data-sent contains a DB number from which it is read.

1.item Data-received contains the number of words in the read DB. Next items contain words of the read DB. A designer should ensure so the number of words in the DB equals to the number of items on the page (without the 1.item containing the number of words).

Writing selected words into the data block:

1.item Data-sent contains a DB number into which it has to be written. 2.item contains the number of words that are written. 3.item contains the index of the first written word. 4.item contains the first written word. 5 and 6.items contain the index and the value of the second written word, etc. If more words are configured on the page than they have to be written according to the 2.item, the 2.item makes the decision.

There is no varible on the Data-received page.

Starting cyclic read mode of selected words from the DB:

1.item Data-sent contains a DB number into which it has to be written. 2.item contains the number of words that are written. 3.item contains the index of the first written word. 4 item contains the index of the second written word, etc.

There is no varible on the Data-received page.

This message must be called always out of the cyclic read mode. Otherwise the communication can be halted.

Cyclic reading from the data block: Data-sent page is blank.

Data-received: 1.item contains the number of received words. 2.item contains the flag that the PLC runs (Run). 3.item contains the first received word (data). 4.item contains the second received word, etc.

This message should be started only in the cyclic reading mode.

Ending cyclic read mode: Both Data-sent and Data-received pages are blank.

Note: If a page contains an item specifying the number of words, this always means the number of words transferred from/into the data block on the page.

© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice