Вы находитесь на странице: 1из 7

Tech Note 586

Configuring the Compact Panel MODBU Serial Driver to Communicate to a Modicon PLC

All Tech Notes and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.

Topic#: 002342
Created: March 2009

Introduction

The MODBU Driver is one of Wonderware's new generation of Compact Panel based products that provide connectivity
to devices that are fully compatible with the Modbus Protocol.

This Tech Note provides a basic step-by-step procedure on setting up the Compact Panel MODBU Driver to communicate to
a Modicon Quantum PLC through a serial connection. For more configuration options refer to the InTouch® Compact
Edition MODBU Configuration Guide.

Note: This Technote assumes you have created a Compact Panel InTouch application. You should also be familiar with
the basic setup, configuration and publishing of a Compact Panel InTouch application. See Tech Notes 516 and 517
for information regarding InTouch Compact Panel Edition.

Create an Access Name

1. Select Special/Access Names from the WindowMaker™ menu.

2. Select Add.

3. Type the following in the appropriate fields:

• Access Name: This name will be used later in the MODBU driver configuration

• Application Name: For purposes of IO Driver configuration, this name is arbitrary and does not point to
an actual application.

• Topic Name: For purposes of IO Driver configuration, this name is arbitrary and does not point to an
actual topic definition.
Figure 1: Access Name definition

4. Click OK then Close.

MODBU Configuration

1. Select Special/InTouch Compact Edition application/IO Driver Configuration from the


WindowMaker menu.

2. Select MODBU from the list of available drivers, then configure the following:

• Place a checkmark next the the Access Name defined above in the Access Name Mapping section. In
the example below, modbusPLC would be selected.

• Select MODBU from the Mapping I/O Driver drop down box.

• Enter the PLC Model and Slave ID in the Station Address dialog box. If you omit the PLC Model the
driver assumes a Modbus PLC with a six digit register size. The example below uses a Quantum PLC Model.

3. Enter the connection information for serial communications to the PLC on the Direct tab. This example
uses COM1 on the Compact Panel communicating to the PLC with the following details:

• Direct Connection Type

• Baud rate of 9600

• 1 Stop Bit

• Even Parity

• 8 Data Bits.
Figure 2: Driver Configuration

Below is a list of valid PLC Models that can be entered:

PLC Model Description


TSX Quantum TSX Quantum PLC
TSX Momentum TSX Momentum PLC
TSX Premium TSX Premium PLC
Generic 4 Modbus PLC with a four digit register size
Generic 5 Modbus PLC with a five digit register size
Generic 6 Modbus PLC with a six digit register size
G4 Modbus PLC with a four digit register size
G5 Modbus PLC with a five digit register size
G6 Modbus PLC with a six digit register size

Create an IO Tag
1. Select Special/Tagname Dictionary from the Windowmaker menu.

2. Select New

3. Select Type then select I/O Integer

4. Enter a Tagname

5. Select Access Name then select the Access Name that has been assigned to the IO Driver above. In
this example the Access name is modbusPLC.

6. Enter a valid 6 digit Modbus address in the Item box. In this example, the first holding register is
used (400001).

Figure 3: Tagname Configuration

7. Select Save then Close.

Create an InTouch Window

1. Create a new window in WindowMaker.

2. Place a pound sign on the window the double click the # sign.

3. Select an Analog Value Display.

4. Enter the Tagname defined above in the Expression field.


Figure 4: Value Display

5. Select OK then save the window.

6. Close WindowMaker.

Publish the Application

1. Right-click on the Compact Panel InTouch application then select Validate / Publish Compact
Edition Application. The application should validate without errors.

2. Select Publish. When Publish is complete select Download.

3. Connect then send the InTouch application to the Compact Panel. When this is complete, run the application.

Troubleshooting

Use the following MODBU built-in items to help troubleshoot issues between the MODBU IO Driver and the PLC:

1. $Sys$ReadStatus - This tag contains an error code for a failed read operation from the PLC.

2. $Sys$WriteStatus - This tag contains an error code for a failed write operation from the PLC.

You can configure the above as IO Integer tags in your InTouch application. The tags can then be displayed in a window
and will contain an error code.

The following table lists available error codes, code descriptions, and possible causes:

Code Description Possible Cause


0 OK Communication without problems
1 Invalid Serial Port The serial port specified is invalid
2 Invalid or unsupported item name Item name specified is either invalid or unsupported
3 Invalid data value Specified item name does not exist on the device so protocol received invalid data
4 Equipment failed Equipment failed or out of order
5 Ack Ack action error during communication
6 Equipment in use Command invalid when equipment is in use
7 Negative Ack Ack action error during communication
8 Memory parity error Invalid communication parameter
9 Out of memory There is not enough memory for the I/O Server
10 Invalid or unsupported item name Item name specified is either either invalid or unsupported
11 Invalid or unsupported item name Item name specified is either either invalid or unsupported
12 Invalid block size Internal error when generating the protocol block sizes
13 Invalid CRC Invalid CRC in response message
14 Time out waiting CTS CTS signal was not received, could not send request
15 Time out waiting to start a message Response was not received from the device
16 Time out waiting for a message to finish Started receiving a response but the communication was suspended
17 Time out between rx char Response was not received from the device
18 Invalid BCD value Tried reading an invalid BCD value
19 Invalid BCD value Tried writing a negative BCD value
20 Invalid word swap Tried swap word with invalid type
32 Time out waiting for a tx message to finish Started receiving a response but the communication was suspended
33 Invalid driver configuration file Internal error
34 Invalid or unsupported item name Item name specified is either invalid or unsupported
35 Driver API not initialized Internal error
36 Invalid or unsupported item name Item name specified is either invalid or unsupported
37 Invalid or unsupported item name Item name specified is either invalid or unsupported
38 Invalid station Station specified for this driver is invalid
39 Invalid block size Internal error when generating the protocol block sizes
-15 Time out start message Disconnected cables. PLC is turned off, in stop mode, or in error mode. Wrong station number, wrong RTS/CTS control settings.
-17 Time out between rx char PLC in stop mode or in error mode. Wrong station number, wrong parity, wrong RTS/CTS control settings.

For more troubleshooting information refer to the InTouch Compact Edition MODBU Configuration Guide.

G. Alldredge

Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest,
CA 92630. There is also technical information on our software products at www.wonderware.com/support/mmi

back to top

©2009 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by
any means, electronic or mechanical, including photocopying, recording, broadcasting, or by anyinformation storage and retrieval system, without
permission in writing from Invensys Systems, Inc. Terms of Use.

Вам также может понравиться