Yaskawa G7 User Manual

Modbus Communication Manual
G7 Drive
Drive Model: CIMR-G7U* Document Number: TM.G7.11
2
W arnings and Ca utio ns
This section provides Warnings and Cautions pertinent to this product that if not heeded, may
result in personal injury, fatality, or equipment damage. Yaskawa is not responsible for
consequences of ignoring these instructions.
WARNING
YASKAWA manufactures component parts that can be used in a wide variety of i ndustrial applications. The selection and application of YASKAWA products remains the responsib ility of the equipment designer or end user. YASKAWA accepts no responsi b ility for the way its products are incorpor ated into the final system design. Under no circumstances should any YASKAWA product be incor porated int o any product or design as the e xclusive or sole safety control. Without exc eption, all controls should be designed to detect faults dyna m ically and to fail safely under al l circumstances. All products designe d to incorporat e a component part manufactured by YASKAWA must be supplied to the end user with appropriate warnings and i nstructions as to that part’s sa fe use and operation. Any warnings provided by YASKAWA must be promptly provided to t he end user. YASKAWA offers an express warranty only as to the quality of it s products in conforming to standards and specifications publi shed in the YASKAWA manual. NO OTHER WARRANTY , EXPRESS OR IMPLIED, IS OFFERED. YASKAWA assumes no liabilit y for any personal injury, prope rty damage, losses, or claims arising from misapplication of its products.
WARNING
Read and unde rstand this ma nual before installing, ope rating, or servicing this G 7 drive. All war nings, cauti ons, and instructions must
be followed. All activity must be perf orm ed by qualified personnel. The G7 drive must be instal led accordi ng to this manual a nd local code.
Do not connec t or disconnec t wiring while the pow er is on. Do not remove covers or touch circuit boards while the power is on. Do
not remove or insert the digital opera tor while power is on.
Before servicing, disconnect all power to the equipment. The internal capacitor remains charged even after the power supply is turned
off. Stat us indicator LEDs and D igital Operator display will be extinguished when the DC bus voltage is below 50 VDC. To prevent electric shock, wai t at least 5 minutes after all indicators are O FF and m easure DC bus voltage and veri fy that it is at a saf e level.
Do not perf orm a withstand vol tage test on any pa rt of the unit. This equipment uses sensitive devices and may be damaged by high
voltage.
The G7 drive is not suitable for circuits capable of delivering more than the specified RMS symmetrical amperes. Install adequate
branc h short circuit protecti on per applicable codes. Refer to the specification. Fa ilure to do so may result in equipment damage a nd/or personal injury.
Do not connec t unapproved LC or RC interference suppression fi lters, capacitors, or over voltage protection devices to the output of
the G7 drive. Capacitors may generate peak currents that exceed G7 drive specifications.
To avoid unne cessary fa ult displays, caused by contactors or output s witches placed between G7 drive and motor, auxiliary contacts
must be pr operly integra ted into the c ontrol logic circuit.
YASKAWA is not responsible for any modification of the product made by the user; doing so will voi d the warranty. This product
must not be modified.
Verif y that the rated voltage of the G7 dri ve matches the voltage of the incoming power supply before applying power. To meet CE directives, proper line filters and pr ope r installation are requi red. Some drawings in this ma nual may be shown wit h protective c overs or shields re moved, to describe details. These must be replaced
before operation.
Observe Electrostatic Discharge Procedures w hen handling the G7 dri ve and G7 drive com ponents to preve nt ESD damage. The attached equipment may start unexpe ctedly upon application of power to the G7 drive. Clear all personnel fr om the G7 drive,
motor, and ma chine area pri or to applyi ng power. Secure covers, couplings, shaft keys, machine beds and all safety equipment before ener gizing the G7 drive.
Do not attem p t to disassem ble this unit. There are no user se rviceable parts. Disassembling this unit will void any and all warranties.
3
Introduction
This manual is intended as an overvie w of pa rameter access for the Yaskawa model G7 drive and describes how to connect the G7 dr ive to RS­232, RS-422 or RS-485. Refer to the G7 Driv e Technica l Manua l ( T M .G 7 .0 1 ) for detaile d pa rameter information.
This docume n t pertains to the G7 drive. In t his document, the word “inver ter”, “ac drive” and “drive” may be used inter changeably. For details on installation and oper ation of the G7 drive, refer to the G7 Drive Technical Manual (TM.G7.01). All manuals and support files are
available on the CD that came with the G7 drive and ar e also available for downloa d at www.yaskawa.com.
®
Modbus All trademarks are the property of their respe ctive owners.
is a regist er ed trademark of Schneider Automation , Inc.
4
Table of Contents
Chapter 1 - Connections....................................................................7
Connection Check Sheet................................................................................................ 8
Verify Operation.............................................................................................................. 9
G7 Drive Connections....................................................................................................10
Network Connections.....................................................................................................11
Communic at ions Par am eters.........................................................................................13
Run/Stop and Frequency Reference Source..................................................................15
Verify Communication....................................................................................................16
Chapter 2 - Message Formats.........................................................18
Protocol.........................................................................................................................20
Read Multiple Registers – Functi on Code 03H ..............................................................21
Write Single Register – Function Code 06H...................................................................23
Loop-Back Test – Function Code 08H...........................................................................25
Write Multiple Registers – Function Code 10H...............................................................27
No Response .................................................................................................................29
Error Codes...................................................................................................................29
CRC-16 Calculations.....................................................................................................30
Chapter 3 - Troubleshooting...........................................................31
General Information.......................................................................................................33
RS-232 Co mmunic at ion.................................................................................................35
RS-422/ RS- 485 Co mmunic at ion....................................................................................37
RS-422/ RS- 485 Self-Test ..............................................................................................40
Chapter 4 - G7 Drive Parameters....................................................41
Command Registers (Read/Writ e) f or Modbus RTU ......................................................42
Broadcas t R egis t ers (Write Only)...................................................................................43
Monitor Regis ters (R ead Only ).......................................................................................44
Parameter Registers (Read/Write).................................................................................52
CM090 Modbus TCP/IP Option Kit Specific Registers...................................................75
ENTER/ACCEPT Command (Write Only) ......................................................................78
Modbus Fault Decoding Table for Monitors....................................................................79
Chapter 5 - User Notes ....................................................................81
Notes.............................................................................................................................82
User Parameter Settings................................................................................................83
Hex/Dec Conversion Table............................................................................................91
5
Notes:
6

Chapter 1 - Connections

This chapter describes how to connect the G7 drive to a RS-232, RS-422 or RS-485 network.
Connection Check Sheet.............................................................. 8
Verify Operation............................................................................ 9
G7 Drive Connections.................................................................10
Serial Network Connections...................................................... 11
Communications Parameters.................................................... 13
Run/Stop and Frequency Reference Source............................ 15
Verify Communications.............................................................. 16
7

Connection Check Sheet

The following is a quick reference guide to connect and configure the G7 drive for serial communications. Make a copy of this page and check­off each item as it is completed. For detailed information please refer to the detailed sections that follow.
1: Unpack the G7 drive and verify that all com ponents are pres ent and undamaged.
2: Connect powe r to the G7 drive a nd verify that the G7 drive functi ons correctly. This includes running the G7 dri ve from the operator
keypad. Re fer to the G7 Technical Manual for information on connecti ng and operating t he G 7 drive.
3: Remove power from the G7 drive and wait for the charge lamp to be compl etely extinguished. Wait at least five additional minutes for
the G7 drive to be completely discharged. Measure the DC bus voltage and verify that it is at a safe level.
4: Connect the G7 drive to an RS-232 network. Note: It is not possible to use the drive’s key pad and an RS-232 connection at the same
time.
4.1: Remove the G7 drive’s operator keypad.
4.2: Connect the RJ-45 port on the front of the G 7 drive to the controller serial port. Refe r to Figure 1.1 - G7 D iagram for the
location of drive connectors. Use a DB9 to RJ-45 adapter with a standard Ethernet CAT-5 patch cable or use Yaskawa cable UWR00468-2. Do NOT connect this cabl e to an Ethernet port on the controller, as damage to the controller and/or G7 drive may re su l t. R efer to Figure 1.2 – RS-232 Connections for a description of the interface cable.
4.3: V erify that the cont roller communications parameters match the G7 drive’s communications parameters. Re fer to Table 1.1
– RS-232 (RJ-45 port) Communications Parameters for a list of default G7 drive communications parameters.
4.4: Reapply power to the G7 drive.
5: Connect the G7 drive to an RS-422/RS-485 network.
5.1: Remove th e G7 drive’s te rminal cover.
5.2: Connect the controller to the S+/S- and R+/R- terminals on the G7 drive’s terminal block as shown in Figure 1.3 – RS-
422/RS-485 Connections.
5.3: If this device is either the first or last device on the network, set the network termination, S1, to the ON position.
5.4: Reapply power to the G7 drive.
5.5: Set the G7 drive communication para me ters to match t hose of the controller. Refer to Table 1.2 –Baud Rate, Table 1.3 – Parity and Table 1.4 - RTS.
5.6: Set the node address of the G7 drive.
6: Verif y that the G7 drive a nd controller are communicating and that the exchanged data is valid.
8

Verify Operation

Connect powe r to the G7 drive a nd verify that the G7 drive functions properly. This includes running the G7 drive from the operat or keypad. Refer to the G7 drive Technical Manual for infor ma tion on connecting and operating the G7 drive.
Remove power from the G7 drive and wait for the charge lamp to be completely extinguished. Wait at least five additional minutes for the G7 drive to be completely discharged. Measure the DC bus voltage and verify that it is at a safe level.
Remove the ope rator keypad and terminal cover.
Figure 1.1 G7 Connection Diagram
9

G7 Drive Connections

Figure 1.2 G7 Drive Connecti ons
10

Network Connections

The following describes how to connect the G7 drive to an RS-232, RS-422 or RS-485 network. For detailed information please refer to the appropriate sections of this manual or the G7 drive Technical Manual.
RS-232 Network
The RS-232 network is a single ended network wit h limited data trans mission rates and cable lengt hs. The G7 drive RS- 232 data transmission is fixed at 9600bps, no parity, 8 data bits and 1 st op bit. The maximum cable length is 50 ft ( 16 m). It is recommende d that Yaskawa cable UWR00468-2 be used. Note: It is not possible to use the drive’s keypad and an RS-232 connection at the same time.
Figure 1.3 RS-232 Network Connection
RS-422/RS-485 4-Wire Network
RS-422/RS-485 4-wire net w orks allow for longer cable lengths, maximum 4000 ft (1200 m ), and are more im m une to noise than RS-232 networ ks because of thei r balanced li ne drivers. RS-422/RS-485 4-wire communicati on does not requir e RTS (request to send) control. See parameter H5-07. Set the Termination Resistor S1 sw itch to ON (slide the switch to the right) fo r each RS-422 device and the last RS-485 device on the network.
Figure 1.4 RS-422/RS-485 4-Wire Network Connection
11
RS-485 2-Wire Network
RS-485 2-wire networks can be either single or multi-drop networks, with each slave de vice on the networ k assigned a unique nod e address. A maximum of 31 devices may reside on any network segment bef ore a repeater is required. The ma ximum segment le ngth is 4000 ft (1200 m). Set the T erm ination Resi stor S1 switch t o O N (s lide the switch to the right) on the last device on the network. RS- 485 2-wire communication requires RTS (request to send) control. See parameter H5-07.
Figure 1.5 RS-485 2-Wire Network Connection
12
Communication Parameters
The following communicati ons parameters affect communication over RS-232, RS-422 and RS-485 networks. The RS- 232 communication paramet ers are fixe d. In addition, the node address is ignored when comm unicating via RS-232.
H5 group communication parameters can onl y be changed via the drive keypad.
Note: Drive power must be cycled for changes to H5 Group parameter s to be recognize d.
RS-232 Communication
The RS-232 co m m unications param eters are fixed at the values show n below. Although the node address is ignore d, the master when communicating to the G7 drive in this method typically uses a node address of 1.
Table 1.1 RS-232 (RJ-45 port) Communi cati on Parameters
Value Description
Baud rate 9600
Parity None
Stop Bits 1
Node Address N/A
RS-422/RS-485 Communication
Node Address – H5-01. The node address is set thr ough G 7 drive paramete r H5-01. When communi cating via RS- 422 or RS-485, a
unique node address between 0 and 20h (32 decima l), inclusive, must be entered. The defa ult G7 drive addres s is 1Fh (31 decimal). The addres s is always ente red as a hexadecimal number (ref er to the conversion chart in Chapter 4). A ddress 0 is typica lly reserved for global me ssages.
Baud Rate – H5-02. Select the baud rate that matches the controller’s communica tion configur ation.
Table 1.2 Baud Rate – Parameter H5-02
Value Description
0 1200bps 1 2400bps 2 4800bps 3 9600bps (Default Setting) 4 19,200bps
Parity – H5-03. Select t he parity that matc hes the controller’s communi cation conf iguration.
Table 1.3 Parit y – Param eter H5-03
Value Description
0 None (Default Setting) 1 Even 2 Odd
13
Communication Fault (CE) Response Selection – H5-04. Select the drive operation method when a communic ation fault (CE)
occurs . See parameter H5-05 also.
Table 1.4 Communicati on Fault Response Sel ection – Parameter H5-04
Value Description
0 Ramp to Stop (Fault) 1 Coast to Stop (Fault) 2 Fast Stop (Fault) 3 Alarm Only (Alarm) (Default Setting) 4 Run at D1-04 frequency
Communication Fault (CE) Detection Selection – H5-05. Selects whether the communication fa ult (CE) is monitor ed. Please note
that either B1-01 or B1-02 must also be set to a 2 (Serial Communication) for fault monitoring to occur. If the CE fault is enabled, the G7 will flash CALL on the keypad after power up until a message is rec eived. The dri ve w ill trip and respond according to H5-04 if communication is lost (a message is not received) for more than 2 seconds after s uccessful communication has been initiat ed.
Table 1.5 Communicati on Fault Det ecti on Selection – Parameter H5-05
Value Description
0 Disabled (Default Setting) 1 Enabled
Serial Com munication Send Delay – H5-06. A delay can be inserted bef ore the G7 drive responds to a command message. This
allows for slower communication devices to switch their transceiver state in order to get ready to receive a message. A value of 5 ~ 65 ms can be inserted, with 5 ms being the default.
RTS Control – H5-07. This paramete r determines whether RTS is cont inually asserted (disabled) or asserted only duri ng send
(enabled). RTS must be enabl ed for use with RS- 485 2-wire communication.
Table 1.6 RTS Control – Parameter H5-07
Value Description
0 Disable (always ON) (Default Setting) 1 Enable (ON only during send) (Use this s e tting for RS-485 2-wire systems)
14
Run/Stop and Frequency Refere nce
The Run/Stop and Frequency Reference commands can originate from:
Serial communication (Built-in Modbus: Keypad or R+/-, S+/- T erm inals) Keypad (Digital Operator) Terminal Strip Option Card
Paramet er B1-01 (Run/Stop Method Selection) allows the selection of t he origin of the Run/Stop command. Parameter B1-02 (Re ference Selection) allows the selection of the origin of the Frequency Reference com m and. The Run/Stop and Frequency Reference commands may have different origi ns.
For exampl e, the Run/Stop co m ma nd m ay be set to Termina ls (B1-01=1) while the Freque ncy Reference command may be set to Serial Communicat ion (B1-02=2).
Run/Stop Source
Table 1.7 Run/Stop Method Selecti on
B1-01 Operation Method Selection (Run/Stop)
0 Keypad 1 Terminal Strip (Default Setting) 2 Serial Communication (Built-in Modbus: Keypad or R+/-, S+/- Terminals) 3 Option Card (EtherNet/IP, Modbus TCP/IP, DeviceNet, Profibus DP, LonWorks, etc.) 4 Pulse Input (RP Terminal)
Frequency Reference Source
Table 1.8 Frequency Ref erence Source Selection
B1-02 Frequency Reference Selection
0 Keypad 1 Terminal Strip (Default Setting)
2 Serial Communication (Built-in Modbus: Keypad or R+/-, S+/- Terminals) 3 Option Card ( EtherNet/ IP, Modbus TCP/IP, DeviceNet, Profibus D P, LonWorks, etc. )
15

Verify Communication

The following is a quick ref erence guide for serial communications to the G7 drive. Make a copy of this page and check-off eac h item as it is completed. For detailed information please refer to the detailed sections that follow.
1: RS-232 Communication.
1.1: Verify that the correct cable is used to connect the controller to the G7 drive.
1.2: V erify that the controller is set f or RS-232 communica tion and that the communication cable is connected to the c orrect
communication port.
1.3: Record the control ler communication parameters.
Baud Rate
1.4: Record the G7 drive comm unication para m eters (H5-02, H5-03, H5-07) .
Baud Rate
1.5: Verify that the communication parameters match.
2: RS-422/RS-485 Communication.
2.1: V erify that the G7 drive is connected correctly.
2.2: V erify that the controller is set f or RS-422/RS-485 c om munications and that the communications cable is connected to
the correct communica tions port.
2.3: Record the control ler communications parameters.
Baud Rate
2.4: Record the G7 drive comm unication para m eters (H5-01, H 5-02, H5-03, H5-07).
Baud Rate
Parity Data Bits Stop Bits 1
Parity Data Bits Stop Bits 1
Parity Data Bits Stop Bits 1
Parity Data Bits Stop Bits 1
2.5: Verify that the communication parameters match.
2.6: Verify that parameter H5-07 (RTS) is set to enable.
2.7: V erify that paramet er H5-01 (Node A ddress) is set to the correct, unique, hexadecimal value and that it matches the
node address required by the controller.
Controller Node Address
G7 Drive Node Address
16
3: Send a command message to the G7 drive fr om t he controller and verify the data of the comma nd and response messages.
3.1: Verify the conten ts of th e com mand message.
Notes:
[
[
[
[
3.2: Verify the contents of the response message.
[
[
[
[
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
17
Notes:
18

Chapter 2 - Message Formats

This chapter provides information on the message (telegram) contents and configuration.
Protocol....................................................................................... 20
Read Multiple Registers – Function Code 03H......................... 21
Write Single Register – Function Code 06H............................. 23
Loop-Back Test – Function Code 08H...................................... 25
Write Multiple Registers – Function Code 10H........................ 27
No Response............................................................................... 29
Error Codes................................................................................. 29
CRC-16 Calculation .................................................................... 30
19

Protocol

The parame ter access met hod supported by the G 7 drive is a subset of the Modbus♦ communication protocol, which Yaskawa refers to as MEMOBUS. The G7 drive supports Modbus functions 3, 6, 8 and 10h. The message format varies depending upon the f unction code of the message. For each function code, there is a command message from the master and a response me ssage from the slave. The following sections review the format of the command and response messages for each funct ion.
Message Functions Supported
The following table lists the Modbus functi on codes availa ble and their mi nimum and m aximum byte lengths.
Table 2.1 Supported Function Codes
Function Code Function
3h (3 dec) Read Multiple Registers 8 8 7 21
6h (6 dec) Write Single Register 8 8 8 8
8h (8 dec) Loop-Back Tes t 8 8 8 8
10h (16 dec)
Write Multiple Re g iste rs 11 25 8 8
Minimum (bytes) Maximum (bytes) Minimum (bytes) Maximum (byt es )
Command Message Response Message ( N ormal)
20

Read Multiple Registers – Function Code 03H

The Read Multiple Register function is used to read the contents of from 1 to 8 consecutive registers. The formats of the read command and response m essages are shown below.
Read Multiple Registers Command Message
Table 2.2 Read Command Message
Description Data
Starti ng Register
Each G7 dri ve slave address is set via parameter H5-01. Vali d slave address es must be in the ra nge of 1 ~ 20 hex (1 ~ 32 dec) and entered as a hexadec imal number. No two slaves may have the same address . The master addresses the slave by placing the slave address in the Slave Address field of the message. In the command message above, t he slave is addr essed at 02h. Broadcast address 0 is not valid for register re ad commands.
Slave Address 02h
Function Code 03h
Upper 00h Lower 20h
Quantity
CRC-16
Upper 00h Lower 04h Upper 45h Lower F0h
The function code of this mes sage is 03h (read multiple registers) .
The starting regist er is the addres s of the first register to be read. In the command message a bove the starting register a ddress is 20h (0020h).
The quantity indicates how many consecu tive registers are to be read. The quantit y ma y range from 1 to 8 registers. If an invalid quantity is entere d, error code 03h is returned i n a fault response message. I n this example, four consecutive register s are to be read: 20h, 21h, 22h and 23h.
A CRC-16 value is generated from a calculation including the message sla ve address, function code, sta rting register and quanti ty. The procedure for calculating a CRC-16 is described at the end of this chapter. When the slave receives the command message it calculates a CRC­16 value and compa res it to the CRC-16 of the command message. If the two CRC-16 values are identical and the Slave Addr ess is correct, the slave process es the command message. If the two CRC- 16 values are not identica l, the slave will discard the command message and not respond.
If the com ma nd me ssage has a valid slave address, function code, starting register, and quantity , the slave wil l respond with a normal response message. If the command message has an invalid function code, starting register, and/or quantity, the slave will respond with a fault response message. If the command message has an i nvalid slave addr ess or CRC-16, no response will be returned.
21
Read Multiple Registers Normal Response Message
Table 2.3 Read Normal Response Message
Description Data
Starti ng Register
Next Register Next Register
Last Register
The normal response message contains the same slave address and funct ion code as the command message, indicating to the master which specific slave is responding and to what type of function it is responding.
Slave Address 02h
Function Code 03h
Number of Data Bytes 08h
Upper 17h Lower 70h Upper 17h Lower 70h Upper 01h Lower 09h Upper 00h Lower 00h
CRC-16
Upper 38h Lower ACh
The number of data bytes is t he num ber of data bytes returned in t he response message. The number of da ta bytes is actually the number of regist er s read time s 2, since th er e ar e tw o by te s of data in each register.
The starting register is the address of the first register read.
The data section of the response message contains the data for the registers' requested re ad, in this case registers 20h, 21h, 22h and 23h. Their data is 20h = 1770h, 21h = 1770h, 22h = 0109h and 23h = 0h.
Read Multiple Registers Fault Response Message
Table 2.4 Read Fault Response Message
Description Data
The fault response message contai ns the same slave address as the command message, indicating to the master, which slave is responding.
The function code of a fault response message is the logical OR of 80h and the original function code of 03h. This indicates to the master that the message is a fault response message, instead of a normal response message.
Slave Address 02h
Function Code 83h
Error Code 02h
CRC-16
Upper 30h
Lower
F1h
The error code indicates w h ere the err or occurred in the com mand message. The value of 02h in the error code field of this fault response message indicates that the command me ssage requested data be read from an invalid register. Refer to section Error Codes, Table 2- 14, for more info rmation on retu rned erro r co d es.
22

Write Single Register – Function Code 06H

The Write Single Register function allows the writing of data to one regi ster only.
Write Single Register Command Message
Table 2.5 Write Command Message
Description Data
Register Address
Each G7 dri ve slave address is set via parameter H5-01. Vali d slave address es must be in the ra nge of 1 ~ 20 hex (1 ~ 32 dec) and entered as a hexadec imal number. No two slaves may have the same address . The master addresses the slave by placing the slave address in the Slave Address field of the message. In the command me ssage above, t he slave is addr essed at 01h. Broadcast address 0 is valid for register write commands.
Slave Address 01h
Function Code 06h
Upper 00h Lower 01h
Data
CRC-16
Upper 00h Lower 03h Upper 98h Lower H0B
By setting the slave address to zero (0) in the command message, the master can send a message to all the slaves on the network simultaneously. This is called simultaneous broadcasting. In a simultaneous broadcast message there is no response message.
The function code of this mes sage is 06h (writ e single regi ster).
In the command message above the register address is 01h (0001h).
The data section contains the data to be written.
A CRC-16 value is generated from a calculation including the message slave address, function code, starting register, quantity, Number of Data Bytes, and all register data. The procedure for calculating a CRC-16 is described at the end of this chapter. When the slave receives the command message it calculates a CRC-16 value and compares it to the CRC-16 of the command messa ge. If t he two CRC-16 values are identical and the slave address is correct, the slave processes the command messa ge. If the two CRC-16 values are not identical, the slave will discard the command messa ge and not respond.
If the com ma nd me ssage has a valid slave address, function code, regis ter address and data, the sla v e w ill respond wi th a normal response message. If the command message has an invalid function code, regi ster addres s and/or data, the slave will respond with a fault response message. If the command message has an i nvalid slave addr ess or CRC-16, no response will be returned.
23
Write Single Register Normal Response Message
Table 2.6 Write Register Normal Response Message
Description Data
Register Address
The normal response message contains the same slave address, funct ion code, re gister address and data as the command message, indicating to the master which slave is responding and t o w hat type of function it is responding.
In the response message above the register address is 01h (0001h).
Slave Address 01h
Function Code 06h
Upper 00h Lower 01h
Data
CRC-16
Upper 00h Lower 03h Upper 98h Lower 0Bh
Write Single Register Fault Response Message
Table 2.7 Write Register Faul t Response Message
Description Data
The faul t response message contai ns the same slave address as the command message, indicating to the master which slave is responding.
The function code of a fault response message is the logical OR of 80h and the original function code of 06h. This indicates to the master that the message is a fault response message, instead of a normal response message.
The error code indicates w h ere the err or occurred in the com mand message. The value of 21h in the error code field of this fault response message indicates that the command me ssage data to be written was invalid for that register . Refer to the sec tion Error Codes, Table 2-14, for more info rmation on retu rned erro r co d es.
Slave Address 01h
Function Code 86h
Error Code 21h
CRC-16
Upper 82h Lower 78h
24

Loop-Back Test – Function Code 08H

The Loop-Bac k Test is used to ver ify that the com m unications pa rameters for the G7 drive have been set correctly and that the connection i s correct. The message should be constructed exactly as shown below. If everything is set and connected correctly, the received response will match the response shown below.
Loop-Back Test - 08h
The Loop-Back test function (08h) is used for checking signal transmiss ion between maste r and slaves. The com ma nd m essage format is shown below.
Table 2.8 Loop-Back Command Message
Description Data
Slave Address 01h
Function Code 08h
Test Code
Data
CRC-16
Upper 00h Lower 00h Upper A5h Lower 37h Upper DAh Lower 8Dh
Each G7 dri ve slave address is set via parameter H5-01. Vali d slave address es must be in the ra nge of 1 ~ 20 hex (1 ~ 32 dec) and entered as a hexadec imal number. No two slaves may have the same address . The master addresses the slave by placing the slave address in the slave address field of the message. In the co m ma nd m essage above, the slave is addressed at 01h. Broadcast address 0 is not valid for Loop-Back test commands.
The function code of this message is 08h (Loop- Back test).
The test code must be set to 0000h. This function specifies that the data passed in the command message is to be returned (looped back) in the response message.
The Data sec tion contains arbitrary values.
A CRC-16 value is generated from a calculation including the message slave a ddress, funct ion code, test code, and data. The pr ocedure for calculating a CRC-16 is described at the end of this chapter. When the slave receives the command me ssage it calculates a CRC- 1 6 value and compares it to the CRC- 16 of t he comma nd messa ge. If the two CRC-16 values are identical and the Slave Address is correct, the slave processes the command mes sage. If the two CRC-16 values are not identical, the slave will disc ard the command mes sage and not respond.
If the comma nd me ssage has a vali d slave address, function code, test code, data and CRC-16, t he slave will respond with the normal response message. If the command message has an invalid function code, tes t code, and/or data, the slav e w ill respond wit h a fault response me ss ag e. If the command message has an invalid slave address or CRC-16, no response will be returned.
25
Loop-Back Normal Response
The normal Loop-Back Test response is identical to the command message.
Table 2.9 Loop-Back Normal Response Message
Description Data
Slave Address 01h
Function Code 08h
Test Code
Data
CRC-16
Upper 00h Lower 00h Upper A5h Lower 37h Upper DAh Lower 8Dh
Loop-Back Fault Response
Table 2.10 Loop-Back Fault Response Message
Description Data
Slave Address 01h
Function Code 88h
Error Code 01h
CRC-16
Upper 87h Lower C0h
The faul t response message contai ns the same slave address as the command message, indicating to the master which slave is responding. The function code of a fault res ponse message is the logical OR of 80h and the origin al function code of 08h. This indicates to the master that the message is a fault response message, instead of a normal response message.
The error code indicates where the error occurred in the command message. Refer to the section Error Codes, Table 2-14, for more inf o rm at io n on return ed error cod e s.
26

Write Multiple Registers – Function Code 10H

The Write Mul tiple Register function allows the writi ng of data to from 1 t o 16 consecutive re gisters.
Write Multiple Registers Command Message
Table 2.11 Write Command Message
Description Data
Starti ng Register
First Register Data
Next Register Data
Slave Address 01h
Function Code 10h
Upper 00h Lower 01h
Quantity
Number of Data Bytes 04h
CRC-16
Upper 00h
Lower 02h Upper 00h
Lower 01h Upper 02h Lower 58h Upper 63h Lower 39h
Each G7 dri ve slave address is set via parameter H5-01. Vali d slave address es must be in the ra nge of 1 ~ 20 hex (1 ~ 32 dec) and entered as a hexadec imal number. No two slaves may have the same address . The master addresses the slave by placing the slave address in the Slave Address field of the message. In the command me ssage above, t he slave is addr essed at 01h. Broadcast address 0 is valid for register write commands.
By setting the slave address to zero (0) in the command message, the master can send a message to all the slaves on the network simultaneously. This is called simultaneous broadcasting. In a simultaneous broadcast message there is no response message.
The function code of this mes sage is 10h (writ e m ultiple registers).
The starting register is the address of the first register to be written. In the command message above the starting register address is 01h (0001h).
The quantity indicates how m any consecuti ve registers are to be written. The quantity may range fr om 1 to 16 registers. If an invalid quantity is entere d, error code of 03h is returne d in a fault respons e m essage. In this command messa ge there are t w o consecutive registers to be written: 0001h (Oper ation Command) and 0002h ( F requency Ref erence).
The number of data bytes is t he num ber of bytes of dat a to be written. The number of data byt es is actual ly the quantity multiplie d by 2, since there are two bytes of data in each register.
The Data section contains the data for each register to be written in the order in which they are to be written.
A CRC-16 value is generated from a calculation including the message slave address, function code, starting register, quantity, Number of Data Bytes, and all register data. The procedure for calculating a CRC-16 is described at the end of this chapter. When the slave receives the command message it calculates a CRC-16 value and compares it to the CRC-16 of the command messa ge. If t he two CRC-16 values are identical and the slave address is correct, the slave processes the command messa ge. If the two CRC-16 values are not identical, the slave will discard the command messa ge and not respond.
If the com ma nd me ssage has a vali d slave address, function code, starting register, quantity, number of data byte s and data, and the slave will respond with a normal response message. If the command message has an invalid function code, starting register, quantity, Number of Data Bytes a nd/or data, the slave will respond with a fault response message. If the command message has an invali d slave address or CRC-16, no response w ill be returned.
27
Write Multiple Registers Normal Response Message
Table 2.12 Write Registers Normal Response Message
Description Data
Starti ng Register
The normal response message contains the same slave address, function code, starting register and quantity as the command message, indicating to the mast er which slave is responding and to what type of f unction it is responding.
The starting register is the address of the first register written. In the response message above the starting register address is 01h (0001h).
The quantity indicates how m any consecuti ve registers were written. In this case the quantity is 2.
Slave Address 01h
Function Code 10h
Upper 00h Lower 01h
Quantity
CRC-16
Upper 00h Lower 02h Upper 10h Lower 08h
Write Multiple Registers Fault Response Message
Table 2.13 Write Registers Fault Response Message
Description Data
The faul t response message contai ns the same slave address as the command message, indicating to the master which slave is responding.
The function code of a fault response message is the logical OR of 80h and the original function code of 10h. This indicates to the master that the message is a fault response message, instead of a normal response message.
The error code indicates w h ere the err or occurred in the com mand message. The value of 02h in the error code field of this fault response message indicates that the command me ssage requested data to be written to an invalid register . Refer to the section Error Codes, Table 2-14, for more information on returned error codes.
Slave Address 01h
Function Code 90h
Error Code 02h
CRC-16
Upper CDh Lower C1h
28
Loading...
+ 64 hidden pages