Mod Bus Ascii
Mod Bus Ascii
Table of Contents
Modbus ASCII Serial / Modicon Serial Device Driver Guide 1-1
1. Modbus ASCII Serial Device Communications 2
1.1 Introduction to Modbus ASCII Serial ................................................ 2
1.1.1 Modbus ASCII Serial: RS-232, RS-422 and RS485............. 2
1.1.2 Wiring and Cabling Requirements ....................................... 3
1.1.3 Ease of Use: Parameters .................................................... 4
1.1.4 Redundant Comports.......................................................... 5
1.1.5 Modbus Protocols ............................................................... 5
1.1.5.1 Modbus ASCII................................................................... 5
1.1.5.2 Modbus RTU..................................................................... 5
1.1.5.3 Modbus Ethernet / TCP/IP ................................................ 5
1.2 Configure Modicon / Modbus device ............................................... 6
1.3 Serial Comport Properties ............................................................... 7
1.3.1 Comport Number ................................................................ 7
1.3.2 Description ......................................................................... 7
1.3.3 Baud Rate .......................................................................... 8
1.3.4 Data Bits............................................................................. 8
1.3.5 Stop Bits ............................................................................. 8
1.3.6 Parity .................................................................................. 8
1.3.7 Scan Time .......................................................................... 9
1.3.8 Timeout .............................................................................. 9
1.3.9 Retry Count ........................................................................ 9
1.3.10 Auto Recover Time ........................................................... 10
1.3.11 Hand Shake RTS.............................................................. 10
1.3.12 Hand Shake DTR.............................................................. 11
1.3.13 Backup Port ...................................................................... 11
1.4 Device Properties – Modicon ASCII............................................... 12
1.4.1 Device Name .................................................................... 13
1.4.2 Description ....................................................................... 13
1.4.3 Unit Number ..................................................................... 14
1.4.4 Device Type ..................................................................... 14
1.5 Configure a Tag ............................................................................ 14
Modbus ASCII usually is not used to move pure ASCII string files. For
example, it is not used to move JAN-16-1994. In Modbus ASCII, each eight-
bit byte, in a message, is sent as two ASCII characters.
The computer communication port must be designed for use with the
Windows 32-bit operating system. If a RS-232 port is used, then the port
must contain a FIFO (First-In, First-Out) buffer. If an RS-422 or 485 port is
used, then the hardware card must contain the appropriate communication
chip for Windows use, such as the Intel 16C850.
Modicon and Square-D hardware devices can use a standard pre-built cable
available from Modicon or Square-D distributors. The part number of this
cable is 990NAA26320. It is a RS-232 cable designed for programming use,
however it can also be used to communicate with Advantech WebAccess.
Users can select a parameter type, and then modify the address to the
correct register in order to build a tag.
Modbus Ethernet can also be backed up with a Serial connection (and vice
versa).
Modbus Ethernet network TCP/IP over Ethernet, although any TCP/IP network
connection is supported including the Internet, WANs and LANs. A single IP
address can support up to 255 devices. Serial communications can be
"encapsulated" into TCP/IP packets using Modbus Serial-to-Ethernet gateways.
1.3.2 Description
This is an optional field used for user reference.
Once the start bit has been sent, the transmitter sends the actual data bits.
There may either be 5, 6, 7, or 8 data bits, depending on the number you
have selected. Both receiver and the transmitter must agree on the number
of data bits, as well as the baud rate. Almost all devices transmit data using
either 7 or 8 data bits.
After the data has been transmitted, a stop bit is sent. A stop bit has a value
of 1 - or a mark state - and it can be detected correctly even if the previous
data bit also had a value of 1. This is accomplished by the stop bit's duration.
Stop bits can be 1, 1.5, or 2 bit periods in length. Advantech WebAccess
supports 1 or 2 bits.
1.3.6 Parity
This must match the parity configured in the PLC using the PLC programming
package (supplied by the PLC manufacturer) or dipswitches on the PLC COM
card. All PLCs connected to this comport must use the parity. A typical value
is Even.
Besides the synchronization provided by the use of start and stop bits, an
additional bit called a parity bit is optionally transmitted along with the data.
A parity bit affords a small amount of error checking, to help detect data
corruption that might occur during transmission. You can choose even parity,
odd parity, mark parity, space parity or none at all. When even or odd parity
is being used, the number of marks (logical 1 bits) in each data byte are
counted, and a single bit is transmitted following the data bits to indicate
whether the number of 1 bits just sent is even or odd. Mark parity means that
the parity bit is always set to the mark signal condition and likewise space
parity always sends the parity bit in the space signal condition. Since these
two parity options serve no useful purpose whatsoever, they are almost never
used and are not supported in most Web Access drivers.
If the PLC cannot respond as fast as the SCAN Time entered, Advantech
WebAccess will scan at a slower rate.
1.3.8 Timeout
Timeout is the time waited before re-sending a communications packet that
did not have a reply.
Timeout specifies how long the software waits for a response to a data
request, specifically to wait for a reply from one packet. A recommended
value is 7 to 10 ticks, longer if the communication device is slow. This is
protocol dependent: some protocols do not allow changes in time out.
A note about ModBus ASCII – a one second timeout is standard for many
Modbus ASCII devices. It is rarely smaller and often longer. For many
Modbus ASCII devices timeout is fixed at 1 second. Satellite Technology
routinely sees 2-second delays. 1 to 5 second timeouts are common for
Modbus ASCII
In addition, Indicates the number of times after the first attempt has failed
that communication should be attempted before indicating a failure.
Specifically, how many times to send a single packet after the field device
fails to respond to the first packet. After the retry count is exceeded, all the
tags in the packet are marked with asterisks and the next packet of requests
is sent. A reasonable value is 3 to 5 times. After this number of tries, the tags
in this packet are marked as "fail to respond" (i.e. asterisks) and are disabled.
In reality, increasing the number of retries hides failures on the part of the
field device to respond to a request. Essentially, increasing the retries gives
the field device more chances to reply.
A Personal computer is a DTE device, while most other field devices are
usually DCE devices. If you have trouble keeping the two straight then
replace the term "DTE device" with "SCADA Node" and the term "DCE device"
with "field device" in the following description.
RTS stands for Request To Send. This line and the CTS line are used when
"hardware flow control" is enabled in both the DTE and DCE devices. The DTE
device puts this line in a mark condition to tell the remote device that it is
ready and able to receive data. If the DTE device is not able to receive data
(typically because its receive buffer is almost full), it will put this line in the
space condition as a signal to the DCE to stop sending data. When the DTE
device is ready to receive more data (i.e. after data has been removed from
its receive buffer), it will place this line back in the mark condition. The
complement of the RTS wire is CTS, which stands for Clear To Send. The DCE
device puts this line in a mark condition to tell the DTE device that it is ready
to receive the data. Likewise, if the DCE device is unable to receive data, it
will place this line in the space condition. Together, these two lines make up
what is called RTS/CTS or "hardware" flow control. The Software Wedge
supports this type of flow control, as well as Xon / XOff or "software" flow
control. Software flow control uses special control characters transmitted from
one device to another to tell the other device to stop or start sending data.
With software flow control the RTS and CTS lines are not used
DTR stands for Data Terminal Ready. Its intended function is very similar to
the RTS line. DSR (Data Set Ready) is the companion to DTR in the same way
that CTS is to RTS. Some serial devices use DTR and DSR as signals to simply
confirm that a device is connected and is turned on. The Software Wedge sets
DTR to the mark state when the serial port is opened and leaves it in that
state until the port is closed. The DTR and DSR lines were originally designed
to provide an alternate method of hardware handshaking. It would be
pointless to use both RTS/CTS and DTR/DSR for flow control signals at the
same time. Because of this, DTR and DSR are rarely used for flow control.
The Backup Port is usually configured as the same type (SERIAL) for the
Modbus ASCII protocol.
Add your device to the Serial Port, by selecting the Serial Port you have
configured, then select Add Device.
Important – Use ASCII Protocol – set this to 1. To use the Modbus ASCII
protocol, this must be set to 1. Otherwise, the Modbus RTU protocol (the
default=0) will be used.
Device Name is any user-defined name. See Device Name for more
information.
Unit Number, for Modbus, must correspond to the Unit Number used in the
protocol addressing. See Unit Number for more information.
Packet Delay (ms): Some devices cannot receive very fast request after
they respond previous packet. A delay may be
required for the next request from Advantech
WebAccess for those slow devices, especially for some
old power meters.
Digital block size: Some Modbus compatible devices use only a certain
part of a Modbus address or only handle a short data
range for data request from client. Advantech
WebAccess allows users to define the maximum data
block size for both requested Digital and Analog type
data.
Analog block size: Some Modbus compatible devices use only a certain
part of a Modbus address or only handle a short data
range for data request from client. Advantech
WebAccess allows users to define the maximum data
block size for both requested Digital and Analog type
data.
Changing only the Device Name will rename the existing device.
Changing both the Device Name and the Unit Number will make a copy of
the device (e.g. create another device).
1.4.2 Description
User assigned description up to 70 characters
This Unit Number will appear on the System Status Display, Point Detail,
user-built displays and tags to reference the status of this device.
Changing only the Unit Number here will change the existing device.
Changing both the Device Name and the Unit Number will make a copy of
the device (e.g. create another device).
4. Select Project.
8. From Parameter Pull Down List Select AI. This will configure an
Analog Input. Wait for the Page to update.
9. Optionally, select ALARM from the ALARM pulldown list. Wait for the
Page to update with a PINK highlight around alarm (an additional
Alarm Fields at bottom of page).
10. Enter a Tagname users can use to identify this Analog Input
measurement. For example, if this is a Flow measurement, enter
Flow1.
11. Edit the Address to the actual address. From the example, Enter:
30003
12. Enter a Description. This will help identify this tag to Users and
Operators. For example, enter Boiler #1 Steam Flow.
13. Optionally enter, Scaling, Span Hi, Span Low, Engineering Units, and
Alarms; enable data logging, etc.
15. From Parameter Pull Down List Select AO. This will configure an
Analog Output. Wait for the Page to update.
16. Optionally, select ALARM from the ALARM pulldown list. Wait for the
Page to update with a PINK highlight around alarm (and additional
Alarm Fields at bottom of page).
17. Enter a Tagname users can use to identify this Analog Output
measurement. For example, if this is a signal to a Valve, enter Valve1.
18. Edit the Address to the actual address. From the above example,
Enter: 40015
19. Enter a Description. This will help identify this tag to Users and
Operators. For example, enter Boiler #1 Steam Valve.
20. Optionally enter, Scaling, Span Hi, Span Low, Output Limits,
Engineering Units, and Alarms; enable data logging, etc.