Specifications

42
© Systeme Lauer GmbHMODBUS 1-direct driver
C
C.2.2 Synchromous communication
If you want to use the entire functional extent of the PCS, then the access to the
data in the programmable controller must be synchronized, i.e. programmable
controller and PCS access alternately. Therefore, a synchronization word is
transferred to the programmable controller. The handling software examines this
word and enables the programmable controller user program access. If the user
program is finished with the processing of the data words, then the synchronization
word is changed and the PCS accesses the data area. While the PCS processes
the data, the user program may not access to the data. This Ping-Pong game
offers the possibility to realize a time-out monitoring also in the PCS. Whenever
the PCS reads the inverted synchronization word, the timer is restarted. If the timer
expires then a time-out exists.
Using this alternating access, actual and preset values can be mixed, bit varia-
bles used, erase behavior 2 realized, etc. Therefore, the whole intelligence of the
PCS is available. The disadvantage for you is that the reaction speed between
PCS and programmable controller is lowered. Furthermore, before accessing the
data the programmable controller program must always scan whether access is
allowed or not.
The time-out time, i.e. the time that passes since the last writing of word 3 up to
the time-out message in the programmable controller, should be set to a minimum
of 2 seconds. In the PCS, the time-out time is set via the AA driver variable or
COM_TIMEOUT.
C2.2.1 Procedure
To realize synchronous communication between the PCS and programmable
controller you must:
select the SYNC setting on the PCS,
load the handling software into the programmable controller.
This handling software is described in the following. Of course you can also solve
these tasks differently in your software. It is only important that you keep to the
following procedure:
1. The used data area assigned to the PCS and programmable controller must
be determined in the programmable controller (e.g. 255 flag words) and com-
municated to the PCS via the AL and AM driver variables. The programmable
controller flag word area should be initialized.
2. Thereupon, the PCS sends an order number (byte-by-byte, every time incre-
mented by one) in PCS word 3, e.g.: 01. This is the signal for the programmable
controller, that the data area can be processed. Furthermore, a time-out timer
can be restarted (if this is used).
3. If the processing of the data area is finished, then the inverted sync word of
PCS word 3 is copied to PCS word 2, e.g. with FE. This is the signal for the
PCS to access the data area. Nothing more may be changed now in the data
area by the programmable controller program!
From now on, step 2 and 3 will be cyclically executed. If a time-out appears,
then processing is resumed with step 2 with order number 01 again.
PLC handling software