1.	Introduction...

	1.1	Description
	1.2	Registration of the ModSim Application
	1.3	Licensing Agreement
	1.4	Warranty
	
2.	ModSim System Requirements

	2.1	Operational Overview
	2.2	System/Cabling Requirements

3.	Installation

	3.1	Making Backups
	3.2	Installing ModSim

4.	Basic Operation

	4.1	MODBUS Protocol
	4.2	Polling Operation
	4.3	Display Parameters

5.	Menu Selections

	5.1	Setup Connection
	5.2	Display Options
	
6.	Technical Support
	
	6.1	Contacting WinTECH



Introduction..
 
ModSim Description

ModSim is a Windows utility for simulating modbus data points on a PC.
ModSim supports a Multiple Document Interface, (MDI), which allows multiple
data descriptions representing an array of data points from one or more
modbus slave devices.  Each data point may be accessed from a modbus
master device connected to one of the PC serial communications ports.

ModSim supports either the modbus RTU or ASCII protocol implementations.
It may be used to verify proper connectivity and operation of modbus
master designs by simulating slave data acessible by the master.  ModSim
supports modbus message types 01-06, 08, 15 & 16.  Data point addresses and
content is configurable by the user to represent various slave controllers.


Registration of the ModSim Application

Unregistered copies of the ModSim Application are functionally
equivalent to registered copies with the following exception:

To encourage registration, a limit is placed on the amount of time
data may be simulated during a monitoring session.  This limit
does not effect the ability of a user to fully evaluate either
the functionality or through-put of the application.  

Registration of the ModSim Application requires a registration
fee of $49.95 be submitted to WinTECH Software.  The user shall
receive in return the most recent registered version of ModSim
with all time limit constraints and registration reminder screens
disabled. 

Licensing Agreement

Registered WinTECH software is protected by both United States
Copyright Law and International Treaty provisions.  Therefore,
you must treat this software just like a book with the following
single exception.  WinTECH Software authorizes you to make
archival copies of the software for the sole purpose of backing-up
your software and protecting your investment from loss.

By saying "just like a book", WinTECH means for example that this
software may be used by any number of people and may be freely
moved from one computer location to another so long as there is
no possibility of it being used at two locations at the same time.
Execution of two copies of the same registered ModSim application
at the same time constitutes a Copyright violation and is expressly
prohibited.

Warranty

With respect to the physical diskette and physical documentation
enclosed herein, WinTECH Software warrants the same to be free of
defects in materials and workmanship for a period of 30 days
from the date of registration.  In the event of notification within
the warranty period of defects in material or workmanship, WinTECH
will replace the defective diskette or documentation.

WinTECH Software disclaims all other warranties, expressed or implied,
including without limitation, the warranties or merchantability
and of fitness for any purpose.  WinTECH Software assumes no
liability for damages, direct or consequential, which may result
from the use of this program.

ModSimSystem Requirements

Operational Overview

ModSim is a Windows application designed to operate as a passive
communications device, responding to queries for data from one
or more modbus masters.  Data may be accessed from any defined
ModSim document, (Window), by a master device polling according
to the MODBUS protocol as defined by Gould Modicon.  ModSim operates
using the standard Windows COM drivers and communicates using the
electrical protocol supported by the PC hardware.  Windows 3.1,
Windows for Workgroups  3.11, or Windows '95 is required.  At least
one free serial port must be available.

System/Cabling Requirements

This manual assumes an RS-232  based communications system is to
be used to connect the ModSim application directly to a single
MODBUS master device.  In this simple configuration, the cabling
requirements are defined by the RS-232 standard and the control
signals required by the particular master.  The application
supports RTS/CTS, and DSR/DCD/DTR operation, although these signals
are not required for ModSim operation.  If required by the master
device, these signals may wired as shown in cable drawing 2.2.1
or jumpered out at the master end of the cable as shown in
drawing 2.2.2. 

Installation

Making Backups

The distribution diskette is not copy-protected, and the registered
user may make backup copies as required.  The ModSim application
may be moved from one PC to another so long as the basic licensing
agreement of only one copy in use at a  time is maintained.  Site
licenses are available for commercial users by contacting WinTECH
Software.
	
Installing ModSim

Installation of the ModSim Application involves simply copying
the ModSim.exe, MbSlv16.dll, & ModSim.hlp files from the distribution
diskette to a working directory on the hard disk.  After running the
application for the first time, a configuration files may be created
representing the document files created to simulate modbus data.

ModSim may be started from the program manager, file manager,
or program group icon.  Consult the Windows user's manual for
details.

Basic Operation

The MODBUS Protocol

The MODBUS protocol describes an industrial communications and
distributed control system developed by Gould-Modicon to integrate
PLC's, computers, terminals, and other monitoring, sensing, and
control devices.  MODBUS is a Master/Slave communications
protocol, whereby one device, (the Master), controls all serial
activity by selectively polling one or more slave devices.  The
protocol provides for one master device and up to 247 slave
devices on a common line.  Each device is assigned an address
to distinguish it from all other connected devices. 

Certain characteristics of the MODBUS protocol are fixed, such as
the frame format, frame sequences, handling of communications errors
and exception conditions, and the functions performed.

Other characteristics are user selectable.  These include a choice
of transmission mediasetup_serial, baud rate, character parity,
number of stop bits, and the transmission modes, (ASCII or RTU).
The user selected parameters are set, (hardwired or programmed),
at each station.  These parameters cannot be changed while the
system is running.

The mode of transmission is the structure of the individual units
of information within a message, and the numbering system used to
transmit the data.  Two modes of transmission are available for
use in a MODBUS system.  Both modes provide the same capabilities
for communicating with PLC slaves;  the mode is selected depending
on the equipment used as a MODBUS Master.  One mode must be used
per MODBUS system; mixing of modes is not allowed.  The modes
are ASCII (American Standard Code for Information Interchange),
and RTU, (Remote Terminal Unit.)

ASCII printable characters are easy to view when troubleshooting
and this mode is suited to computer masters programmed in a high
level language, such as FORTRAN, as well as PLC masters.  RTU
is suited to computer masters programmed in a machine language,
as well as PLC masters.

In the RTU mode, data is sent in 8-bit binary characters.  In
the ASCII mode, each RTU character is first divided into two 4-bit
parts, (high order and low order), and then represented by the
hexadecimal equivalent.  The ASCII characters representing the
hexadecimal characters are used to construct the message.  The
ASCII mode uses twice as many characters as the RTU mode, but
decoding handling the ASCII data is easier.  Additionally, in
the RTU mode, message characters must be transmitted in a
continuous stream.  In the ASCII mode, breaks of up to one
second can occur between characters to allow for a relatively
slower master.


Polling Operation

Only the master initiates a transaction.  Transactions are either
a query/response type, (only a single slave is address), or a
broadcast/no response type, (all slaves are addressed).  A
transaction comprises a single query and single response frame
or a single broadcast frame.

ASCII Framing

Framing in ASCII Transmission mode is accomplished by the use of
the unique colon, (:), character to indicate the beginning of frame
and carriage return/line feed, (CRLF), to delineate end of frame.
The line feed character also serves as a synchronizing character
which indicates that the transmitting station is ready to receive
an immediate reply.

RTU Framing

Frame synchronization can be maintained in RTU transmission mode
only by simulating a synchronous message.  The receiving device
monitors the elapsed time between receipt of characters.  If
three and one-half character times elapse without a new character
or completion of the frame, then the device flushes the frame
and assumes that the next byte received will be an address.

The address field immediately follows the beginning of frame and
consists of 8-bits, (RTU), or 2 characters, (ASCII).   These bits
indicate the user assigned address of the slave device that is to
receive the message sent by the attached master.

Each slave must be assigned a unique address and only the addressed
slave will respond to a query that contains its address.  When the
slave sends a response, the slave address informs the master which
slave is communicating.  In a broadcast message, an address of 0 is
used.  All slaves interpret this as an instruction to read and take
action on the message, but not to issue a response message.

Function Field

The Function Code field tells the addressed slave what function to
perform.  MODBUS function codes are specifically designed for
interacting with a PLC on the MODBUS industrial communications
system.  The high order bit in this field is set by the slave
device to indicate an exception condition in the response message.
If no exceptions exist, the high-order bit is maintained as zero in
the response message.

Data Field

The data field contains information needed by the slave to perform
the specific function or it contains data collected by the slave
in response to a query.  This information may be values, address
references, or limits.  For example, the function code tells the
slave to read a holding register, and the data field is needed to
indicate which register to start at and how many to read.  The
imbedded address and data information varies with the type and
capacity of the PLC associated with the slave.

Error Check Field

This field allows the master and slave devices to check a message
for errors in transmission.  Sometimes, because of electrical noise
or other interference, a message may be changed slightly while its
on its way from one device to another.  The error checking assures
that the slave or master does not react to messages that have
changed during transmission.  This increases the safety and the
efficiency of the MODBUS system.

The error check field uses a Longitudinal Redundancy Check, (LRC),
in the ASCII mode of transmission, and a CRC-16 check in the RTU mode.

Display Parameters

The display, (View), of each ModSim document consists of two parts.
The top half of the display represents the addressing information which
specifies the remote slave device and data point type to simulate.
Edit controls allow specification of the slave device identification,
point type, and point addressing information used for the scanning
operation.  These controls may be modified at any time, including an 
active scanning session.  Modification of these values during a 
scanning session will influence the next poll.

Immediately above the horizontal line separating the addressing data
from the actual data point display is a status line.  If the document
data has been successfully connected to a PC Comm port and is available
for access by a modbus master, this status line will be blank.  A
"* * * NOT CONNECTED * * *" message will flash in the status line if
the document is not connected to a comm port.

The bottom half of the display represents the data points contained
in the document.  Coil values will be displayed as below.  ON status
is displayed as '1', OFF as '0'.  ModSim will attempt to display all
data points defined by the Length parameter in the address specification
using the available Window display area.

Register values may be displayed in either Decimal or Hexadecimal
notation.  The address of each data point is followed by the contents
as shown below:  (Hexadecimal notation would include an 'H' after the
value such as 1000H.)

Displayed data values may be changed by double-clicking the left mouse
button over the current value.  

Menu Selections

Setup Connection

The Connection menu allows the user to control the physical characteristics
of the MODBUS connection.  Since the PC Comm ports may be shared between
multiple ModSim documents, the menu is deactivated, (grayed), whenever
any document is connected.  To change the baud-rate, parity, etc. selections
for a comm port, first make sure that no ModSim documents are currently
using the port, and then access the menu option. 

From the comm port setup dialog, the user may select the modbus protocol,
(RTU or ASCII), as well as the physical serial port configuration.

Display Options

The SetUp Display Menu consists options which allow register data values
to be displayed in a variety of formats.  The user may select between 
Decimal, Hexadecimal, and Floating-point representation of the data.
Floating-point display requires two registers to contain the value and
may be configured to represent a "word-swapped" controller.


Technical Support

Contacting WinTECH

If it ever becomes necessary to contact WinTECH concerning a
technical question or to offer comments or suggestions for
improving the Listen application please call or write to the 
address below:

	WinTECH Software
	P.O.Box 907
	Lewisburg, WV  24901

	(304) 645-5966


For quickest response, email questions/comments to:

modsim@win-tech.com

