Professional Documents
Culture Documents
WARNING
Warning notices are used to emphasize that hazardous voltages,
currents, temperatures, or other conditions that could cause personal
injury exist or may be associated with use of a particular equipment.
In situations where inattention could cause either personal injury or
damage to equipment, a Warning notice is used.
Caution
Caution notices are used where there is a risk of damage to equipment
for example.
Note
This document is based on information available at the time of its publication. While efforts have been made to be accurate, the information
contained herein does not purport to cover all details or variations in hardware or software, nor to provide for every possible contingency in
connection with installation, operation, or maintenance. Features may be described herein which are not present in all systems. Cegelec
assumes no obligation of notice to holders of this document with respect to changes subsequently made.
Cegelec makes no representation or warranty, expressed, implied, or statutory with respect to, and assumes no responsibility for the
accuracy, completeness, sufficiency, or usefulness of the information contained herein. Cegelec gives no warranties of merchantability or
fitness for purpose shall apply.
In this publication, no mention is made of rights with respect to trademarks or tradenames that may attach to certain words or signs. The
absence of such mention, however, in no way implies there is no protection.
Partial reproduction of this document is authorized, but limited to internal use, for information only and for no commercial purpose.
However, such authorization is granted only on the express condition that any partial copy of the document bears a mention of its property,
including the copyright statement.
Page 2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Revisions
Index letter Date Nature of revision
b 09-97 Minor changes
c 04-98 Minor changes
d 09-98 Minor changes
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3
User’s Manual
Revisions
Page 4 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Preface
Chapter 1: General
Chapter 2: Operation of the MODBUS Exchange Unit (EU)
Chapter 3: Master EU Exchange Specifications
Chapter 4: MODBUS Transmission Frame
Chapter 5: Operation
Chapter 6: Details of RTU transmission frames
3. RELATED PUBLICATIONS
For more information, refer to this publication ALS 52402.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5
User’s Manual
Preface
Page 6 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Reader's comments
If you would like a personal reply, please fill in your name and address below:
COMPANY:...............................................................NAME:..................................................................................
ADDRESS:................................................................................................................................................................
....................................................................................COUNTRY: ..........................................................................
Send this form directly to your Cegelec sales representative or to this address:
Cegelec
Technical Documentation Department (TDD)
5, avenue Newton - B.P. 215
92142 CLAMART Cedex
France
Fax: +33 (0)1 46 29 12 44
REMARKS
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 7
User’s Manual
Reader's comments
Page 8 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Contents
CHAPTER 1 - GENERAL
1. PURPOSE AND USE OF THIS LINK ........................................................................................................ 1-1
2. REMINDER ON THE PROTOCOL............................................................................................................ 1-1
3. GENERAL SPECIFICATIONS OF THE NETWORK ............................................................................... 1-2
4. NETWORK CONFIGURATION ................................................................................................................ 1-3
CHAPTER 5 - OPERATION
1. CONFIGURING THE PROCESSING UNIT .............................................................................................. 5-1
1.1 Case of a PCM (IC693PCM301 : IC693PCM311 : IC697PCM701)................................................... 5-1
1.2 Case of an MBM (CF693MBM100: CF697MBM101).......................................................................... 5-1
1.3 Loading the PCM card (IC693PCM301 : IC693PCM311 : IC697PCM701)...................................... 5-1
2. IN THE PCOP DIRECTORY ...................................................................................................................... 5-3
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 9
User’s Manual
Contents
2.1 TERMSET command ............................................................................................................................. 5-3
2.2 TERMF command .................................................................................................................................. 5-3
2.2.1 MBPCM application program ........................................................................................................................5-4
2.2.2 Starting up the PC/PS EUs .............................................................................................................................5-4
2.3 Request for Transmission of Exchanges in the PC ............................................................................... 5-16
2.3.1 Use of Answers and Faults in the PC ...........................................................................................................5-28
2.3.2 Counting of Faults in the PS.........................................................................................................................5-33
Page 10 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Chapter General
A device in the range can be either master or slave. This protocol therefore means that links can be made between
a device in the range and any heterogeneous device supporting the MODBUS protocol.
Only the master can initiate a transaction. A transaction is either of the question-answer type (a single slave
selected) or the broadcast/no-answer type (all slaves selected). A transaction comprises a question frame and an
answer frame, or simply a broadcast frame.
Some characteristics of the protocol are fixed (frame format, sequences, error processing, functions performed),
while others can be configured by the user (transmission rate, parity, number of stop bits, number of bits of one
character (7 or 8), ASCII or RTU transmission mode). These parameters are defined on each station and cannot
be modified during operation.
Each message sent by the master contains an envelope (depending on the type of transmission) and data:
destination address, action to be executed, data associated with the action, error checking code. The station
concerned removes the envelope, checks the error code and, if there is no transmission error, executes the task
and generates an answer message with a format similar to that of the question. The answer is only transmitted if
the question was not broadcast.
The master can send a new message to any slave as soon as it has received a valid answer, or after a time-delay
indicating that there is no answer and a number of repetitions of the same message. The maximum answer time
allocated to the slave for performing a function and sending back an answer, plus the number of repetitions, are
specified in the configuration table.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 1-1
User’s Manual
General
Line access protocol: Question-answer mechanism between a master (PC) and a slave (PS).
The PC questions the PS whenever it so wishes. The PSs anwser the PC’s questions
after performing the work request.
Page 1-2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
General
4. NETWORK CONFIGURATION
Point-to-point
-------------
+--------+ +--------+
| | RS-485 or RS-232C | |
| PC +-------------------------+ PS |
| | | |
+--------+ +--------+
Multipoint
----------
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 1-3
User’s Manual
General
Page 1-4 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Chapter Operation of the MODBUS Exchange
Unit (EU)
2
• PCM 301 and PCM 311 of the Alspa C80-35 and PCM 711 of the Alspa C80-75, the MBPCM software can
be downloaded to the PCM with the TERMF terminal emulation program. For more information on the
PCMs, see document ALS 52402.
• Modbus Master/Slave Coprocessor Module, P/N CF693CMM100 combined with a IC693PCM300 OEM
module (generic) equipped with an MBP100 PROM.
• Modbus Master/Slave Coprocessor Module, P/N CF697MBM101, combined with IC697PCM711 OEM
module (generic) equipped with an MBP101 PROM.
1. PLC/EU INTERFACE
The interface between the PLC and the MODBUS EU is via four tables transferred with instruction COMMREQ.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 2-1
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
• Triggered: the EU sends the requests asked for by the PLC as a priority
• Periodic: the EU sends the requests periodically, the value of the period being defined in a field of the
exchange request structure (see exchange request table)
• Cyclic: the EU cyclically sends requests of lower priority than the other two types.
In the PLC program, these tables are prepared in the register memory type data block (%R) of the COMMREQ
command block and transferred separately, first to the configuration table for activation of the MODBUS Master
EU, and then the exchange requests table. Table transfer uses the COMMREQ function of communication
channel (TASK) number 120.
The exchange requests can be modified by a new transfer of the ER table while the MODBUS Master EU is in
service.
Page 2-2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
2. TRANSFER OF REQUESTS
The PLC program can send a request to the Master MODBUS EU with instruction COMMREQ, a request is
contained in the data block from 1 to 128 words long (256 bytes) of the PLC memory type (%I, %Q, %R, %AI,
%AQ).
The COMMREQ instruction comprises four input parameters and one or two output parameters (the PCM 80-75
has two) and its format is defined as follows:
+----------+
| COMMREQ |
(Enable) --+ +-- ( OK, PCM 80-75 only)
| |
?????? --+ IN FT +--
| |
?????? --+ SYSID |
| |
?????? --+ TASK |
| |
+----------+
IN input: designates the beginning of the command block comprising the COMMREQ
command and the data block. This can be any address in the PLC program, oriented
at word level (%R, %AI or %AQ in the COMMREQ request of Alspa 80-75 and
Alspa 80-35; %P or %L of the COMMREQ request of Alspa 80-75 only).
SYSID input: gives the target PCM address - the rack number (high-order byte) and its location - to
which the COMMREQ request is sent. It should be noted that PCM 80-35 should be
installed in rack 0.
TASK input: designates the communication channel between the PLC and the PCM, the channel
value should be between 4 and 120. We choose 120 as the communication channel
number between the PLC and PCM.
the OK and FT (fault) outputs check execution of the COMMREQ instruction and can take the following logic
states:
+----------+-----------------+-----------+-----------+
| Enable | Error ? | output OK | output FT |
+----------+-----------------+-----------+-----------+
| Active | No | True | False |
| Active | Yes | False | True |
| Inactive | No execution | False | False |
+----------+-----------------+-----------+-----------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 2-3
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
bit 15 0
+------------------------------------+
| Length of data block |
+------------------------------------+
| WAIT/NOWAIT |
+------------------------------------+
| Type of memory of state pointer |
+------------------------------------+
| Offset of state pointer |
+------------------------------------+
| ACK wait timer |
+------------------------------------+
| MAX communication timer |
+------------------------------------+
| |
| |
/ Data block /
| |
| |
+------------------------------------+
• Length of data block indicates the number of words in the data block. The length is limited to 128 words.
• Wait/Nowait: in Wait mode (1), the CPU waits for a reply from the target PCM before continuing running the
PLC program: in Nowait mode (0), the CPU continues to run the program after the message has been sent.
We recommend using the Nowait mode.
• Type of memory and state point offset specify the memory location of the PLC which contains the state word
that the PCM is to send at the end of the COMMREQ function . It should be noted that the Memory Type and
State pointer offset are not used for the Master and Slave MODBUS EUs.
• ACK wait timer, i.e. the maximum waiting time for an acknowledgement of receipt from the target PCM. This
is ignored in Nowait mode.
• MAX communication timer, the maximum wait time for the COMMREQ command block to be completely
read by the target PCM. It is ignored in Nowait mode.
• Data block containing a request table to be transferred to the MODBUS EU (target PCM).
Page 2-4 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
3. REQUEST TABLES
bit 15 8 7 0
+------------------------+------------------------+
| Comm_Chann | ID_Tab = 0 | word 0
+------------------------+------------------------+
+-------------+--------------+
| Comm_Chann | Serial port |
+-------------+--------------+
| 1 | Port 1 |
| 2 | Port 2 |
+-------------+--------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 2-5
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
Configuration table
PC configuration table:
bit 15 8 7 0
+------------------+------------------+
| Comm_Chann | ID_Tab = 1 | word 0
+------------------+------------------+
| EU service bits address | word 1
+-------------------------------------+
| Subscriber number | word 2
+-------------------------------------+
| DPE delay | 000 | G |RS|A| TC| word 3
+-------------------------------------+
| Turn-round timer (ms) | word 4
+-------------------------------------+
| Answer wait timer (ms) | word 5
+-------------------------------------+
|Authorized number of retranmsissions | word 6
+-------------------------------------+
| CR zone address | word 7
+-------------------------------------+
| Periodic time base (ms) | word 8
+-------------------------------------+
PS configuration table:
bit 15 8 7 0
+------------------+------------------+
| Comm_Chann | ID_Tab = 2 | word 0
+------------------+------------------+
| EU service bits address | word 1
+-------------------------------------+
| Subscriber number | word 2
+-------------------------------------+
| DPE delay | 000 | G |RS|A| TC| word 3
+-------------------------------------+
| Turn-round timer (ms) | word 4
+-------------------------------------+
| Fault indicator address | word 5
+-------------------------------------+
| Fault bits address | word 6
+-------------------------------------+
| 1 character transmission | word 7
| timer |
+-------------------------------------+
The G and DPE delay parameters are managed from version 1.5 onwards.
The A and RS parameters are optional and managed from version 1.6 onwards.
Page 2-6 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
+-------------+--------------+
| Comm_chann | Serial port |
+-------------+--------------+
| 1 | Port 1 |
| 2 | Port 2 |
+-------------+--------------+
• COMMREQ answer address is a logical address of the register memory type ( %R ). It is the address to which
the PCM returns an answer to the COMMREQ command in the PLC program. This is a positive (ACK) or
negative (NACK) acknowledgement, with active or inactive EU status.
Meaning of service bits:
bit0 : ACK (acknowledged by the EU)
bit1 : NACK (not acknowledged by the EU)
bit2 : EU in service
bit3 : EU out of service
bit4 : Intentional EU withdrawal (1)
bit5 : not used
bit6 : not used
bit7 : not used
bit8 : Triggered ER list saturated (2)
bit9 : Periodic ER list saturated (2)
bit10 : Cyclic ER list saturated (2)
bit11 : Rejection of current exchange request (2)
bit12 : Triggered ER list empty (2)
bit13 : Periodic ER list empty (2)
bit14 : Cyclic ER list empty (2)
bit15 : not used
(1) : software fault in EU which goes inactive and signals bit4 = 1.
(2) : these bits are used for the Master EU.
• RS (bit2-bit3/ word 3): redefinition of port RS485 link for MBM100 (or MBM101) configured in PROG
PRT mode.
RS = 0: no action,
= 1: RS485 2-wire multipoint link without flow control,
= 2: RS485 4-wire multipoint link without flow control,
= 3: RS485 4-wire point to point link,
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 2-7
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
• DPE delay (bit 8 to bit 15) : delay on feedback of DPE signal (RTS) at end of transmission in case of use with
a modem. Maximum delay = 255 expressed in milliseconds. It is ignored if no signal management
(G = 1).
• Turn-round timer is a time-out (ms) for matching between PC (master) and PS (slave). It ensures a minimum
interval between two frames on the medium, which enables a “slow” PC or PS subscriber to turn-round from
transmission to reception before the following frame arrives.
• The fault indicator address is a logical address of the register memory type (%R); the indicator is set to FF by
MODBUS Slave EU to signal a fault to be read in the fault address. It should be set to 00 after the fault has
been processed.
• Character transmission timer (Tcar) rejects the frames intended for the other subscribers. It also determines
the time necessary for receiving a question frame asked by the MODBUS Master EU. Tcar is equal to a
minimum of 0.5 milliseconds (Tcar = 0).
example:
+-----------+-----+-----+-----+-----+-----+-----+-----+-----+
|Rate |38400|19200| 9600| 4800| 2400| 1200| 600 | 300 |
+-----------+-----+-----+-----+-----+-----+-----+-----+-----+
|Tchar/RTU | 0 | 1 | 2 | 3 | 5 | 10 | 20 | 40 |
+-----------+-----+-----+-----+-----+-----+-----+-----+-----+
|Tchar/ASCII| 1 | 2 | 3 | 5 | 10 | 20 | 40 | 80 |
+-----------+-----+-----+-----+-----+-----+-----+-----+-----+
• Fault bits address is a logical address of the register memory type (%R); the bits are only significant if the
fault indicator is set to FF.
Meaning of fault bits:
bit0 : function code incorrect in frame received
bit1 : address field incorrect in frame received
bit2 : data field incorrect in frame received
bit3 : reception fault (parity, stop bit, etc. error)
bit4 : CTS fault
bit5 : CRC(RTU) or LRC(ASCII) error
bit6 : non-ASCII character in frame received (ASCII mode only)
bit7 : ASCII frame no termination CR(0DH) and LF(0AH)
bit8 : incorrect frame length
bit9 : not used
bit10 : not used
bit11 : not used
bit12 : not used
bit13 : not used
Page 2-8 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
• Timer (ms) waiting for reply from a PS receiving an exchange request. This is started at the end of
transmission of a question frame.
• Number (0 - 3) for message re-transmission, not broadcast, without reply or with physically incorrect reply.
• Address of report zone is a logical address of the register memory type (%R). It is a state and faults zone for
the exchange requests, updated by the MODBUS Master EU before, during and after the exchange.
Each report word is associated with a ER number ( ERxx ) which is defined in the structure of a ER (see
exchange requests table) and used to determine the type of exchange:
bit 15 4 3 0
+----------------------------------------++--------------+
| faults || state |
+----------------------------------------++--------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 2-9
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
2. ER fault bits:
bit4 : reception fault (parity, stop bit, etc. error)
bit5 : CTS fault
bit6 : CRC(RTU) or LRC(ASCII) error
bit7 : non-ASCII Character in received frame (ASCII mode only)
bit8 : no answer to the question after answer wait time-out; this time-out is in the configuration table
bit9 : expected function code incorrect
bit10 : expected data length incorrect
bit11 : question function code or data incorrect
bit12 : no correct reply after planned number of retransmissions
bit13 : rejection of a ER by PS, reception of 1 negative answer frame (exception frame)
bit14 : rejection of a ER by PC, exchange in progress
bit15 : rejection of a ER by PC, ER list saturated
• Periodic time base is the unit value of the periodic type exchange period; at least or by default it is equal to
200 milliseconds.
bit 15 8 7 0
+------------------+------------------+
| Comm_Chann | ID_Tab = 3 | word 0
+------------------+------------------+
| Number of DEs | word 1
+-------------------------------------+
| | word 2
| |
| DE block |
| |
| | word n
+------------------+------------------+
n = (7 x Number of DEs) + 1
Page 2-10 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
bit 15 8 7 0
+------------------+------------------+
|DV| period | DE number | word 0
+------------------+------------------+
| PS address | Function code | word 1
+------------------+------------------+
| MODBUS address / Sub_function code | word 2
+-------------------------------------+
| Number / Variable value | word 3
+-------------------------------------+
| Memory type | word 4
+-------------------------------------+
| Memory type address | word 5
+-------------------------------------+
| Reply address in PC | word 6
+-------------------------------------+
• ER (bit 0 - bit 7) Number (exchange request) is between 0 (ER0) and 255 (ER255).
The triggered exchange requests are numbered from 0 (ER00) to 63 (ER63) and have the highest priority. The
periodic exchange requests are numbered from 64 (ER64) to 127 (ER127).
The cyclic exchange requests are numbered from 128 (ER128) to 255 (ER255) and have lower priority than
the other two.
• period (bit 8 - bit 14): number of the periodic value unit, this unit is defined in the periodic time base field of
the configuration table.
• PS subscriber address (bit 0 - bit 7), this is the address of a PS on the network. The PSs are numbered from 1
to 255, with address 0 meaning that the message is broadcast.
• MODBUS address or sub-function code. This is the first word of the data field, not used for certain functions.
• Number or value of variable, this is the second word of the data field, not used for certain functions.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 2-11
User’s Manual
Operation of the MODBUS Exchange Unit (EU)
• Answer address in PC is a logic address of the register memory type (%R). It is the address at which a PS
answer is stored.
(1) : only valid for function code 15.
(2) : only valid for function code 16.
Page 2-12 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Chapter Master EU Exchange Specifications
Each exchange consists of an exchange request ER (question) and an associated answer, but a broadcast ER has
no answer.
Broadcasting is not authorised for all types of Function codes and is impossible if the network consists of
heterogeneous subscribers.
A ER is simply a question sent by the Master subscriber to one or more Slave subscribers. The Slave subscriber
receives an error-free question frame intended for it, executes the job requested and sends an answer frame.
The content of the answer depends on the content of the ER and varies from 2 to 130 words (4 to 260 bytes).
The ERs only concern the Master EU and the ERs are loaded by the COMMREQ instruction. It should be
remembered that the number of ERs is limited to 18 in the exchange request table. Each ER is associated with a
report word whose address is defined in the configuration table and which is used to fill out the exchange state
and faults. When the exchange ends without fault, the answer is stored in the application memory at the address
defined in a field - Answer address in PC - of the ER structure (see page 3-2).
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-1
User’s Manual
Master EU Exchange Specifications
Start address of the variable is a MODBUS compatible address in the PS PLC questioned, Sub-function code is a
sub-code of diagnostic and maintenance Function 8.
+---------------+----------------------------------------------+
| Function code | Function |
+---------------+----------------------------------------------+
| 1 and 2 | read request for n bits |
+---------------+----------------------------------------------+
| 3 and 4 | read request for n words |
+---------------+----------------------------------------------+
| 5 | writing a bit at a value |
+---------------+----------------------------------------------+
| 6 | writing a word at a value |
+---------------+----------------------------------------------+
| 7 | asynchronous reading of a particular byte |
+---------------+----------------------------------------------+
| 8 | diagnostic and maintenance function |
| | specified by the function sub-code |
+---------------+----------------------------------------------+
| 15 (0FH) | write n bits |
+---------------+----------------------------------------------+
| 16 (10H) | write n words |
+---------------+----------------------------------------------+
| 17 (11H) | send back equipment type |
+---------------+----------------------------------------------+
| 32 (20H) | read or clear table of state changes |
| | for a PS |
+---------------+----------------------------------------------+
| 67 (43H) | read memory of working zone |
+---------------+----------------------------------------------+
Page 3-2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
For the Alspa 8000 PLCs using the RTU protocol and MODBUS Slave EU PCM, the meaning of the sub-codes
is as follows (see document ALS 52506).
+---------------+------------------------------------------------+
| Sub-code | Sub-function of function 8 |
+---------------+------------------------------------------------+
| 0 | return query data |
+---------------+------------------------------------------------+
| 1 | trigger restart of communications |
+---------------+------------------------------------------------+
| 4 | force reception mode only |
+---------------+------------------------------------------------+
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| Function code | PS address |
+-+---------------+-------------------+
word 1 | | |
+-------------------------------------+ | see details for
word 2 | | | each Function code
+-------------------------------------+ | below
: : |
+-------------------------------------+ |
word n | | |
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-3
User’s Manual
Master EU Exchange Specifications
• Content of a negative answer from the slave which did not execute the order, bit 15 of word 0 is set to 1.
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |1| Function code | PS address |
+-+---------------+-------------------+
word 1 | 00 | error code |
+-----------------+-------------------+
+---------------+---------------------------------------------+
| Error code | Meaning |
+---------------+---------------------------------------------+
| 1 | Function code incorrect |
+---------------+---------------------------------------------+
| 2 | start address of variable incorrect |
+---------------+---------------------------------------------+
| 3 | data incorrect |
+---------------+---------------------------------------------+
| 4 | PLC not ready |
+---------------+---------------------------------------------+
• either error-free exchange, bit 1 of the associated report word is at 1 and the fault bits are at 0,
• or exchange with fault, bit 2 of the associated report word is at 1 and at least one fault bit is set to 1,
Page 3-4 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | See ER Table
+--+---------------+------------------+
word 1 | F.C. = 1 or 2 | PS Address |
+------------------+------------------+
word 2 | Address of first bit to be read | MODBUS encoded address
+-------------------------------------+
word 3 | Number of bits to be read | from 1 to 2048 bits
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
For C80-35 and C80-75 PLCs, Function code (F.C.) 1 means reading of n bits of a table of:
• Logical outputs %Q, MODBUS encoded address of beginning of table is equal to 0 (%Q0001),
• Memorised Internal Bits %M, MODBUS encoded address of beginning of table is equal to 20000 (%M0001),
• Temporary Internal Bits %T, MODBUS encoded address of beginning of table is equal to 40000 (%T0001),
and Function code 2 for reading of n bits of a logical inputs table %I, MODBUS encoded address of beginning of
table is equal to 0 ( %I0001 ).
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 1 or 2 | PS Address |
+-+---------------+-------------------+
word 1 | Number of significant bytes | from 1 to 256 bytes
| below |
+-------------------------------------
word 2 | Value of first bits | | depends on the number
| 16th bit 1st bit| | | of bytes defined by
+-------------------------------------+ | word 2
word 3 | 17th bit | | nbr bytes ) nbr bits/8
+-------------------------------------+ | (rounded off to next
: : | higher value)
+-------------------------------------+ |
word n | | |
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-5
User’s Manual
Master EU Exchange Specifications
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | See ER Table
+--+---------------+------------------+
word 1 | F.C. = 3 or 4 | PS Address |
+------------------+------------------+
word 2 | Address of first word to be read | MODBUS encoded address
+-------------------------------------+
word 3 | Number of words to be read | of 1 to 128 words
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
For C80-35 and C80-75 PLCs, Function code (F.C.) 3 means reading of n words of a table of registers of
reference %R, Function code 4 reading of n words of a table of analogue inputs of reference %AI, and the
address of the first word to be read is equal to the number of the first register (F.C. = 3) or the first analogue
input (F.C. = 4) sent back in the normal answer minus 1.
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 3 or 4 | PS Address |
+-+---------------+-------------------+
word 1 | Number of significant bytes | from 1 to 256 bytes
| below |
+-------------------------------------+
word 2 | Value of the first word | | depends on number
+-------------------------------------+ | of bytes defined by
word 3 | Value of the second word | | word 2
+-------------------------------------+ | nbr bytes = nbr words*2
: : |
+-------------------------------------+ |
word n | Value of the last word | |
+-------------------------------------+
Page 3-6 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | See ER Table
+--+---------------+------------------+
word 1 | F.C. = 5 | PS Address |
+------------------+------------------+
word 2 | Address of bit to write | MODBUS encoded address
+-------------------------------------+
word 3 | Value of bit to write | 1 = FF00H, 0 = 0000H
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
For C80-35 and C80-75 PLCs, Function code 5 means writing of a single output:
• output reference %Q, MODBUS encoded address of beginning of table (%Q0001) equal to 0,
• memorised internal bit %M, MODBUS encoded address of beginning of table (%M0001) equal to 20000.
• temporary internal bit %T, MODBUS encoded address of beginning of table (%T0001) equal to 40000.
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 5 | PS Address |
+-+---------------+-------------------+
word 1 | Address of bit written |
+-------------------------------------+
word 2 | Value of bit written | FF00H or 0000H
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-7
User’s Manual
Master EU Exchange Specifications
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | see ER Table
+--+---------------+------------------+
word 1 | F.C. = 6 | PS Address |
+------------------+------------------+
word 2 | Address of word to write | MODBUS encoded address
+-------------------------------------+
word 3 | Value of word to write |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
For C80-35 and C80-75 PLCs, Function code 6 means writing of a single register of reference %R, and the
address of the word to be written is equal to the number of the register to be written minus 1.
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 6 | PS Address |
+-+---------------+-------------------+
word 1 | Address of written word |
+-------------------------------------+
word 2 | Value of written word |
+-------------------------------------+
Page 3-8 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
+--+---------------+------------------+
+------------------+------------------+
+-------------------------------------+
+-------------------------------------+
+-------------------------------------+
+-------------------------------------+
+-------------------------------------+
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 7 | PS Address |
+-+---------------+-------------------+
word 1 | Not significant | Value of byte |
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-9
User’s Manual
Master EU Exchange Specifications
bit 15 8 7 0
+------------------+------------------+
word 0 |DV| period | ER number | see ER Table
+--+---------------+------------------+
word 1 | F.C. = 8 | PS Address |
+------------------+------------------+
word 2 | 00 |Function sub-code |
+------------------+------------------+
word 3 | 0000 |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 8 | PS Address |
+-+---------------+-------------------+
word 1 | 00 | Function sub-code |
+-----------------+-------------------+
word 2 | Value of counter requested |
+-------------------------------------+
FORMAT:
Data Data
Question
Data Data
Normal answer
Page 3-10 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
QUESTION:
• The diagnostic code takes up two bytes. The high-order byte of the diagnostic code is the first byte sent to
the Diagnostic code field. The low-order byte is the second byte sent. The Looping/Maintenance command is
only defined for diagnostic codes 0, 1 or 4. All other diagnostic codes are reserved.
• The data fields take up two bytes. The content of the two data bytes is a function of the value of the
diagnostic code.
ANSWER:
• A looping/maintenance question with diagnostic code 0 is a request for question data to be returned.
• The values of the two bytes in the data field are arbitrary.
• The values of the data bytes in the answer are identical to those sent in the question.
A looping/maintenance request (question or broadcast type request) with diagnostic code 1 is a Trigger restart of
communications request.
• Address 0 indicates a broadcast request. All slave stations process broadcast requests but do not return an
answer.
• This request deactivates Reception only mode (it allows the slave stations to send answers when the questions
are received in order to restart communications).
• The value of the first byte of the data field (DATA1) must be 0 or FF. Any other value will generate an error
answer. The value of the second byte of the data field (DATA2) is always 0.
• The normal answer to a Trigger restart of communications request is identical to the question.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-11
User’s Manual
Master EU Exchange Specifications
A looping/maintenance request (question or broadcast type request) with diagnostic code 4 is a Force Reception
only mode request.
• Address 0 indicates a broadcast request. All slave stations process broadcast requests.
• When a Force Reception only mode request is received, the RTU equipment is set to Reception only mode,
does not run the functions requested, and does not send any answer (normal or error) to the questions. The
Reception only mode is deactivated when the RTU equipment receives a Trigger restart of communications
request or when the equipment is restarted.
• The two bytes of the data field of a Force Reception only mode request are set at 0. The RTU equipment
never answers a Force Reception only mode request.
Note
When the RTU equipment is restarted, it deactivates the Reception only mode and can again answer questions.
Page 3-12 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | see ER Table
+--+---------------+------------------+
word 1 | F.C. = 15 | PS Address |
+------------------+------------------+
word 2 | Address of first bit to write | MODBUS encoded address
+-------------------------------------+
word 3 | Number of bits to write | 1 to 800 bits
+-------------------------------------+
word 4 | Type of memory | | sampling
+-------------------------------------+ | address in
word 5 | Address of type of memory | | the PC
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
For C80-35 and C80-75 PLCs, Function code 15 means writing of several:
• outputs of reference %Q, MODBUS encoded address of beginning of table (%Q0001) equal to 0,
• memorised internal bits %M, MODBUS encoded address of beginning of table (%M0001) equal to 20000,
• temporary internal bits %T, MODBUS encoded address of beginning of table (%T0001) equal to 40000.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-13
User’s Manual
Master EU Exchange Specifications
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 15 | PS Address |
+-+---------------+-------------------+
word 1 | Address of first bit written |
+-------------------------------------+
word 2 | Number of bits written |
+-------------------------------------+
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | see ER Table
+--+---------------+------------------+
word 1 | F.C. = 16 | PS Address |
+------------------+------------------+
word 2 | Address of first word to write | MODBUS encoded address
+-------------------------------------+
word 3 | Number of words to write | 1 to 100 words
+-------------------------------------+
word 4 | Type of memory | | sampling
+-------------------------------------+ | address
word 5 | Address of type of memory | | in the PC
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
Page 3-14 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
For C80-35 and C80-75 PLCs, Function code 16 means writing of several registers of reference %R, and the
address of the first word to be written is equal to the number of the first register to be written minus 1.
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 16 | PS Address |
+-+---------------+-------------------+
word 1 | Address of first word written |
+-------------------------------------+
word 2 | Number of words written |
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-15
User’s Manual
Master EU Exchange Specifications
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | see ER Table
+--+---------------+------------------+
word 1 | F.C. = 17 | PS Address |
+------------------+------------------+
word 2 | xxxx (not used) |
+-------------------------------------+
word 3 | xxxx (not used) |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
bit 15 8 7 0
+-+---------------+-------------------+
word 0 |0| F.C. = 17 | PS Address |
+-+---------------+-------------------+
word 1 | Number of bytes = 5 |
+-----------------+-------------------+
word 2 | PS RUN LED | Device Type |
+-----------------+-------------------+
word 3 | Pm data | PF data | PF : high order
+-----------------+-------------------+ Pm : middle order
word 4 | Not significant | Pf data | Pf : low order
+-----------------+-------------------+
The values of the various fields are defined in document ALS 52506.
Note
For the PCM MODBUS Slave EU the PS RUN LED is not significant.
Page 3-16 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
Composition of the ER
bit 15 8 7 0
+--+---------------+------------------+
word 0 |DV| period | ER number | see ER Table
+--+---------------+------------------+
word 1 | F.C. = 67 | PS Address |
+------------------+------------------+
word 2 | Start byte number ( i ) |
+-------------------------------------+
word 3 | Number of bytes to read |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer address in PC |
+-------------------------------------+
bit 15 8 7 0
+-+----------------+------------------+
word 0 |0| F.C. = 67 | PS Address |
+-+----------------+------------------+
word 1 | Nbr of bytes in data field |
+------------------+------------------+
word 2 | byte i+1 | byte i |
+------------------+------------------+
word 3 | byte i+3 | byte i+2 |
+------------------+------------------+
: | :
: Data :
: | :
+------------------+------------------+
word n | | |
+------------------+------------------+
Byte i, the first byte in the data field, corresponds to the byte number of the working zone memory. The values of
the different fields are defined in document ALS 52506.
Note
For the PCM MODBUS Slave EU, the non-significant byte numbers in the
working zone memory are as follows:
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-17
User’s Manual
Master EU Exchange Specifications
The working zone is entirely updated each time the RTU receives an external READ request. All working zone
addresses are read only. The working zone is a byte-oriented memory.
Page 3-18 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Master EU Exchange Specifications
Size returned
Bytes Length of memory in
18-1B %R Register memory Words
1C-1F %AI Analog input table Words
20-23 %AQ Analog output table Words
24-27 %I Input table Points (Bits)
28-2B %Q Output table Points (Bits)
2C-2F %M Internal logic memory Points (Bits)
30-33 User Program Code Bytes
Note
The hexadecimal length of each memory type is encoded in four bytes whose
high-order word is reserved for future use. For example, the default size of
1024 words (0400h) in the memory of the 731 registers would be returned in
the following format:
Word Low order High order
SP byte 18 19 1A 1B
contains 00 04 00 00
4 Program memory area occupied by program. Also displayed in Memory used screen by Alspa P8 API in User Prog field.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 3-19
User’s Manual
Master EU Exchange Specifications
Page 3-20 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Chapter MODBUS Transmission Frame
1. FIELDS
The MODBUS frame consists of four fields with the following format:
+---------+----------+------ - - - ----+------------+
| Address | Function | Data | Control |
+---------+----------+------ - - - ----+----------+
Address 0 means broadcast, the PSs (slave) will be numbered from 1 to 255.
The PC (master) has no address. Each slave having a unique address, only that concerned answers the question
containing its address. The answer message contains the slave address, which enables checking by the master.
After a broadcast message, all the slaves on the network perform the job requested, but there is no answer.
• Function field:
This indicates what job is to be done and how to interpret the data. It can also be used to determine the message
length. The MSB of this field is set to 1 when a slave sends back an exception answer (negative) and to 0 for all
normal questions or answers.
• Control field:
If frame coding is in RTU mode, then CRC-16 (Cyclic Redundancy Check) is used, whose generator polynomial
is equal to 2^16 + 2^15 + 2^12 + 1. If frame coding is in ASCII mode, then LRC8 (Longitudinal Redundancy Check
on 8 bits) is used.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 4-1
User’s Manual
MODBUS Transmission Frame
The beginning of frame is specified by the “:” character. The end of frame is specified by the CR and LF
characters (CR = carriage return, LF = line feed).
Page 4-2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Chapter Operation
A : yinstall
The file PCMEXEC.BAT allows you to launch the MODBUS software at each power-up or at each «Soft-Reset»
of the card.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-1
User’s Manual
Operation
To set serial port 2 <COM2:> to <19200> baud, without parity<N> (even parity <E> and odd parity <O>), <8>
data bits, <1> stop bit, no flow control <N> (hardware flow control RTS/CTS <H>) and use the point-to-point 4
wire network RS485 <485> configuration junction <P> (2-wire half-duplex multipoint <2>, 4-wire full-duplex
multipoint <4>, configuration ignored if RS232) :
I<sp>COM2:<sp>19200,N,8,1,N,485,P
<sp> = a space; follow the syntax.
Note
We advise against using [option /B] in background mode, because if the task
and PCM commands interpreter use the common serial port (for example
COM1:), the interpreter remains active and is liable to interfere with the task.
Page 5-2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
The exclamation points are not displayed on your monitor. Then enter a question mark: you enter
INTERACTIVE3 mode. Type the command L and confirm. The software asks you for FILE NAME/3. Enter the
path where your MODBUS software reference MBPCMV11 is located.
Example: PC :A :yMBPCMVXX.EXE.XX corresponding to the version number. Type the same command to
load files PCMEXEC.BAT and HARDEXEC.BAT. Now, to quit the executable TERMF, type the command
ALT-Z. To initialize the PCM card, you must now do a Soft-Reset by holding down the button on the front for at
least five seconds.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-3
User’s Manual
Operation
At power-up, the EU waits for the configuration table transferred by communication channel (TASK) number
120 using the COMMREQ function. If the configurable table is accepted, the EU sends an ACK answer with an
EU in service bit to the address of the EU service bits defined in this table, otherwise it does not answer.
Page 5-4 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
Master MODBUS:
bit 15 8 7 0
+------------------+------------------+
| Comm_Chann | ID_Tab = 1 | word 0
+------------------+------------------+
| Address of EU service bits | word 1
+-------------------------------------+
| Subscriber number = 0000 | word 2
+-------------------------------------+
| DPE delay | 000 | G | 000 | TC | word 3*
+-------------------------------------+
| Turn-round timer (ms) | word 4
+-------------------------------------+
| Answer wait timer (ms) | word 5
+-------------------------------------+
|Authorized number of retransmissions | word 6
+-------------------------------------+
| CR zone address | word 7
+-------------------------------------+
| Periodic time base (ms) | word 8
+-------------------------------------+
Example:
We wish to start up the MODBUS Master EU 6 seconds after starting up the C80-35 PLC, with the following
configuration table:
• G (bit 4) = 1
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-5
User’s Manual
Operation
* From version 1.5 onwards, the EU manages DPE delay (see page 2-6).
Page 5-6 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
Slave MODBUS:
bit 15 8 7 0
+------------------+------------------+
| Comm_Chann= 02H | ID_Tab = 02H | word 0
+------------------+------------------+
| Address of EU service bits | word 1
+-------------------------------------+
| Subscriber number = 0014H | word 2
+-------------------------------------+
| DPE delay | 000 | G | 000 | TC | word 3*
+-------------------------------------+
| Turn-round timer (ms) | word 4
+-------------------------------------+
| Fault indicator address | word 5
+-------------------------------------+
| Fault bits address | word 6
+-------------------------------------+
| Timer for transmission of | word 7
| 1 character |
+-------------------------------------+
Example:
We wish to start up the MODBUS Slave EU 6 seconds after starting up the 80-35 PLC, with the following
configuration table:
• G (bit 4) = 1
CAUTION
If hardware flow control is active via either the I command (equipment
initialization) or the P8 configuration, the DPE signal drops immediately at
end of transmission.
It is impossible to manage the DPE delay.
* From version 1.5 onwards, the EU manages DPE delay (see page 2-6).
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-7
User’s Manual
Operation
Page 5-8 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Initialise register %R0191 ( service bits ) to zero *)
|(**********************************************************************)
|
|
|FST_SCN +-----+ %T0001
+--] [---+MOVE_+-----------------------------------------------------(R)--
| | INT |
| | |
| CONST -+IN Q+-%R0191
| +00000 | LEN |
| |00001|
| +-----+
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Prepare the configuration table in the COMMREQ data block *)
|(* whose command block begins at address %R0001 *)
|(* and data block at address %R0007. *)
|(**********************************************************************)
|
|
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-9
User’s Manual
Operation
Page 5-10 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Set the timer to at least 6 seconds for activation of the *)
|(* MODBUS Master EU. *)
|(**********************************************************************)
|
|
|%T0001 +-----+ %T0001
+--]/[---+ TMR +-----------------------------------------------------(S)--
| |0.01s|
| | |
| CONST -+PV |
| +00060 | |
| +-----+
| %R0171
|
|
|%T0001 %M0001
+--] [---------------------------------------------------------------(^)--
|
|
|%M0001 %M0002
+--] [---------------------------------------------------------------(SM)-
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Transfer the COMMREQ command block on channel number 120 to the *)
|(* MODBUS Master PCM/EU configured in rack 0, slot 2 *)
|(**********************************************************************)
|
|
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-11
User’s Manual
Operation
Page 5-12 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Initialise the registers at zero *)
|(* - %R0192: the service bits *)
|(* - %R0193: the fault indicator *)
|(* - %R0194: the fault bits *)
|(* - %R0195: the fault counter *)
|(**********************************************************************)
|
|
|FST_SCN +-----+ %T0002
+--] [---+MOVE_+-----------------------------------------------------(R)--
| | INT |
| | |
| CONST -+IN Q+-%R0192
| +00000 | LEN |
| |00004|
| +-----+
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Prepare the configuration table in the COMMREQ data block *)
|(* whose command block begins at address %R0021 *)
|(* and the data block at address %R0027. *)
|(**********************************************************************)
|
|
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-13
User’s Manual
Operation
Page 5-14 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Set the timer to at least 6 seconds for activation of the *)
|(* MODBUS Master EU. *)
|(**********************************************************************)
|
|
|%T0002 +-----+ %T0002
+--]/[---+ TMR +-----------------------------------------------------(S)--
| |0.01s|
| | |
| CONST -+PV |
| +00060 | |
| +-----+
| %R0174
|
|
|
|%T0002 %M0003
+--] [---------------------------------------------------------------(^)--
|
|
|%M0003 %M0004
+--] [---------------------------------------------------------------(SM)-
|
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-15
User’s Manual
Operation
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Transfer the COMMREQ command block on channel number 120 to the *)
|(* MODBUS Slave PCM/EU configured in rack 0, slot 2 *)
|(**********************************************************************)
|
|
|%M0004 %T0002 +-----+
+--] [-----] [---+ EQ_ |
| | INT |
| | | +-----+
| %R0192 -+I1 Q+----------+COMM_|
| | | | REQ |
| | | | |
Page 5-16 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
The EU sends an answer back to the EU service bits address (e.g.: %R0191). If the ER table is acknowledged,
the answer is positive, (ACK), otherwise it is negative (NACK); in both cases, the answer is accompanied by an
EU in service bit.
If the answer is positive, the bits of all the valid exchange request report words (DV = 1) are set
• or to 0000100000000000,
• or to 0100000000000000,
• or to 1000000000000000,
bit3 : ER validity
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-17
User’s Manual
Operation
Example: 10 seconds after activation of the PLC and 6 seconds after activation of the MODBUS Master EU,
we want the following exchanges:
Reading of 50 (0032H) bits of an input table %I0011 of subscriber 20, of PLC ALSPA 8000, the request type is
cyclic and the answer is stored at address %R0501 (01F5H).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 00H | ER_No = 82H |
+--+---------------+------------------+
word 1 | F.C. = 02H | PS Addr = 14H |
+------------------+------------------+
word 2 | Addr. 1st bit to read = 000AH |
+-------------------------------------+
word 3 | Nbr of bits to read = 0032H |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer addr. in PC = 01F5H |
+-------------------------------------+
The report word corresponding to this ER number 130 (82H) is register %R0331.
Page 5-18 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
Writing of 50 (0032H) output bits at %Q0011 of subscriber 20, of PLC Alspa 8000, the sampling address = 0011
for variable type %I (%I0011), the request type is cyclic and the answer is stored at address %R0631 (0277H).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 00H | ER_No = 83H |
+--+---------------+------------------+
word 1 | F.C. = 0FH | PS Addr.= 14H |
+------------------+------------------+
word 2 | Addr. 1st bit to write = 000AH |
+-------------------------------------+
word 3 | Nbr of bits to write = 0032H |
+-------------------------------------+
word 4 | Type of variable = 0010H |
+-------------------------------------+
word 5 | Addr. 1st bit to sample = 000BH |
+-------------------------------------+
word 6 | Answer addr. in PC = 0277H |
+-------------------------------------+
The report word corresponding to this ER number 131 (83H) is register %R0332.
Reading of 50 (0032H) words of a table of analogue inputs %AI0001 of subscriber 20, of PLC ALSPA 8000, the
request type is cyclic and the answer is stored at address %R0701 (02BDH).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 00H | ER_No = 84H |
+--+---------------+------------------+
word 1 | F.C. = 04H | PS Addr.= 14H |
+------------------+------------------+
word 2 | Addr. 1st word to read = 0000H |
+-------------------------------------+
word 3 | Nbr words to read = 0032H |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer addr. in PC = 02BDH |
+-------------------------------------+
The report word corresponding to this ER number 132 (84H) is register %R0333.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-19
User’s Manual
Operation
Writing of 100 (0064H) words of register %R1001 of subscriber 20, of PLC Alspa 8000, the sampling address =
0703 of variable type %R (%R0703), the request type is cyclic and the answer is stored at address %R0691
(02B3H).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 00H | ER_No = 85H |
+--+---------------+------------------+
word 1 | F.C. = 10H | PS Addr. = 14H |
+------------------+------------------+
word 2 | Addr. 1st word to write = 03E8H |
+-------------------------------------+
word 3 | Nbr. of words to write = 0064H |
+-------------------------------------+
word 4 | Type of variable = 0008H |
+-------------------------------------+
word 5 | Addr. 1st word to sample = 02BFH |
+-------------------------------------+
word 6 | Answer addr. in PC = 02B3H |
+-------------------------------------+
The report word corresponding to this ER number 133 (85H) is register %R0334.
Forcing to 1 of output %Q0010 of subscriber 20, of PLC ALSPA 8000, the request type is periodic every 2
seconds (period = 04H, 4 times 500 ms), and the answer is stored at address %R0651 (028BH).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 04H | ER_No = 40H |
+--+---------------+------------------+
word 1 | F.C. = 05H | PS Addr. = 14H |
+------------------+------------------+
word 2 | Addr. of bit to write = 0009H |
+-------------------------------------+
word 3 | Value of bit to write = FF00H |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer addr. in PC = 028BH |
+-------------------------------------+
The report word corresponding to this ER number 64 (40H) is register %R0265.
Page 5-20 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
Writing of register %R1001 of subscriber 20, of PLC ALSPA 8000, the request type is periodic every 2 seconds
(period = 04H, 4 times 500 ms), and the answer is stored at address %R0661 (0295H).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 04H | ER_No = 41H |
+--+---------------+------------------+
word 1 | F.C. = 06H | PS Addr. = 14H |
+------------------+------------------+
word 2 | Addr. of word to write = 03E8H |
+-------------------------------------+
word 3 | Value of word to write = A596H |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer addr. in PC = 0295H |
+-------------------------------------+
The report word corresponding to this ER number 65 (41H) is register %R0266.
Asynchronous reading of a particular byte of subscriber 20 of PLC ALSPA 8000, the request type is triggered
and the answer is stored at address %R0641 (0281H).
bit 15 14 8 7 0
+--+---------------+------------------+
word 0 | 1| 00H | ER_No = 00H |
+--+---------------+------------------+
word 1 | F.C. = 07H | PS Addr. = 14H |
+------------------+------------------+
word 2 | xxxx (not used) |
+-------------------------------------+
word 3 | xxxx (not used) |
+-------------------------------------+
word 4 | xxxx (not used) |
+-------------------------------------+
word 5 | xxxx (not used) |
+-------------------------------------+
word 6 | Answer addr. in PC = 0281H |
+-------------------------------------+
The report word corresponding to this ER number 00 (00H) is register %R0201 which is the beginning of the ER
reports zone defined in the configuration table.
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-21
User’s Manual
Operation
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Initialise the report words to zero: *)
|(* - %R0201 report word for the ER00, triggered type *)
|(* - %R0265 report word for the ER64, periodic type *)
|(* - %R0266 report word for the ER65, periodic type *)
|(* - %R0331 report word for the ER130, cyclic type *)
|(* - %R0332 report word for the ER131, cyclic type *)
|(* - %R0333 report word for the ER132, cyclic type *)
|(* - %R0334 report word for the ER133, cyclic type *)
|(**********************************************************************)
|
|
|FST_SCN +-----+ +-----+ +-----+
|--] [---+MOVE_+-----------------+MOVE_+-----------------+MOVE_+-
| | INT | | INT | | INT |
| | | | | | |
| CONST -+IN Q+-%R0201 CONST -+IN Q+-%R0265 CONST -+IN Q+-%R0331
| +00000 | LEN | +00000 | LEN | +00000 | LEN |
| |00001| |00002| |00004|
| +-----+ +-----+ +-----+
|
Page 5-22 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Initialise the 1st word of the answer tables to zero: *)
|(* - %R0641 of ER00, triggered type *)
|(* - %R0651 of ER64, periodic type *)
|(* - %R0661 of ER65, periodic type *)
|(* - %R0501 of ER130, cyclic type *)
|(* - %R0631 of ER131, cyclic type *)
|(* - %R0701 of ER132, cyclic type *)
|(* - %R0691 of ER133, cyclic type *)
|(**********************************************************************)
|
|
|FST_SCN +-----+ +-----+ +-----+
|--] [---+MOVE_+-----------------+MOVE_+-----------------+MOVE_+-
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-23
User’s Manual
Operation
|
|
|FST_SCN +-----+ %T0003
+--] [---+MOVE_|-----------------------------------------------------(R)--
| | INT |
| | |
| CONST -+IN Q+-%R0691
| +00000 | LEN |
| |00001|
| +-----+
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Set the timer to 10 seconds for requesting exchanges. *)
|(**********************************************************************)
|
|
|%T0003 +-----+ %T0003
+--]/[---+ TMR +-----------------------------------------------------(S)--
| |0.01s|
| | |
| CONST -+PV |
| +00100 | |
| +-----+
| %R0177
|
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Prepare the exchange request table in the COMMREQ data block *)
|(* whose command block begins at address %R0041 *)
|(* and the data block at address %R0047. *)
|(**********************************************************************)
|
|
Page 5-24 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-25
User’s Manual
Operation
|
|
|FST_SCN +-----+ +-----+ +-----+
+--] [---+BLKMV+-----------------+BLKMV+-----------------+BLKMV+-
| | WORD| | WORD| | WORD|
| | | | | | |
| CONST -+IN1 Q+-%R0056 CONST -+IN1 Q+-%R0063 CONST -+IN1 Q+-%R0070
| 8083 | | 8084 | | 8085 | |
| | | | | | |
| CONST -+IN2 | CONST -+IN2 | CONST -+IN2 |
| 0F14 | | 0414 | | 1014 | |
| | | | | | |
| CONST -+IN3 | CONST -+IN3 | CONST -+IN3 |
| 000A | | 0000 | | 03E8 | |
| | | | | | |
| CONST -+IN4 | CONST -+IN4 | CONST -+IN4 |
| 0032 | | 0032 | | 0064 | |
| | | | | | |
| CONST -+IN5 | CONST -+IN5 | CONST -+IN5 |
| 0010 | | 0000 | | 0008 | |
| | | | | | |
| CONST -+IN6 | CONST -+IN6 | CONST -+IN6 |
| 000B | | 0000 | | 02BF | |
| | | | | | |
| CONST -+IN7 | CONST -+IN7 | CONST -+IN7 |
| 0277 +-----+ 02BD +-----+ 02B3 +-----+
Page 5-26 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
|
|
|FST_SCN +-----+ +-----+ +-----+
+--] [---+BLKMV+-----------------+BLKMV+-----------------+BLKMV+-
| | WORD| | WORD| | WORD|
| | | | | | |
| CONST -+IN1 Q+-%R0077 CONST -+IN1 Q+-%R0084 CONST -+IN1 Q+-%R0091
| 8440 | | 8441 | | 8000 | |
| | | | | | |
| CONST -+IN2 | CONST -+IN2 | CONST -+IN2 |
| 0514 | | 0614 | | 0714 | |
| | | | | | |
| CONST -+IN3 | CONST -+IN3 | CONST -+IN3 |
| 0009 | | 03E8 | | 0000 | |
| | | | | | |
| CONST -+IN4 | CONST -+IN4 | CONST -+IN4 |
| FF00 | | A569 | | 0000 | |
| | | | | | |
| CONST -+IN5 | CONST -+IN5 | CONST -+IN5 |
| 0000 | | 0000 | | 0000 | |
| | | | | | |
| CONST -+IN6 | CONST -+IN6 | CONST -+IN6 |
| 0000 | | 0000 | | 0000 | |
| | | | | | |
| CONST -+IN7 | CONST -+IN7 | CONST -+IN7 |
| 028B +-----+ 0295 +-----+ 0281 +-----+
|
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-27
User’s Manual
Operation
|
|
|%T0003 %M0021
+--] [---------------------------------------------------------------(^)--
|
|
|%M0021 %M0022
+--] [---------------------------------------------------------------(SM)-
|
|(* COMMENT *)
|
|(**********************************************************************)
|(* Transfer the COMMREQ command block on channel number 120 to the *)
|(* MODBUS Master PCM/EU configured in rack 0, slot 2 *)
|(**********************************************************************)
|
|
|%M0022 %T0003 +-----+
+--] [-----] [---+ EQ_ |
| | INT |
| | | +-----+
| %R0191 -+I1 Q+----------+COMM_|
| | | | REQ |
| | | | |
| CONST -+I2 | %R0041 -+IN FT+-
| +00005 +-----+ | |
| | |
| CONST -+SYSID|
| 0002 | |
| | |
| CONST -+TASK |
| 00000078 +-----+
|
|
|
|ALW_ON %M0022
+--] [---------------------------------------------------------------(RM)-
|
Page 5-28 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
After transferring the configuration and the user program (startup and request for exchanges) to the PLC,
pressing the PCM RESTART button for less than 5 seconds and activating the program with the Alspa P8
console, you can then use the reports (CR) in the PC.
bit3 : ER validity
Note
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-29
User’s Manual
Operation
The answer to an ER can be used if the exchange ended without fault (bit 1 of report = 1), it is stored at the
address stated in the Answer address in PC field of the ER structure. If the exchange ended with a fault (bit2 of
report = 1), you can also use the report faults.
If the exchange is in progress (bit0 = 1), the ER validity bit (bit3) remains at 1 for all exchange types.
If the exchange has ended (bit1 or bit2 = 1), the ER validity bit (bit3) stays at 1 for all types of periodic and
cyclic exchanges but is set to 0 for the triggered exchange type.
Example: We will again use the previous examples - activation and exchange request. Let us assume that the
exchanges contain no faults and check that.
• For ER00, triggered exchange type: the binary value of %R0201 goes from 0000000000001000 to
0000000000001001 (exchange in progress) and then to 000000000000010 (exchange enERd without fault),
the content of the ER00 answer table:
bit 15 14 8 7 0
+--+---------------+------------------+
%R0641 | 0| F.C. = 07H | PS Addr. = 04H |
+--+---------------+------------------+
%R0642 | 00H | Value of byte |
+------------------+------------------+
Page 5-30 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
• For ER64 (ER65), periodic exchange type: the binary value of %R0265 (%R0266) goes from
0000000000001000 to 0000000000001001 (exchange in progress) and then to 0000000000001010
(exchange ended without fault) and every 2 seconds, %R0265 (%R0266) varies between 2 values
0000000000001001 and 0000000000001010.
the content of the ER64 answer table:
bit 15 14 8 7 0
+--+---------------+------------------+
%R0651 | 0| F.C. = 05H | PS Addr. = 14H |
+--+---------------+------------------+
%R0652 | Addr. of written bit = 0009H |
+-------------------------------------+
%R0653 | Value of written bit = FF00H |
+-------------------------------------+
the content of the ER65 answer table:
bit 15 14 8 7 0
+--+---------------+------------------+
%R0661 | 0| F.C. = 06H | PS Addr. = 14H |
+--+---------------+------------------+
%R0662 | Addr. of written word = 03E8H |
+-------------------------------------+
%R0663 | Value of written word = A569H |
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-31
User’s Manual
Operation
bit 15 14 8 7 0
+--+---------------+------------------+
%R0501 | 0| F.C. = 02H | PS Addr. = 14H |
+--+---------------+------------------+
%R0502 | Nbr significant bytes = 000DH |
+-------------------------------------+
%R0503 |16th bit 1st bit|
+-------------------------------------+
%R0504 | 17th bit|
+-------------------------------------+
: :
: :
: :
+-------------------------------------+
%R0506 |64th bit 49th bit|
+-------------------------------------+
The last 14 bits are not significant (from 51st bit to 64th bit).
bit 15 14 8 7 0
+--+---------------+------------------+
%R0631 | 0| F.C. = 0FH | PS Addr. = 14H |
+--+---------------+------------------+
%R0632 | Addr. 1st bit written = 000AH |
+-------------------------------------+
%R0633 | Number of bits written = 0032H |
+-------------------------------------+
Page 5-32 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
bit 15 14 8 7 0
+--+---------------+------------------+
%R0701 | 0| F.C. = 04H | PS Addr. = 14H |
+--+---------------+------------------+
%R0702 | Nbr significant bytes = 0064H |
+-------------------------------------+
%R0703 | Value of 1st word |
+-------------------------------------+
%R0704 | Value of 2nd word |
+-------------------------------------+
: :
: :
: :
+-------------------------------------+
%R0752 | Value of 50th word |
+-------------------------------------+
bit 15 14 8 7 0
+--+---------------+------------------+
%R0501 | 0| F.C. = 10H | PS Addr. = 14H |
+--+---------------+------------------+
%R0652 | Addr. 1st word written = 03E8H |
+-------------------------------------+
%R0653 | Number of words written = 0064H |
+-------------------------------------+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-33
User’s Manual
Operation
After transferring the configuration and the user program (startup and request for exchanges) to the PLC,
pressing the PCM RESTART button for less than 5 seconds and activating the program with the Alspa P8
console, you can then use the faults in the PS: if fault indicator %R0193 = 00FFH, the %R0195 fault indicator is
incremented by 1 and fault bits %R0194 can be used, and %R0193 is set to 0.
If fault indicator %R0193 = 00FFH, we increment fault counter %R0195 by 1, possibly use fault bit %R0194 and
set %R0193 to 0.
|(* COMMENT *)
|
|(**********************************************************************)
|(* fault counting *)
|(**********************************************************************)
|
|
|ALW_ON +-----+
+--] [_--+ EQ_ |
| | INT |
| | | +-----+ +-----+
|%R0193 -+I1 Q+---------+ ADD_+-----------------+MOVE_+-
| | | | INT | | WORD|
| | | | | | |
| CONST -+I2 | %R0195 -+I1 Q+-%R0195 CONST -+IN Q+-%R0193
| +00255 +-----+ | | 00000 | LEN |
| | | |00001|
| CONST -+I2 | +-----+
| +00001 | |
| +-----+
Page 5-34 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Operation
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 5-35
User’s Manual
Chapter Details of RTU transmission frames
info = 4 bytes
<---------------------->
+---------+--------+-----------+------------+-----------+
| PS |function| Ad. of 1st| Number of | CRC16 |
| address | 1 or 2 |bit to read|bits to read| |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+-----+-----+-----+
Normal answer:
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 6-1
User’s Manual
Details of RTU transmission frames
info = 4 bytes
<---------------------->
+---------+--------+-----------+------------+-----------+
| PS |function| Ad. of 1st| Number of | CRC16 |
| Address| 3 or 4 |wrd to read|wrds to read| |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+-----+-----+-----+
Normal answer:
Page 6-2 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Details of RTU transmission frames
3. WRITING A BIT
Request:
info = 4 bytes
<------------------->
+---------+--------+-----------+----+----+-----------+
| PS |function| Ad. of bit| 00 | | CRC16 |
| Address | 5 | to write | or | 00 | |
| | | MSB | LSB| FF | | LSB | MSB|
+---------+--------+-----+-----+----+----+-----+-----+
<-->
00 if bit = 0
FF if bit = 1
Normal answer:
info = 4 bytes
<------------------->
+---------+--------+-----------+----+----+-----------+
| PS |function| Ad. of bit| 00 | | CRC16 |
| Address | 5 | written | or | 00 | |
| | | MSB | LSB| FF | | LSB | MSB|
+---------+--------+-----+-----+----+----+-----+-----+
<-->
00 if bit = 0
FF if bit = 1
4. WRITING A WORD
Request:
info = 4 bytes
<----------------------->
+---------+--------+-----------+-------------+-----------+
| PS |function| Ad. of wrd| Value of wrd| CRC16 |
| Address | 6 | to write | to write | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+------+-----+-----+
Normal answer:
info = 4 bytes
<----------------------->
+---------+--------+-----------+-------------+-----------+
| PS |function| Ad. of wrd| Value of wrd| CRC16 |
| Address | 6 | written | written | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+------+-----+-----+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 6-3
User’s Manual
Details of RTU transmission frames
info = 0 byte
<->
+---------+--------+-----------+
| PS |function| CRC16 |
| Address | 7 | |
| | | LSB | MSB|
+---------+--------+-----+-----+
Normal answer:
info = 1 byte
<------->
+---------+--------+---------+-----------+
| PS |function| Value | CRC16 |
| Address | 7 | of | |
| | | byte | LSB | MSB|
+---------+--------+---------+-----+-----+
info = 4 bytes
<----------------------->
+---------+--------+-----------+-------------+-----------+
| PS |function| sub- | Data | CRC16 |
| Address | 8 | function | | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+------+-----+-----+
Normal answer:
info = 4 bytes
<----------------------->
+---------+--------+-----------+-------------+-----------+
| PS |function| sub- | Data | CRC16 |
| Address | 8 | function | | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+------+-----+-----+
Page 6-4 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Details of RTU transmission frames
Normal answer:
info = 4 bytes
<----------------------->
+---------+--------+-----------+-------------+-----------+
| PS |function| Start | Nbr of bits | CRC16 |
| Address | 15 | address | written | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+------+-----+-----+
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 6-5
User’s Manual
Details of RTU transmission frames
Normal answer:
info = 4 bytes
<----------------------->
+---------+--------+-----------+-------------+-----------+
| PS |function| Start | Nbr words | CRC16 |
| Address | 16 | address | written | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+------+------+-----+-----+
info = 0 byte
<->
+---------+--------------------+
| PS |function| CRC16 |
| Address | 17 | |
| | | LSB | MSB|
+---------+--------+-----+-----+
Normal answer:
info = 5 bytes
<------------------------->
+---------+--------+--------+------+-----------+------------+
| PS |function| Equip. | PS | Data | CRC16 |
| Address | 17 | type | RUN | | | |
| | |30 or 70| lamp | | | | LSB | MSB|
+---------+--------+--------+------+---+---+---+------+-----+
The data field is a CPU type for PLCs C80-35 and C80-75.
Page 6-6 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual
Details of RTU transmission frames
info = 4 bytes
<--------------------->
+---------+--------+-----------+-----------+------------+
| PS |function| Start byte| Number of | CRC16 |
| Address | 67 | number | bytes | |
| | | MSB | LSB| MSB | LSB| LSB | MSB|
+---------+--------+-----+-----+-----+-----+------+-----+
Normal answer:
ALS 53302 d-en MODBUS Master and Slave Protocol for Alspa 8000 PLCs Page 6-7
User’s Manual
Details of RTU transmission frames
Page 6-8 MODBUS Master and Slave Protocol for Alspa 8000 PLCs ALS 53302 d-en
User’s Manual