Modbus Users Manual
Modbus Users Manual
MODCOMM
MODBUS Communications Program
User's Manual
TABLE OF CONTENTS
2.0 Color
2.1 Plot
2.2 View/Parse
2.3 MODBUS
1
2.3.6 Set MODCOMM Interface Type
2.4 Exit
2
FIRST THINGS TO KNOW ABOUT MODCOMM
Note: It is recommended that the user reads this manual entirely before proceeding to run
MODCOMM.
1. Data Reduction
2. Plotting
3. Serial Communications
The Data Reduction function allows the processing of raw startup data from the VIEW1
download program of the MARK-V. The output of the data reduction process is a comma
separated text file uploadable by several spread sheet programs. The raw data from the
VIEW1 program is downloaded in blocks. The blocks consists of a user defined number of
data points. Each block has a maximum time-tagged resolution of one (1) second. Raw data
blocks can be sampled at integer multiples of the maximum time-tagged resolution. The Data
Reduction function can also process raw startup data from a disk file with a format consistent
with that generated by the MARK-III+ screen dump.
The Plotter function allows real time and non-real time viewing of the processed data. The
view generated is a unidirectional time referenced magnitude (% of range) plot of the user
selected parameters. User entered minimum and maximum values are required so that the
acquired data points are plotted with a set magnitude range reference. A changing magnitude
range reference would render the pixel weight of the data points to be accurate only at the
t(0) reference point of the data plot. A maximum of twelve parameters can be monitored
while the plotter function is active. Real time viewing refers to the plotting of the extracted
data points as they are being processed by MODCOMM. Non-real time viewing refers to the
plotting of data points from a preprocessed file. Real time viewing is allowed during serial
communication with the MARK-V <I>.
The Serial Communications function allows real time monitoring of data points from the
MARK-V, both locally or remotely by use of a modem. Data points can be monitored
discretely or continuously. In discrete mode, selected MARK-V parameters can be read and
written to depending on their accessibility: some parameters are only readable. Below is a
listing of the MODBUS functions accessible through MODCOMM.
3
· Read Holding Coil
· Read Input Coil
· Read Holding Register
· Read Input Register
· Loopback Maintenance
Baud rates of 150, 300, 600, 1200, 2400, 4800, 9600, and 19200 are allowed via
MODCOMM in Discrete interface mode. Interfacing in Continuous mode requires a
minimum baud rate of 2400. The requirements for serial interface with the MARK-V <I> are
later described in section 2.3.1
4
1.2 Starting MODCOMM
Before starting MODCOMM, copy the unit specific MODBUS.LST file to the directory
where the MODCOMM executable file is located.
MODCOMM provides a menu driven environment that logically guides the user through the
required inputs. This scheme
Main Window
limits and controls user
input yet provides needed
access to relevant functions.
The various menu and sub
menu items are selected by
pressing the highlighted
letter or by using the cursor
keys to locate the green
Figure 1.0
highlighted bar over the desired menu item and then pressing ENTER. The Esc key is used
to reverse through the menu layers.
Figure 1.0 shows the sections of the program's Main Window. The window has four sections:
main menu, logo, line and modem status data, and user help. The Main menu is located at the
top of the window. The program logo is situated under the Main menu. The line and modem
status information is displayed, in hexadecimal format, at the lower left corner of the
window. The user help information is displayed at the bottom of the window and provides a
short description of the various MODCOMM menu options. The line and modem status
information is actively updated when the serial communications function is active (the Data
Display window is open), and passively updated after a menu option is chosen from the
MODBUS window.
5
1.4 File Input Windows
MODCOMM has two file input windows as described in figure 1.1 A and B. The File Input
window of figure 1.1A is opened whenever the "Plot" option is selected from the Main
menu. The File Input window File Input Windows
of figure 1.1B is opened when
any of the items of the
"View/Parse" option is
selected. If <ENTER> or the
right arrowhead key is pressed
while the "Source Filename"
option of the file input
window is highlighted, the
Directory Listing window
(figure 1.2) will open to allow
selection of a source file. The Figure 1.1
file chosen from the directory listing is displayed in the File Input window as the source
filename. If no output filename is shown in the file input window of figure 1.1B,
MODCOMM will create an output filename using the name of the source file with the
sample rate as the extension when <F10> is pressed. <Esc> may be pressed to cancel the file
input operation.
6
Directory Listing window is open; a line editor environment opens at the top section of the
window.
The Parameter Listing window (figure 1.3) provides easy access to the unit specific
MODBUS parameters. This window is activated when selecting parameters to be plotted
(post-time analyzing) or Parameter Listing Window
accessed via communication
link with the MARK-V <I>. The
upper left corner of the window
displays the number of
MODBUS parameters available
for selection. The parameter
count decrements as successive
selections are made. The
available parameters scroll
around the two columns at the
center of the window. The lower
section displays information
about the parameter highlighted.
Parameters are marked by
positioning the green Figure 1.3
highlighting bar and pressing the SPACEBAR or ENTER key. This action opens a window
which allows the user to enter approximate minimum and maximum values for the selected
parameter. Marked parameters are tagged by a small arrow and may be de-selected by
pressing the SPACEBAR or ENTER key as when marking. The minimum and maximum
values are required so that the acquired data points are plotted with a set magnitude
reference. A changing magnitude reference would render the pixel weight of the data points
to be accurate only at the t(0) reference point of the plotter display.
The Line Status window, located at the lower left corner of the Main window (see figure
1.0), indicates the status of the communications port link to: the line control status is prefixed
by "L:", and the modem status is prefixed by "M:". This information is only valid while the
MODBUS window is opened.
The status of the communications port is encoded in a word (16-bits) of data and is displayed
using hexadecimal notation. The most significant byte (MSB) of the data encodes the line
control status, and the least significant byte (LSB) of the data encodes the modem status of
the communications port. The following is a bit wise description of the
7
bit 7 = time out
and the
For example if the Line Status window displayed "L:60 M:10", a one-to-one bit comparison
with the MSB would indicate that the "transmit shift register" is empty, the "transmit holding
register" is empty (60(hex) converts to binary: 0110 0000), and that the "clear to send" signal
is active (10(hex) converts to binary: 0001 0000).
8
Figure 1.4
The graphics display consist of two major sections: the Plotter area and the Data area. The
parameter trends of the Plotter area are time shifted to the left by one time division at every
data block update. The rate of update depends upon the block sample rate. A block consist of
a user defined number of MARK-V parameters. Attached to the bottom of the Plotter area
are a number of time index windows. Each time index window is separated by sixteen (16)
subdivisions. The time of each subdivision and each time index window depends on the
block sample rate that is displayed horizontally centered between the Plotter area and the
Data area of the graphics display. The engineering values displayed in the Data area are
referenced to the actual time that is displayed at the window located directly under the right
most time index window of the graphics display. The right most time index window shows
the time elapsed, in seconds, since the first block sample.
To the left and right of the Plotter area is a 0 -> 100 % scale. The value of the parameters
indicated in the data area are plotted as a percentage of the range indicated in the magnitude
range reference column of the Data area.
Whenever there is an error or loss in data integrity during the data acquisition process,
MODCOMM will default to an engineering value of -999.999 for the associated parameter.
These errors will show up as gaps in the trends generated by the plotter function. All errors
generated are stored to an error log file (mod_err.log) that may be later viewed.
9
While in continuous interface mode with the plotter function not active, MODCOMM may
return "Response Error..." messages to the Data Display window. This message will be
preceded by an indication of the request transmitted to the <I>, prefixed "Tx:", and an
indication of what MODCOMM detected as a response at the receive line of the serial
communication port, prefixed "Rx:". This messages will be generated if the byte count of the
response received is not correct, or if MODCOMM does not detect a response within a
certain window of time starting with the transmittal of the last byte of the request frame to
the <I>. CRC error messages are displayed when they are detected.
10
DESCRIPTION OF MODCOMM FUNCTIONS
2.0 Color
This option allows the user to choose the colors (16) that are to be used for each of the
twelve(12) plots allowed when the plotter function is active.
Each item of the plot menu consists of a highlighted letter or number that can be used for
selection purposes. The highlighted color corresponds to the color that will be used for the
particular plot.
The color menu will highlight the color that is active for the selected plot.
5. <ENTER>
2.1 Plot
This option allows the user to plot data points that were processed and saved by MODCOMM.
2. Press <ENTER> to open the Directory Listing window if the file-path and file-name
displayed in the File-Input window are not correct.
While in the Directory Listing window, use <TAB> to edit the file-path then <ENTER>.
4. <ENTER>
5. <F10>
5. <F10>
11
MODCOMM will search the directory for a file with a name similar to the that of source
filename with a ".PGE" extension. The Parameter Listing window will display the
parameters available for selection. If the ".PGE" file was found, MODCOMM will collect
the parameter indices, the minimum and maximum values, and mark the appropriate
parameters as having been selected.
6. Select the MARK-V parameter(s) to be plotted and enter the anticipated minimum and
maximum values. Parameters may be selected and de-selected by positioning the green
highlighting bar over the parameter and then pressing the SPACEBAR.
7. <F10>
Before beginning to plot the data points extracted from the disk file, MODCOMM will
create a new ".PGE" file containing the indices, minimum, and maximum values entered
for the selected parameters. Once data trending begins, the plotter function may be stopped
and started by pressing the SPACEBAR.
2.2 View/Parse
This option provides access to the Data Reduction function that allows the processing of raw
startup data of a format consistent with that generated by the MARK-III+ screen dump, and the
VIEW1 download program of the MARK-V.
2. Select "MARK-III+ Screen Dump" to process data from the MARK-III+ screen dump or
Select "MARK-V VIEW1 Download" to process data from the MARK-V VIEW1
download.
3. Select "Source Filename" from the File-Input window if a filename change is required.
If a filename change is required, MODCOMM will open the Directory Listing window.
To change the file path, press the <TAB> key, edit the indicated path then press
<ENTER>.
4. Select "Output Filename" from the File-Input window, and enter a name for the output file
then press <ENTER>.
If no output file is indicated in the File-Input window, MODCOMM will create an output
filename using the name of the source file with the sample rate as the extension.
12
The integer value determines the block-read interval that will be used when uploading data
points from the disk file. i.e. If n=1, data points will be read from every block of the source
file. If n=2, the first block of data points will be read, and all subsequent reads will take
place at every other block of the source file. If n=3, data points will be read from the first
block, and all subsequent reads will take place after every two blocks of the source file.
7. <F10>
If the "MARK-III+ Screen Dump " option chosen from the "View/Parse" menu,
MODCOMM will proceed to parse the source file.
If the "MARK-V VIEW1 Download" option was chosen from the "View/Parse" menu,
MODCOMM load the first two hundred (200) lines of the source file and display a portion
of it in the view window with a flashing cursor at the upper left corner.
9. Use the arrowhead keys to position the cursor at the first point name of the data block.
12. <F10>
13. Use the arrowhead keys to position the cursor at the last point name of the data block.
13. <F10>
14. If the data is from the MARK-V VIEW1 download, use the arrowhead keys to locate the
cursor at the BEGINNING of the date/time stamp. DO NOT PRESS <F10> at this point.
15. Use the arrowhead keys to locate the cursor at the first data point of the data block.
16. <F10>
MODCOMM will use the first data block to determine the point name and data point
offsets. The offsets determined will be used for the parsing of all subsequent data blocks in
the file. The offsets are dynamically adjusted should the number of digits of the data point
value grow more toward the left of the originally determined offset position. All blank
spaces preceding the point name or data point are ignored.
17. Indicate whether or not to activate the plotter function (YES or NO).
13
MODCOMM will proceed to parse the source file and create the output file. If the plotter
function was activated, the Parameter Listing window will open prompting the selection of
the parameters to be viewed while parsing the source file.
14
2.3 MODBUS
This option provides an environment for interfacing with the MARK-V <I>.
Before MODCOMM can successfully connect with the MARK-V <I>, the <I> has
to be properly configured, and a unit specific MODBUS.LST file has to be
generated. Details regarding the configuring of the <I> and the generation of the
MODBUS.LST file are described in the GEH 5992.
Figure 2.0
Before attempting to establish a communication link with the remote <I>, the
modem connected to the dedicated serial port of the remote <I> should be set to auto
answer mode.
To minimize the number of response errors that may result when remotely
interfacing with the <I>, it is recommended that the phone lines be kept clear of the
ac line cords.
15
2.3.2 Description of MODBUS Window
Below is a sectional description of the MODBUS window (figure 2.1) opened when the
MODBUS option is selected from the Main menu. This window provides access to all
the MODBUS functions as listed in section 1.0 [About MODCOMM].
The various sections of the MODBUS window are color coded: user changeable
parameters are colored blue, menu options are black with white highlighted letters,
MODCOMM status is indicated in green or magenta, and user action messages are white
prefixed by black letters indicating what key is to be pressed to invoke the action.
The selected communications protocol is indicated at the top level of the window. These
parameters will be used to initialize the communications port when "MODBUS" is
selected from the Main menu and whenever any of the protocol parameters are changed.
The next three levels indicate the available menu options. These are selected by using
the arrowhead keys to move the green bar, or by pressing the white highlighted letter of
the menu options.
The fifth level of the window indicates the output filename and path, if defined, and the
maximum size (bytes) for output file. When the size of the output file is equal to or
begins to exceed the defined maximum, the file is closed and a new file is opened with a
name that is a modification of the original filename.
The sixth layer indicates MODCOMM's communication status, and interface mode. The
status information is colored green or magenta depending on the status. The interface
mode is indicated in white.
The seventh and final level of the window indicates the active MODBUS Function code
and Slave address in the left corner followed by a user message field.
16
MODBUS window
Figure 2.1
The following is a short description of the MODBUS window options:
Baud: Used to set the baud rate for interfacing with the <I>. Baud rates of 150, 300,
600, 1200, 2400, 4800, 9600, and 19200 are allowed in Discrete interface mode.
A minimum baud rate of 2400 is required for Continuous interface mode.
Parity: Used to set the number of parity bits to be included with the data stream to the
<I>. MODCOMM does a Cyclic Redundancy Check (16 bit) on the received bit
stream to verify data integrity.
DataBits: Used to define the number of bits that will encode the actual data.
StopBits: Used to define the number of stop bits to be included with one character of
data.
Port: Used to define the serial port to be linked in communicating with the <I>.
17
is baud rate dependent. Only twelve (12) Holding Registers can be
accessed while the Plotter function is active.
Output: Used to enter the output filename, and set the output file size.
Connect: Used to set the interface type to be when communicating with the <I> (Direct
or Modem), to edit the modem dial parameters, and to edit the phone number
used by the modem to dial the remote <I>.
MODBUS: Used to set the function code, slave address, output data title, and output file
size.
When the F10 key is pressed MODCOMM will process the unit specific MODBUS.LST
file if it is found. If the file is not found, a file input window will open prompting the
entry of the path to the file. If Discrete interface mode is set, the data display window
Data Display Window
Figure 2.2
will open within the environment of the MODBUS window. Figure 2.2 shows the
various sections of the Data Display window. The data
returned from the <I> is displayed in this window in a format that depends upon the
active function code.
Access to the parameter listing is accomplished by pressing any key while the Data
Display window is opened. This opens a pop-up menu from which "Parameter List" can
be selected to open the Parameter Listing window (figure 1.3).
The Send/Dial option of the pop-up menu allows the entry of characters to be
transmitted. Thus, this function can be used to send commands to a modem.
18
The Import option of the pop-up window allows the uploading of ASCII text via the
communications port. This function can be used to upload the MODBUS.LST file of the
remote MARK-V to be monitored. No character conversion is performed on the
incoming data; characters are stored an output file. The Import function will prompt the
user to enter the name of the file where the imported data will be saved.
The Function Code option of the pop-up window allows the user to set the desired
MODBUS function code.
The Slave Address option of the pop-up window allows the user to set the desired
MODBUS slave address.
The Loopback Test option of the pop-up window allows the user access to the various
MODBUS Loopback Maintenance functions:
6. Type the highlighted number corresponding to the desired number of data bits to be
used when encoding a character.
19
7. From the MODBUS window select "StopBits".
2. Type the highlighted number corresponding to the desired serial port to be linked
with the <I>.
If Continuous Interface mode is selected, MODCOMM will assume the reading of Holding
Registers(function code: 03). Function Code 03 will be forced if otherwise set.
4. <ENTER>
20
2. Select "Phone Number".
The user entered phone number is inserted into the dial parameter stream after the "D"
parameter or after the "T" or "P" parameters if it directly follows the "D" parameter (See
your modem manual for more information about dial parameters).
4. <ENTER>
The MODBUS function code may also be changed from the Data Display window
by selecting "Function Code" from the pop-up menu.
The User Help window, at the bottom of the screen, provides a short description of
the highlighted function code.
21
2.3.10 Set MODBUS Slave Address
The MODBUS slave address code may also be changed from the Data Display
window by selecting "Slave Address" from the pop-up menu.
The User Help window, at the bottom of the screen, provides a short description of
the highlighted slave address.
4. <ENTER>
4. <ENTER>
The output file settings can only be changed if "Continuous" interface mode is set.
22
When the size of the output file equals to or begins to exceed the defined maximum,
the output file is closed, and another file is opened with a name that is a
modification of the original filename.
4. <ENTER>
While the MODBUS window is open, press the F10 key. MODCOMM will search the current
directory for a file named "MODBUS.LST". If this file is not found the program will open a
file input window prompting the entry of the path to and the name of the unit specific
parameter file. This file is necessary for access to the MODBUS functions via MODCOMM.
The program will not proceed unless the MODBUS.LST file is processed.
2.3.15 Setup For Direct Connection With The <I> (Discrete mode)
6. Edit the phone number to be used when dialing the remote <I>. [2.3.8]
23
2.3.17 Import MODBUS.LST File via Communication Port
6. Enter the path and name of the file where the imported data will be stored.
7. <ENTER>
The "Stat" indicator (see figure 2.2) will indicate "Ready to receive" until the first
character is received.
The "Stat" indicator (see figure 2.2) will indicate "receiving..." while data is being
received.
MODCOMM will close the user defined file and indicate "Receive complete..." if there
is a break of five (5) seconds or more in the character stream from the transmitter.
7. <ENTER>
The result codes from the modem will be echoed back to the Data Display window if the
modem is setup to echo results back to the PC.
24
1. Set the communications protocol if needed. [2.3.3]
4. <F10>
7. Select function code [01] (see the user help at the bottom of the screen).
10. From the Parameter Listing window (figure 1.3) locate the desired Holding Coil.
11. <ENTER>
4. <F10>
7. Select function code [02] (see the user help at the bottom of the screen).
25
10. From the Parameter Listing window (figure 1.3) locate the desired Input Coil.
11. <ENTER>
4. <F10>
7. Select function code [03] (see the user help at the bottom of the screen).
10. From the Parameter Listing window (see figure 1.3) locate the desired Holding
Register.
11. <ENTER>
26
6. Set the output data title if desired. [2.3.11]
7. <F10>
8. From the Parameter Listing window (figure 1.3) locate the desired Holding Register
9. <ENTER>
10. Enter the anticipated minimum and maximum for the selected MARK-V parameter.
The minimum and maximum values are required so that the acquired data points are
plotted with a set magnitude range reference. A changing magnitude range reference
would render the pixel weight of the data points to be accurate only at the t(0)
reference point of the data plot.
11. Repeat steps 8 to 10 until the desired number of MARK-V parameters are selected
12. <F10>
6. <F10>
MODCOMM dials the modem at the remote <I>. The result codes from the local
modem are echoed back to the user via the Data Display window (figure 2.2).
9. <F10>
10. Enter the name and path of the file where the received data will be stored.
27
11. From the Parameter Listing window (figure 1.3) locate the desired Holding Register.
12. <ENTER>
13. Enter the anticipated minimum and maximum values for the selected MARK-V
parameter.
The minimum and maximum values are required so that the acquired data points are
plotted with a set magnitude range reference. A changing magnitude range reference
would render the pixel weight of the data points to be accurate only at the t(0)
reference point of the data plot.
14. Repeat steps 11 through 13 until the desired number of Holding Registers are
selected.
15. <F10>
4. <F10>
7. Select function code [04] (see the user help at the bottom of the screen).
10. From the Parameter Listing window (see figure 1.3) locate the desired Input
Register.
11. <ENTER>
28
2.3.24 Loopback Maintenance
4. <F10>
7. Select function code [08] (see the user help at the bottom of the screen).
10. Select the number corresponding to the desired test (see the user help at the bottom
of the screen).
11. <ENTER>
2.4 Exit
29