Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Modbus plc s7 1200 HCMUTE, Transcriptions of Electrical Engineering

getting to know modbus HCMUTE

Typology: Transcriptions

2019/2020

Uploaded on 04/23/2020

vuongtue123
vuongtue123 🇻🇳

1 document

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
S7-1200 and
Modbus RTU Devices
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Modbus plc s7 1200 HCMUTE and more Transcriptions Electrical Engineering in PDF only on Docsity!

S7-1200 and

Modbus RTU Devices

Modbus RS-485 2 wire installation

Common Balanced pair Slave 1 T R Slave n T R 5 V 650 ohms 650 ohms Master R T 120 ohms 1 nF 120 ohms 1 nF PG

Broadcast Addressing Mode

No response from slaves Adr 1 Adr 2^ Adr 3 (^) Adr 4 (^) Adr 5 Adr n Request Funct. Code 0 Request data CRC Used only with write functions

Address = 0

Modbus Serial Frame

Address Function Code Data CRC or LRC Additional data depending on the Function Code = 0 to 247 Identifies the addressee Validity check = 1 to 127 Action to perform Modbus PDU PDU = Protocol Data Unit Two addressing modes:

Unicast

Broadcast

Address field = 1 to 247 Address field = 0 (used in write only mode)

Function Field

Request

  • The function code field tells the slave what kind of action to perform. Response
  • For a normal response, the slave simply echoes the original function code.
  • For an exception response, the slave returns a code that is equivalent to the original function code with its most significant bit set to a logic 1. Address Function Data Checksum Valid codes are in the range of 1 to 255 decimal.

Data Field

Request

  • The data field contains additional information which the slave must use to take the action defined by the function code. This can include items like register addresses, quantity of items to be handled, etc... Response
  • If no error occurs, the data field contains the data requested.
  • If an error occurs, the field contains an exception code that the master. Application used to determine the next action to be taken. Address Function Data Checksum

Function Codes

Code Function 01 (0x01) Read n consecutive output bits 02 (0x02) Read n consecutive input bits 03 (0x03) Read n consecutive output words 04 (0x04) Read n consecutive input words 05 (0x05) Write 1 output bit 06 (0x06) Write 1 output word 07 (0x07) Read exception status 08 (0x08) Access diagnostic counters 15 (0x0F) Write n output bits 16 (0x10) Write n output words 23 (0x17) Read/Writen output words 43 (0x2B) Read identification

Example of Read Request

Request

Slave Address

CRC

First word address Function code = 3 Number of words to read 1 byte 1 byte 2 bytes 2 bytes 2 bytes

Response

Slave Address

CRC

Number of bytes read Function code = 3 Value of the first word 1 byte 1 byte 2 bytes 2 bytes 2 bytes Value of the last word 2 bytes

  • S7-1200 and CM
  • S7-1200 and CM

Hands-on