26.12.2012 Views

Serial Communications Protocol Specifications - Swissvacuum.com

Serial Communications Protocol Specifications - Swissvacuum.com

Serial Communications Protocol Specifications - Swissvacuum.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INTRODUCTION<br />

- 4 -<br />

The present document contains information on the Modbus protocol for performing data exchange between a PC and<br />

the MicroPLC chamber controller. You can find here a short description of the query and answer sintax for the<br />

Modbus function 3 (read function) and function 16 (write function).<br />

Moreover, a short example of code has been included as a guideline for the development of a <strong>com</strong>plete program.<br />

A <strong>com</strong>munication protocol defines media, data formats and rules which are <strong>com</strong>mon to two or more systems wich<br />

must exchange informations by means of a phisical <strong>com</strong>munication line.<br />

Moreover is described here how the devices (master and salve) connected to the line interact between them to start<br />

and close the <strong>com</strong>munication, and the way to identify error conditons during the data transmission.<br />

Pratically the protocol allows a data exchange between Master device and a Slave device according to the following<br />

situation:<br />

Fig. 1 Master and Slave<br />

PC as MASTER CHAMBER CONTROLLER as SLAVE<br />

SLAVE ADDRESS<br />

FUNCTION CODE<br />

DATA<br />

ERROR CHECK<br />

SLAVE ADDRESS<br />

FUNCTION CODE<br />

DATA<br />

ERROR CHECK<br />

In this architecture, PC always acts as Master while the chamber controller is always the Slave device.<br />

The Master device is the only one that can start the <strong>com</strong>munication.<br />

The <strong>com</strong>munication consists essentially in a query made by the Master device (normally a PC) that is directly<br />

followed by an answer <strong>com</strong>ing from the Slave device (the MicroPLC chamber controller).<br />

The <strong>com</strong>munication task, either is a query or an answer, consists in preparing a data packet wich includes the<br />

identification code of the requested function, the lenght of the query/answer, the data itself and error check<br />

information. This data packet is then transmitted to the device on the other end of the serial <strong>com</strong>munication line.<br />

Thus the Modbus protocol defines the structure of the data packet in wich the relevant information to be exchanged<br />

are encapsulated. The fields consituting the data packet are: destination address, function code of the action to be<br />

performed, the relevant data for the operation and an error verification code.<br />

When a Slave device receives a data packet, it decodes the data and execute the operation that the Master device<br />

has required (operation that can be reading or writing data in the Slave device memory).<br />

At this point the Slave device create the needed data packet and “returns it to sender”. The information in the<br />

response message is the slave device address, the action performed, the data acquired as a result of the action and a<br />

mean of checking errors.<br />

<strong>Serial</strong> <strong>com</strong>munications protocol vers. 2.02 Angelantoni Industrie Spa Massa Martana (PG) Italy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!