Está en la página 1de 25

Driver

Contents

Contents

MODBU DRIVER....................................................................................................... 3
Driver specifications.......................................................................................................................................................................4
Configuring the device's communication settings......................................................................................................................... 6
Adding a communication driver to your project............................................................................................................................ 7
Configuring the driver's communication settings.......................................................................................................................... 8
Serial encapsulation for a modem connection.................................................................................................................... 10
Serial encapsulation for a TCP/IP or UDP/IP connection................................................................................................... 11
About driver worksheets..............................................................................................................................................................13
Adding and configuring a Standard Driver Sheet................................................................................................................13
Configuring the Main Driver Sheet...................................................................................................................................... 18
Checking the Driver Runtime task.............................................................................................................................................. 21
Troubleshooting............................................................................................................................................................................22
Revision history........................................................................................................................................................................... 24

Page 2

MODBU Driver

MODBU Driver
MODBU Driver for Serial Communication with Devices Using the Modbus Protocol (version 10.4, last revised
16 Sep 2010).
The MODBU driver enables communication between the Studio system and remote devices using the Modbus
protocol, according to the specifications discussed in this document.
This document assumes that you have read the "Development Environment" section in the main Studio
documentation.
This document also assumes that you are familiar with the Microsoft Windows XP/Vista/7 environment.
If you are not familiar with Windows, then we suggest using the Help and Support feature (available from the
Windows Start menu) as you work through this document.

Page 3

MODBU Driver

Driver specifications
This section identifies all of the software and hardware components required to implement communication
between the MODBU driver in Studio and remote devices using the Modbus protocol.

Driver files
The MODBU driver package comprises the following files, which are automatically installed in the Drv folder
of the Studio application directory:

MODBU.DLL: Compiled driver.

MODBU.INI: Internal driver file. You must not modify this file.

MODBU.MSG: Internal driver file defining error messages for the possible error codes. (These error codes are
described in detail in the Troubleshooting section.) You must not modify this file.

MODBU.PDF: This document, which provides complete information about using the driver.
Note: You must use a compatible PDF reader to view the MODBU.PDF file. You can install Acrobat
Reader from the Studio installation CD, or you can download it from Adobe's website.

You can use the MODBU driver on the following operating systems:

Windows XP/Vista/7

Windows Server 2003/2008

Windows Embedded Compact 5.x/6.x

Device specifications
To establish communication, your target device must meet the following specifications:

Manufacturer: Any device using the Modbus protocol for serial communication

Compatible Equipment: Any device that is compatible with the Modbus protocol

Programmer Software: It depends on the device

The MODBU driver supports the following device registers:


Supported registers
Register Type

Length

Write

Read

Bit

Integer

Float

DWord

BCD

BCD DW

String

0x (Coil Status)

1 Bit

1x (Input Status)

1 Bit

3x (Input Register)

1 Word

4x (Holding Register)

1 Word

Network specifications
To establish communication, your device network must meet the following specifications:

Page 4

Device Communication Port: Modbus Serial Port

Physical Protocol: RS232/RS845

Logic Protocol: Modbus

Device Runtime Software: None

Specific PC Board: None

Cable Wiring Scheme: It depends on the device

MODBU Driver

Conformance testing
The following hardware/software was used for conformance testing:

Driver Version: 10.4

Studio Version: 6.1+SP6

Operating System (development): Windows XP

Operating System (target): Windows XP, Windows Embedded Compact 6.0

Equipment: Automation Direct DL05

Communication Settings:

Modbus Port: 1

Baud Rate: 9600

Protocol: RTU

Data Bits: 8

Stop Bits: 1

Parity: Odd

COM Port: COM1

Cable: Use specifications described in the "Network Specifications" section above.

Page 5

MODBU Driver

Configuring the device's communication settings


This section explains how to configure the communication settings for the remote device.
Because there are several brands of equipment that use the Modbus protocol, it is impossible to define a
standard device configuration. Therefore, we suggest using the following default configuration:

Page 6

Protocol: RTU

Baud Rate: 9600

Data Bits: 8

Stop Bits: 1

Parity: None

MODBU Driver

Adding a communication driver to your project


This section explains how to add a communication driver to your project.
1. On the Insert tab of the ribbon, in the Communication group, click Add/Remove Driver.
The Communication Drivers dialog is displayed.

Communication Drivers dialog


2. In the Available drivers list, click the communication driver that you want to add.
3. Click Select.
The driver is added to the Selected drivers list.
4. Click OK.
The Communication Drivers dialog is closed and the selected driver is inserted in the Drivers folder in the
Project Explorer.

Page 7

MODBU Driver

Configuring the driver's communication settings


This section explains how to configure the communication settings for the driver.
You must add the communication driver to your project before you can configure its settings. For more
information, see Adding a communication driver to your project on page 7.
The general procedure for configuring a driver's communication settings is the same for all drivers. However,
the specific settings are different for each driver, depending on the options and protocols used by the target
device.
To configure the communication settings:
1. In the Comm tab of the Project Explorer, expand the Drivers folder.
The folder contains the drivers that are currently enabled. If you do not see the driver that you want to
configure, then you need to add it.
2. Right-click the driver that you want to configure, and then click Settings on the shortcut menu.
The Communication Settings dialog is displayed.

Communication Settings: MODBU dialog


3. From the Serial Encapsulation list, select the type of encapsulation that should be used, and then configure
the port/connection settings as needed.
Encapsulation allows raw serial communication to be sent over other types of network connections.
Option

Description

None

Serial communication is not encapsulated;


standard serial port settings are used. Configure
the settings to match the target device.

Modem

Encapsulate to send over a dial-up modem


connection. For more information, see Serial
encapsulation for a modem connection on page
10.

TCP/IP or UDP/IP

Encapsulate to send over a TCP/IP or UDP/IP


Ethernet connection. For more information, see
Serial encapsulation for a TCP/IP or UDP/IP
connection on page 11.

Note: Most of the serial communication drivers should work with every serial encapsulation
mode. However, most of the drivers were developed before the serial encapsulation feature was
added to the software, so they may not have been thoroughly tested. If you have problems with
serial encapsulation on a specific driver, please contact Technical Support.
4. Configure the remaining, driver-specific settings as needed.

Page 8

MODBU Driver

Driver-specific settings for MODBU


Setting

Default Value

Possible Values

Description

Signed/Unsigned

Unsigned

Unsigned (legacy)
Signed (legacy)

Do not use these options. They are


included only to maintain compatibility with
older versions.

Unsigned

Do not allow negative values:

Signed

Swap - Write Type

RTU

No Swap / Write
Item

Integer: 0 to 65535

DWord: 0 to 4294967295

Allow negative values:

Protocol (ASCII or RTU)

This setting only works with


the 3X, 4X, DW, DWS, DW3,
DW3S, and ID register types.

Integer: -32768 to 32767


DWord: -2147483648 to

2147483647

ASCII

Each 8-bit Word is sent as two 4-bit ASCII characters, allowing for a time
interval between characters without causing errors.

RTU

Each 8-bit Word is sent as two 4-bit hexadecimals, allowing for greater
density and faster throughput. In most cases, we recommend using this
protocol.

No Swap or Swap

This setting enables or disables the Swap Word order in the Read and Write
commands. Note that it only works with the FP, FPS, FP3, FP3S, DW, DWS,
DW3, and DW3S register types.

Write Item or Write


Group

This setting chooses the function 0x06 (Preset Single Register) or 0x10
(Preset Multiple Registers) to write:

Write Item:

Write on tag change (Standard Driver Sheet) and Write (Main


Driver Sheet) use the Modbus function 0x06.

Write Trigger (Standard Driver Sheet) uses the Modbus function


0x10.

Write Group: Any writing in the driver uses the Modbus function 0x10.

For more information about the functions, please consult the Modbus protocol
documentation.
Block Size / (EROxxx):MaxGap

64

0 to 512

The nominal size (in Words) of each block of data to be transmitted, as


determined by the processing capacity of the device. A configured Block
Size of 1 will send one item.

ERO-xxx

Address used to set equipment to Local or Remote. (Used for ERO


equipment only.)

0 to 512

This setting is used with Main Driver Sheet and configures the gap size
between two addresses that could belong to the same group or block
according to the Block Size but, if there are no other I/O addresses between
them and their addresses difference is bigger than the gap, then they will end
up in separated virtual read groups. This setting can never be higher than the
Block Size.

(Max Gap)

5. Click OK.
The settings are saved and the Communication Settings dialog is closed.

Page 9

MODBU Driver

Serial encapsulation for a modem connection


Most of the serial drivers allow the use of modem connections. The modem connection has been designed to
enable communications with remote serial devices connected through a phone line. The following diagram
provides one example of applying this solution:

Modem connection
You can enable the modem connection by following the steps below:
1. Right-click on the driver's folder, and then choose Settings from the shortcut menu.
This will give you access to the communication parameters.
2. In the Serial Encapsulation menu, select Modem:

Caution: The Modem option is not supported for Pocket PC v3.00 or older.
The following fields are available:

Name drop-down list: Select the modem that the driver will use to establish the connection. If you do not
know the modem name, use the Auto Detect option. The Auto Detect 1 will use the first modem available, Auto
Detect 2 will use the second, Auto Detect 3 will use the third, and Auto Detect 4 will use the fourth.

Phone field: Enter a phone number that the driver will use to connect to the remote device. This field
accepts tags between curly brackets.

Settings button: Click on this button to configure the modem settings. The window that displays when you
click on this button depends on the operating system that you are using and on the modem type.
Caution: The settings configured by clicking on this button are not saved with your project. The
information is saved on the operating system registry, and they are valid only in the computer
that you are interacting with. If you install your project on another computer, you will have to
reconfigure these settings.

Page 10

MODBU Driver

Connection button: Click to open the Connection Control window. The default connection settings should
suffice for most of the projects. However, you can take full control over the connection, and also enable
incoming calls, by clicking on this button.

Connection Control dialog

Dial out trigger field: When the value of the tag configured in this field changes, the driver will try to
connect to the remote device. If the connection has already been established, the command is ignored.
You do not have to use this field if you are using Auto Connect.

Hang up trigger field: When the value of the tag configured in this field changes, the driver will disconnect
from the remote device. If the device is disconnected the command is ignored. You do not have to use
this field if you are using Disconnect call if idle for more than.

Auto Connect field: When this option is enabled, the driver will try to connect to the remote device before
sending any information. If the connection fails, the next attempt will be made after the Retry Interval
has expired.

Disconnect call if idle for more than field: When this option is checked, the driver will automatically disconnect
from the remote device if no communication is performed after the time you specified.

Enable incoming calls field: Check this option if you want to enable the driver to receive calls from the
remote device. You can use the Hang up trigger to drop the call once it has been established. Notice
that one driver can use both incoming calls and outgoing calls.

Status area

Code field: Enter with a tag that will receive one of the following codes when the driver is running:

0 = Disconnected

1 = Connected

2 = Dialing

3 = Dropping

4 = Closing Line

Description field: Enter with a tag that will receive a complete description of the current status. The
description is associated with the Code field; however, it brings some additional information about the
current status.

Serial encapsulation for a TCP/IP or UDP/IP connection


Most of the serial drivers allow the use of TCP/IP or UDP/IP encapsulation. The encapsulation mode has
been designed to provide communication with serial devices connected to terminal servers on your ethernet
or wireless networks. A terminal server can be seen as a virtual serial port. It converts TCP/IP or UDP/IP
messages on your Ethernet or Wireless network to serial data. Once the message has been converted to a

Page 11

MODBU Driver

serial form, you can connect standard devices that support serial communications to the terminal server. The
following diagram provides one example of applying this solution:

Serial encapsulation over a TCP/IP or UDP/IP link


You can enable the encapsulation by following the steps below:
1. Right-click on the driver's folder, and then choose Settings from the shortcut menu.
This will give you access to the communication parameters.
2. In the Serial Encapsulation field, select TCP/IP or UDP/IP:

The following fields are available:

Page 12

IP Address field: Specify the IP Address for the Terminal Server. This field accepts tags in curly brackets.

Port Number field: Enter the TCP/IP or UDP/IP port number.

Status Tag field: This field is available only when using TCP/IP. The tag on this field receives the value 1
when the TCP/IP connection is established; otherwise, it receives 0.

Server Mode field: The TCP/IP encapsulation allows the Server Mode, making the remote client responsible
for establishing the connection to enable the communication.

MODBU Driver

About driver worksheets


Like the other parts of your project, communication with remote devices is controlled by worksheets. This
section explains how to add worksheets to your project and then configure them to associate project tags with
device registers.
Each selected driver includes a Main Driver Sheet (MDS) and one or more Standard Driver Sheets (SDS).
The Main Driver Sheet is used to define tag/register associations and driver parameters that are in effect at
all times, regardless of project behavior. In contrast, Standard Driver Sheets can be inserted to define tag/
register associations that are triggered by specific project behaviors.
The configuration of these worksheets is described in detail in the "Communication" chapter of the Technical
Reference Manual, and the same general procedures are used for all drivers. Please review those procedures
before continuing.
For the purposes of this document, only MODBU driver-specific parameters and procedures are discussed
here.

Adding and configuring a Standard Driver Sheet


By default, a communication driver does not include any Standard Driver Sheets. This section explains how to
add a Standard Driver Sheet to your project and then configure it.
The MODBU driver must be added to the project before you can configure any of its worksheets. For more
information, see Adding a communication driver to your project on page 7.
Standard Driver Sheets can be inserted to define additional tag/register associations that are triggered by
specific project behaviors.
Note: Most of the settings on this worksheet are standard for all drivers; for more information about
configuring these settings, see the Communication chapter of the Technical Reference Manual. The
Station and I/O Address fields, however, use syntax that is specific to the MODBU driver.
1. Do one of the following.

On the Insert tab of the ribbon, in the Communication group, click Driver Sheet and then select MODBU from
the list.

In the Comm tab of the Project Explorer, right-click the MODBU folder and click Insert on the shortcut
menu.

Page 13

MODBU Driver

A new MODBU driver worksheet is inserted into the MODBU folder, and then it is automatically opened for
configuring.

Standard Driver Sheet


Note: Worksheets are numbered in order of creation, so the first worksheet is MODBU001.drv.
2. Configure the Station and Header fields as described below.
Station
Specify the ID number (or node) of the target Modbus device, using the following syntax:
<ID_number>
where <ID_number> is a value between 0 and 247.
Examples:
57
You can also specify an indirect tag (e.g. {MyStation}), but the tag that is referenced must
follow the same syntax and contain a valid value.
Note: You cannot leave the Station field blank.
Header
Specify the address of the first register of a block of registers on the target device. The addresses
declared in the body of the worksheet are simply offsets of this Header address. When Read
and Write actions are executed for the entire worksheet (using Read Trigger and Write Trigger,
respectively), it scans the entire block of registers from the first address to the last.
The Header field uses the following syntax:
<Type>:<AddressBase>
Where:
<Type>
Register type. Valid values are:

Page 14

0X

MODBU Driver

1X

STA

3X

4X

FP

FP3

FP3S

DW

FPS

DWS

DW3

DW3S

BCD

BCD3

BCDDW

BCDDWS

BCDDW3

BCDDW3S

ID

ST

STS

<AddressBase>
The address of the first register in the block of registers that will be scanned by this worksheet.
After you edit the Header field, the development application checks the syntax to determine if it is
valid. If the syntax is invalid, then the development application automatically inserts a default
value of 0X:0.
You can also specify an indirect tag (e.g. {MyHeader}), but the tag that is referenced must follow
the same syntax and contain a valid value.
The following table lists all of the register types and address ranges that are valid for the Header
field:
Valid addresses for Header field
Register Type

Sample
Header

Valid Range of Initial


Addresses

Comments

0X

0X:0

Varies according to equipment

Coil status: Reads and writes events using Modbus instructions 01,
05, and 15.

1X

1X:0

Varies according to equipment

Input status: Reads events using Modbus instruction 02.

STA

STA:0

Varies according to equipment

Exception Status: Reads events using Modbus instruction 07.

3X

3X:0

Varies according to equipment

Input register: Reads events using Modbus instruction 04.

4X

4X:0

Varies according to equipment

Holding register: Reads and writes events using Modbus instructions


03, 06 and 16.

FP

FP:0

Varies according to equipment

Floating-point value (Holding Register): Reads and writes floatingpoint values using two consecutive Holding Registers.

Page 15

MODBU Driver

Register Type

Sample
Header

Valid Range of Initial


Addresses

Comments

FPS

FPS:0

Varies according to equipment

Floating-point value (Holding Register): Reads and writes floatingpoint values using two consecutive Holding Registers with Byte
Swap.

FP3

FP3:0

Varies according to equipment

Floating-point value (Input Register): Reads floating-point values


using two consecutive Input Registers.

FP3S

FP3S:0

Varies according to equipment

Floating-point value (Input Register): Reads floating-point values


using two consecutive Input Registers with Byte Swap.

DW

DW:0

Varies according to equipment

Dword value (Holding Register): Reads and writes Dword values


using two consecutive Holding Registers.

DWS

DWS:0

Varies according to equipment

Dword value (Holding Register): Reads and writes Dword values


using two consecutive Holding Registers with Byte Swap.

DW3

DW3:0

Varies according to equipment

Dword value (Input Register): Reads Dword values using two


consecutive Input Registers.

DW3S

DW3S:0

Varies according to equipment

Dword value (Input Register): Reads Dword values using two


consecutive Input Registers with Byte Swap.

BCD3

BCD3:0

Varies according to equipment

BCD value (Input Register): Reads events using Modbus instruction


04.

BCD

BCD:0

Varies according to equipment

BCD value (Holding Register): Reads and writes events using


Modbus instructions 03, 06 and 16.

BCDDW

BCDDW:0

Varies according to equipment

BCD 32-bit integer value (Holding Register): Reads and writes 32-bit
integer values using two consecutive Holding Registers.

BCDDWS

BCDDWS:0

Varies according to equipment

BCD 32-bit integer value (Holding Register): Reads and writes 32bit integer values using two consecutive Holding Registers with Byte
Swap.

BCDDW3

BCDDW3:0

Varies according to equipment

BCD 32-bit integer value (Input Register): Reads 32-bit integer values
using two consecutive Input Registers.

BCDDW3S

BCDDW3S:0 Varies according to equipment

BCD 32-bit integer value (Input Register): Reads 32-bit integer values
using two consecutive Input Registers with Byte Swap.

ID

ID:0

Varies according to equipment

Report Slave ID using Modbus instruction 17.

ST

ST:0

Varies according to equipment

String value (Holding Register): Reads and writes String values using
consecutive Holding Registers.

STS

STS:0

Varies according to equipment

String value (Holding Register): Reads and writes String values using
consecutive Holding Registers with Byte Swap.

3. For each tag/register association that you want to create, insert a row in the worksheet body and then
configure the row's fields as described below.
Tag Name
Type the name of the project tag.
Address
Specify the address of the associated device register.
For all register types other than ST/STS (String), use the following syntax:
{ | { S | U } }AddressOffset{ | .Bit }
For ST/STS (String) register types only, use the following syntax:
AddressOffset:Length
Where:
Signed/Unsigned
Optional parameter used for integer values only. Valid values are S (Signed) and U (Unsigned).
If you do not specify this parameter, then the project uses the default from the driver's
communication settings.
AddressOffset

Page 16

MODBU Driver

Parameter that is added to the AddressReference parameter of the Header, to compose the
specific address of the register in the block. The sum of the two parameters cannot equal zero
(0); Modbus operands must start in an address that is greater than zero.
Bit
Use this optional parameter only for 3X (Input Register) and 4X (Holding Register) types, to
indicate which bit on the register will be read from and/or written to.
Length
Length of the string (in bytes) to be read or written.
You can also specify an indirect tag (e.g. {MyAddress}), but the tag that is referenced must
follow the same syntax and contain a valid value.
Note:

The floating-point value is stored in two consecutive Holding Registers, where


the address value corresponds to the first Holding Register position. You must
ensure that you do not configure a non-existent address, or a conflict will
occur.

The floating-point values are 4 bytes using 6 significant digits.

You must not configure a range of addresses greater than the maximum block
size (data buffer length) supported by the target device. The default block size
is 64 bytes, but this can be changed in the driver's communication settings.

For DWord registers (DW, DWS, DW3 and DW3S) using the unsigned option in
the Address field, the associated project tag must be Real type.

Note: Each Standard Driver Sheet can have up to 4096 rows. However, the Read Trigger, Enable
Read When Idle, and Write Trigger commands attempt to communicate the entire block of addresses
that is configured in the sheet, so if the block of addresses is larger than the maximum block
size that is supported by the driver protocol, then you will receive a communication error (e.g.,
"invalid block size") during run time. Therefore, the maximum block size imposes a practical limit
on the number of rows in the sheet.
For examples of how device registers are specified using Header and Address, see the following table.
Examples of Header and Address fields in Standard Driver Sheet
Device Register

Header

Address

00001

0X:1

00010

0X:0

10

01020

0X:1000

20

10001

1X:1

10010

1X:0

10

11020

1X:1000

20

30001

3X:1

30010

3X:0

10

31020

3X:1000

20

30000 and 30001

FP3:0

31001 and 31000

FP3S:0

1000

40001

4X:1

40010

4X:0

10

41020

4X:1000

20

Page 17

MODBU Driver

Device Register

Header

Address

40010 (bit 0)

4X:0

10.0

41010 (bit 7)

4X:1000

10.7

40001 and 40002

FP:1

40013 and 40014

FP:0

13

41021 and 41022

FP:1000

21

40001 and 40002

DW:1

40013 and 40014

DW:0

13

For more information about the device registers and addressing, please consult the manufacturer's
documentation.
4. Save and close the worksheet.

Configuring the Main Driver Sheet


When you add the MODBU driver to your project, the Main Driver Sheet is automatically included in the
MODBU folder in the Project Explorer. This section describes how to configure the worksheet.
The MODBU driver must be added to the project before you can configure any of its worksheets. For more
information, see Adding a communication driver to your project on page 7.
The Main Driver Sheet is used to define tag/register associations and driver parameters that are in effect at all
times, regardless of project behavior. The worksheet is continuously processed during project runtime.
Note: Most of the settings on this worksheet are standard for all drivers; for more information about
configuring these settings, see the Communication chapter of the Technical Reference Manual. The
Station and I/O Address fields, however, use syntax that is specific to the MODBU driver.
1. Do one of the following.

On the Insert tab of the ribbon, in the Communication group, click Main Driver Sheet and then select MODBU
from the list.

In the Comm tab of the Project Explorer, expand the MODBU folder and then double-click MAIN DRIVER
SHEET.

The Main Driver Sheet is displayed.

Main Driver Sheet


2. For each tag/register association that you want to create, insert a row in the worksheet body and then
configure the row's fields as described below.

Page 18

MODBU Driver

Tag Name
Type the name of the project tag.
Station
Specify the ID number (or node) of the target Modbus device, using the following syntax:
ID_number
where ID_number is a value between 0 and 247.
Examples:
57
You can also specify an indirect tag (e.g. {MyStation}), but the tag that is referenced must
follow the same syntax and contain a valid value.
Note: You cannot leave the Station field blank.
I/O Address
Specify the address of the associated device register.
For all register types other than ST/STS (String), use the following syntax:
Type:{ | { S | U } }Address{ | .Bit }
For ST/STS (String) register types only, use the following syntax:
{ ST | STS }:Address:Length
Where:
Type
Register type. Valid values are:

0X

1X

STA

3X

4X

FP

FP3

FP3S

DW

FPS

DWS

DW3

DW3S

BCD

BCD3

BCDDW

BCDDWS

BCDDW3

BCDDW3S

ID

ST

Page 19

MODBU Driver

STS

Signed/Unsigned
Optional parameter used for integer values only. Valid values are S (Signed) and U (Unsigned).
If you do not specify this parameter, then the project uses the default from the driver's
communication settings.
Address
Address of the device register.
Bit
Use this optional parameter only for 3X (Input Register) and 4X (Holding Register) types, to
indicate which bit on the register will be read from and/or written to.
Length
Length of the string (in bytes) to be read or written.
Examples:
4X:20
4X:S15
4X:10.7
ST:10:5
You can also specify an indirect tag (e.g. {MyAddress}), but the tag that is referenced must
follow the same syntax and contain a valid value.
Note:

For DWord registers (DW, DWS, DW3 and DW3S) using the unsigned option in
the I/O Address field, the associated project tag must be Real type.

The floating-point values are 4 bytes using 6 significant digits.

Note: The Main Driver Sheet can have up to 32767 rows. If you need to configure more than
32767 communication addresses, then either configure additional Standard Driver Sheets or
create additional instances of the driver.
3. Save and close the worksheet.

Page 20

MODBU Driver

Checking the Driver Runtime task


This section describes how to check the status of the Driver Runtime task in the list of execution tasks.
The Driver Runtime task handles communication with remote devices and the processing of the driver
worksheets. By default, the task is configured to start up automatically when the project is run, but you can
check it for yourself.
1. On the Home tab of the ribbon, in either the Local Management or the Remote Management group (depending on
where you project server will be running), click Tasks.
The Project Status dialog is displayed.

Project Status dialog


2. Verify that the Driver Runtime task is set to Automatic.

If the setting is correct, then proceed to the next step.

If the Driver Runtime task is set to Manual, select the task and then click Startup to change the task to
Automatic.

3. Click OK to close the Project Status dialog.

Page 21

MODBU Driver

Troubleshooting
This section lists the most common errors for this driver, their probable causes, and basic procedures to
resolve them.

Checking status codes


If the MODBU driver fails to communicate with the target device, then the database tag(s) that you configured
for the Read Status and Write Status fields of the driver sheets will receive a status code. Use this status code and
the following tables to identify what kind of failure occurred and how it might be resolved.
Status codes for MODBU driver
Status Code

Description

Possible Causes

Procedure To Solve

OK

Communication without problems

None required

Illegal data value

Tried to read an address that is not present in


the PLC, such as 49999

Specify a valid address.

Invalid data values

Specified address does not exist on the device


so protocol received invalid data

Verify that specified address exists on the device.

Equipment failed

Equipment failed or out of order

Check equipment state.

Ack

The PLC may be busy and sent this Ack to


acknowledge that it received the message but
is unable to respond at the time

Wait until the PLC is available again and restart communicating


with it

Equipment in use

Command invalid when equipment is in use

Studio commands cannot generate this error.

Negative Ack

Ack action error during communication

Check device and Studio Communication Parameters.

Memory parity error

Invalid Communication Parameter

Check driver Communication Parameters.

10

Invalid Header field

Specified invalid tag value in Header field

Specify a valid Header tag value.

11

Invalid Address field

Specified invalid address

Specify a valid address.

12

Invalid block size

Offset greater than maximum allowed

Specify a valid offset or create a new worksheet. Typically,


maximum offset is 64.

13

Invalid CRC

Invalid CRC in response message

Check the cable wiring.

Check the station number.

Check the RTS/CTS configuration.

18

Invalid BCD value

Tried reading an invalid BCD value

Verify that PLC value is valid.

19

Invalid BCD value

Tried writing a negative BCD value

Only positive BCD values are valid.

100

Illegal operation

Tried to write to read-only addresses (1x and


3x)

Writing operations are possible only in Coil Status and Holding


Registers areas.

-15

Timeout start message

Disconnected cables

Check cable wiring.

-17

Timeout between Rx
characters

PLC is turned off, in stop mode, or in


error mode

Check the PLC mode it must be RUN.

Wrong station number

Check the station number.

Wrong parity

Check the RTS/CTS configuration.

Wrong RTS/CTS configuration

Check the maximum registers configuration.

Common status codes


Status Code
0

Page 22

Description

Possible Causes

Procedure To Solve

OK

Communicating without error.

None required.

MODBU Driver

Status Code
-15

Description

Possible Causes

Procedure To Solve

Timeout waiting for message


to start

Disconnected cables.

Check cable wiring.

PLC is turned off, in stop mode, or in


error mode.

Check the PLC mode it must be RUN.

Wrong station number.

Check the station number.

Wrong parity (for serial communication).

Increase the timeout in the driver's advanced settings.

Wrong RTS/CTS configuration (for serial


communication).

Check the RTS/CTS configuration (for serial


communication).

Monitoring device communications


You can monitor communication status by establishing an event log in Studio's Output window (LogWin
module). To establish a log for Field Read Commands, Field Write Commands and Serial Communication,
right-click in the Output window and select the desired options from the pop-up menu.
You can also use the LogWin module to establish an event log on a remote unit that runs Windows
Embedded. The log is saved on the unit in the celog.txt file, which can be downloaded later.
If you are unable to establish communication between Studio and the target device, then try instead to
establish communication using the device's own programming software. Quite often, communication is
interrupted by a hardware or cable problem or by a device configuration error. If you can successfully
communicate using the programming software, then recheck the driver's communication settings in Studio.

Contacting Technical Support


If you must contact Technical Support, please have the following information ready:

Operating System and Project Information: To find this information, click Support in the Help tab of the
ribbon.

Driver Version and Communication Log: Displays in the Output window (LogWin module) when the
driver is enabled and the project is running is running.

Device Model and Boards: Consult the hardware manufacturer's documentation for this information.

Page 23

MODBU Driver

Revision history
This section provides a log of all changes made to the driver.
Revision history
Driver
Version

Revision Date

Description of Changes

Author

2.02

30 Jul 1999

First driver version

Roberto V. Junior

Driver available for Windows CE

2.03

13 Dec 1999

Added Read and Write of Floating-point operand

Roberto V. Junior

2.04

05 Jun 2000

Added CRC verification of device response

Roberto V. Junior

2.05

30 Oct 2000

Added MAIN DRIVER SHEET feature

Loureno Teodoro

2.06

14 Nov 2001

Added FPS, FP3, and FP3S data type

Loureno Teodoro

Changed Ero functionality

Added bit read/write to 4x and 3x data type

Fixed bug that caused 100% CPU usage when a message was
waiting in a timeout situation

Added a warning message in the LogWin when the


AddressReference in Header field plus the lowest AddressOffset in
Address column is equal to zero

2.07

Page 24

21 Feb 2002

Roberto V. Junior

2.08

22 Aug 2003

Added DW data type

Eric Vigiani

2.09

11 Dec 2003

Implemented Signed/Unsigned option by address

Eric Vigiani

Added DW3 data type

2.10

25 May 2004

Implemented writing group commands when writing FP values

Eric Vigiani

2.11

14 Jun 2004

Added DWS and DW3S data types

Fbio H.Y. Komura

Implemented SwapWord for FP, FPS, FP3, FP3S, DW, DWS, DW3
and DW3S

Changed FP, FPS, FP3, FP3S, DW, DWS, DW3 and DW3S with
and without SwapWord to conformance to standards (FPS, FP3S,
DWS and DW3S are data types with Byte Swap)

2.12

03 Sep 2004

Added BCD, BCD3, BCDDW, BCDDWS, BCDDW3 and BCDDW3S data


type.

Fbio H.Y. Komura

2.13

24 Sep 2004

Fixed problem with Parser Address

Fbio H.Y. Komura

2.14

19 Jan 2005

Insert String type

Leandro Coeli

2.15

19 Feb 2005

Implemented LRC to ASCII communication

Leandro Coeli

2.16

26 Apr 2005

Implemented configurable Block Size

Leandro Coeli

2.18

12 Jun 2006

Implemented to check the Station into the Rx messages

Graziane C. Forti

Implemented the Unsigned in all header

Implemented Block size 1 using MDS

2.19

31 Aug 2006

Fixed problem with the ST header

Eric Vigiani

2.20

28 Nov 2006

Implemented STS Header

Graziane C. Forti

Fixed problem BCDDW, BCDDWS, BCDDW3, BCDW3S and ST


using Block Size=1

MODBU Driver

Driver
Version

Revision Date

Description of Changes

Fixed problem S/U address configuration (types that this operation


is not allowed)

Implemented Block size 1 using MDS

Fixed problem ST/STS using write trigger (SDS)

Fixed problem to calculate LRC - ASCII protocol

Changed Maximum Range (exception problem)

Fixed the String writing

Author

2.21

19 Jan 2007

Implemented Unsigned/Signed to work like version 2.16 as well, using


ComboBox

Graziane C. Forti

2.22

21 Feb 2008

Removed the error Invalid Word Swap for ST and STS header.

Eric Vigiani

10.1

07 Jan 2009

Updated driver version, no changes in the functionality

Marcelo Carvalho

10.3

01 Jul 2009

Modified driver to properly handle error codes sent by the PLC

Fellipe Peternella

Modified driver to support communication with multiple Stations


when using Serial Encapsulation over TCP/IP or UDP/IP

10.4

16 Sep 2010

Improved driver reliability

Andr Krbes

Page 25

También podría gustarte