Schneider Electric VW3 A3 303 user manual Read/Write Multiple Registers 23 = 16#17

Page 31

8. Modbus protocol

8. 9. Read/Write Multiple Registers (23 = 16#17)

Request:

Slave no.

17

No. of 1st word to be

Number of words to be

No. of 1st word to be

Number of words to be

---

 

 

 

read

 

read

 

written

 

written

 

 

 

Hi

 

Lo

Hi

 

Lo

Hi

 

Lo

Hi

 

Lo

---

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 byte

1 byte

 

2 bytes

 

2 bytes

 

2 bytes

 

2 bytes

 

---

---

Number of bytes to be

Value of 1st word to be

written

 

written

 

Hi

 

Lo

 

 

 

 

 

 

1 byte

 

2 bytes

-----------------------------

Value of last word to be written

CRC16

Hi

 

Lo

Lo

 

Hi

 

 

 

 

 

 

 

 

 

2 bytes

2 bytes

Response:

Slave no.

17

Number of bytes

Value of 1st word read

 

 

read

 

 

 

 

 

 

Hi

 

Lo

 

 

 

 

 

 

 

 

 

 

1 byte

1 byte

1 byte

 

2 bytes

--------------

Value of last word read

CRC16

Hi

 

Lo

Lo

 

Hi

 

 

 

 

 

 

 

 

 

2 bytes

2 bytes

Example: This example combines the two examples for functions 3 and 16. With function 23, the line is less busy than with these two functions. However, the number of words that can be read and written is restricted.

Write the values 20 (16#14) and 30 (16#1E) respectively to the 2 logic address words 9001 and 9002 on slave 2.

Read the 4 logic address words 3102 to 3105 on the same slave (values read = 16#0028, 16#0258, 16#01F4, and 16#0000).

Request:

Slave no.

 

Request code

No. of 1st word to be

No. of words to be

No. of 1st word to be

 

No. of words to be

 

---

 

 

 

 

 

 

 

read

 

 

 

 

 

read

 

 

 

 

 

written

 

 

 

 

written

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hi

 

Lo

Hi

 

 

 

 

Lo

Hi

 

 

 

Lo

 

Hi

 

 

 

Lo

 

 

---

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

02

 

17

 

 

0C

 

1E

00

 

 

 

 

04

23

 

 

 

29

00

 

 

02

 

 

---

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

---

No. of bytes to be written

 

Value of 1st word to be written

 

 

 

Value of 2nd word to be written

 

CRC

 

CRC

 

---

 

 

 

 

 

Hi

 

 

 

Lo

 

 

 

 

Hi

 

 

 

 

Lo

 

 

 

Lo

 

 

 

 

Hi

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

---

 

04

 

 

00

 

 

 

 

14

 

 

 

 

00

 

 

 

 

1E

 

 

 

D2

 

 

 

 

F5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Response:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Value of 1st

 

Value of 2nd

Value of 3rd

 

Value of 4th

 

 

CRC

CRC

 

Slave no.

Response code

 

No. of bytes

 

word read

 

word read

word read

 

word read

 

 

 

 

 

 

 

 

 

 

 

 

 

 

read

 

Hi

 

Lo

 

Hi

 

Lo

Hi

 

Lo

 

Hi

 

Lo

 

 

Lo

 

Hi

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

02

17

 

 

08

 

00

 

28

 

02

 

58

01

 

 

F4

 

00

 

00

 

12

 

F0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31

Image 31
Contents Altivar Contents Electric shock will result in death or serious injury Before you beginCommunication Parameters Manual Installation ManualDocumentation structure Programming ManualPresentation IntroductionNotation Hardware description Hardware setupInstalling the card in the drive ReceiptChoosing polarization Switch codingCoding the address 1234 AddressWiring recommendations Connecting to the busModbus RS485 standard Connection accessories Connection via RJ45 wiring systemConnection cables TSX SCP CM Connection cables for the masterType of master Master interface Description Catalog number TWD XCA RJ030Cables Connection via junction boxesDescription Catalog Number Subscriber socket RS485 double shielded twisted pairTSX P ACC TSX CSA500Communication parameters ConfigurationParameter Value Comment Control CommandControl via Modbus in I/O profile Control via Modbus or the terminals in I/O profileControl via Modbus or the terminals in Drivecom profile Control via Modbus in Drivecom profileConfiguration COM. Scanner Input Example of configuration via the graphic display terminalCommunication scanner RDY NETCOM. Fault Management Communication faultsFormat Range Terminal display CONFIG. COMM. MAPMonitored parameters FormatGreen RUN Red ERR Meaning Corrective action DiagnosticsChecking the address LEDsCOM Scan Output MAP CMD. Word Image RUN NETCommunication MAP COM. Scanner Input MAPOutput variable Scanner parameter Input variable Scanner parameterCOM Scan Output MAP Card fault Communication faultPrinciple Modbus protocolSlave Slave j Slave k Slave address Function code Data RTU modeAscii mode ModesRead Holding/Input Registers 3/4 Modbus functions availableCode Modbus name Description Broadcast Size of data Write Single Register Diagnostics Write Multiple Registers 16 = 16#10 Get Comm Event Counter 11 = 16#0BRead/Write Multiple Registers 23 = 16#17 Machine Read Device Identification 43 = 16#2BMEI Example of positive responseInput variables Logic address Default assignment Output variables Logic address Default assignmentCode Modbus name Description Size of data Parameter Logic Read Input variable address Logic address Default valueParameter Logic Value Parameter assigned Output controlParameter assigned Input monitoringException responses Code Error codeResponse Logic address Parameter Value Read non-existent or protected parametersRS485 standard AppendixMaster Modbus 2-wire standard schematicModbus 4-wire standard schematic Uni-Telway schematic Type of trunk cable Cable with 1 shielded twisted pair Wire Jbus schematicDifferent scenarios Creating a Modbus bus using non-standard equipmentRecommendations Example Calculating the polarizationSUB-D RS485 schematic for the cardCard connector pinout Contact no. SignalAtv71ModbusJbusENV1 2005-05