Modbus Slave Help Index

Modbus protocol ...

Description

Exceptions

Commands

File menu

Connection menu

Setup menu

Display menu

View menu

Window menu

Help menu

OLE Automation

Overview

Setup Functions

Properties

Excel Example

Registration and license information


File menu commands

The File menu offers the following commands:

New	Creates a new document.
Open	Opens an existing document.
Close	Closes an opened document.
Save	Saves an opened document using the same file name.
Save As	Saves an opened document to a specified file name.
Open Workspace	Opens an existing workspace.
Save Workspace	Saves the workspace.
Print	Prints a document.
Print Preview	Displays the document on the screen as it would appear printed.
Print Setup	Selects a printer and printer connection.
Exit	Exits Modbus Slave.


Connection menu commands

The Connection menu offers the following commands:

Connect (F3)	Select port, baudrate etc.
Disconnect (F4)	Close the port.
Auto Enable	Enable auto connection at startup.
Auto Disable	Disable auto connection at startup.
Quick Connect (F5)	Connect using current settings.


File menu commands
Setup menu commands

The Setup menu offers the following commands:

Slave Definition (F2)	Creates a new document.
Font	Select a font
Color	Select a color
Use as default	Use the current settings as your default next time you run Modbus Slave.


File menu commands
Display menu commands

The Display menu offers the following commands:

Signed	Values are displayed as signed (-32767 to 32768).
Unsigned	Values are displayed as unsigned (0 to 65565).
Hex	Values are displayed in Hexadecimal, (0000 to FFFF).
Binary	Values are displayed as 16 bits.
Long	Values are displayed as signed long (-2147483647 to 2147483648).
Long inverse	Values are displayed as signed long (-2147483647 to 2147483648). but least significant register first.
Float	Values are displayed in floating point. 2 registers are used.
Float inverse	As float but least significant register first.
Double	Values are displayed in double floating point. 4 registers are used.
Double inverse	As double floating but least significant register first.
PLC Addresses	Display addresses as a PLC. Eg. Holding registers from 40001
Protocol addresses	Display addresses as in the protocol definition starting from zero.
Communication	Display the serial traffic in each direction


View menu commands

The View menu offers the following commands:

Toolbar	Shows or hides the toolbar.
Status Bar	Shows or hides the status bar.


Window menu commands

The Window menu offers the following commands, which enable you to arrange multiple views of multiple documents in the application window:

Cascade	Arranges windows in an overlapped fashion.
Tile	Arranges windows in non-overlapped tiles.
Arrange Icons	Arranges icons of closed windows.
Window 1, 2, ...	Goes to specified window.


Help menu commands

The Help menu offers the following commands, which provide you assistance with this application:

Help Topics	Offers you an index to topics on which you can get help.
About	Displays the version number of this application.


File New command
New command (File menu)

Use this command to create a new document in Modbus Slave.

You can open an existing document with the Open command.

Shortcuts

Toolbar:


File Open command
Open command (File menu)

Use this command to open an existing document in a new window.  You can open multiple documents at once.  Use the Window menu to switch among the multiple open documents.  See Window 1, 2, ... command.

You can create new documents with the New command.

Shortcuts

Toolbar:

Keys:	CTRL+O


File Open dialog box

The following options allow you to specify which file to open:

File Name

Type or select the filename you want to open.  This box lists files with the extension you select in the List Files of Type box.

List Files of Type

Select the type of file you want to open:

<< List your application's file types here. >>

Drives

Select the drive in which Modbus Slave stores the file that you want to open.

Directories

Select the directory in which Modbus Slave stores the file that you want to open.

Network...

Choose this button to connect to a network location, assigning it a new drive letter.


File Close command
Close command (File menu)

Use this command to close all windows containing the active document.  Modbus Slave suggests that you save changes to your document before you close it.  If you close a document without saving, you lose all changes made since the last time you saved it.  Before closing an untitled document, Modbus Slave displays the Save As dialog box and suggests that you name and save the document.

You can also close a document by using the Close icon on the document's window, as shown below:


File Save command
Save command (File menu)

Use this command to save the active document to its current name and directory.  When you save a document for the first time, Modbus Slave displays the Save As dialog box so you can name your document.  If you want to change the name and directory of an existing document before you save it, choose the Save As command.

Shortcuts

Toolbar:

Keys:	CTRL+S


File Save As command
Save As command (File menu)

Use this command to save and name the active document.  Modbus Slave displays the Save As dialog box so you can name your document.

To save a document with its existing name and directory, use the Save command.


File Save As dialog box

The following options allow you to specify the name and location of the file you're about to save:

File Name

Type a new filename to save a document with a different name.  Modbus Slave adds the extension you specify in the Save File As Type box.

Drives

Select the drive in which you want to store the document.

Directories

Select the directory in which you want to store the document.

Network...

Choose this button to connect to a network location, assigning it a new drive letter.


Open Workspace (File menu)

Opens a workspace file with a list of windows so that the screen will look the same as when you saved the workspace file.


Save Workspace (File menu)

Saves a list of the open windows, their sizes and their positions on the screen to a workspace file so that the screen will look the same the next time you open the workspace file.


File 1, 2, 3, 4 command
1, 2, 3, 4 command (File menu)

Use the numbers and filenames listed at the bottom of the File menu to open the last four documents you closed.  Choose the number that corresponds with the document you want to open.


File Exit command
Exit command (File menu)

Use this command to end your Modbus Slave session.  You can also use the Close command on the application Control menu.  Modbus Slave prompts you to save documents with unsaved changes.

Shortcuts

Mouse:	Double-click the application's Control menu button.

Keys:	ALT+F4


Connection command (Connection menu)

Use this command to configure the serial line.

Also you have to select the desired protocol mode RTU or ASCII and the slave response timeout.

The DTR will be enabled whenever the port is opened and disabled when the port is closed.

DSR: Specifies whether the DSR (data-set-ready) signal is monitored for output flow control. If this member is TRUE and DSR is turned off, output is suspended until DSR is sent again. Enable DTR handshaking

CTS: Specifies whether the CTS (clear-to-send) signal is monitored for output flow control. If this checkbox is enabled and CTS is turned off, output is suspended until CTS is sent again.

RTS Toggle: Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes has been sent, the RTS line will be low.

You can use this to switch direction if you have a 232/485 converter without automatic direction switch.

NOTE:

In WIN95/98/Me it may be useful to delay the RTS disable 0 - 10ms after last character as the operating system disable the RTS before the last char has left the buffer.

Select TCP/IP if you want to communicate with a Modbus TCP/IP network.

In this case, slave ID is the same as the Unit ID used in Modbus TCP/IP.

The port number is default 502.

Ignore Unit ID:

Many PLC devices will ignore this field, and most clients default value to zero. However gateways or specialized programs can use the unit number to indicate what type of processing is desired.

Shortcuts

Keys:	F3


Disconnection command (Connection menu)

Use this command to close the serial line.

Shortcuts

Keys:	F4


Auto enable command (Connection menu)

Use this command to enable auto connection at startup.


Auto disable command (Connection menu)

Use this command to disable auto connection at startup.


Quick Connection command (Connection menu)

Use this command to connect using current settings

Shortcuts

Keys:	F5


Slave Definition command (Setup menu)

Use this command to define the data to be simulated for the active window.

Slave ID 1 to 247.

Address is 1 to 9999 if PLC Addresses are displayed.

0 to 65535 if Protocol Addresses are displayed.

The size depends on the chosen function:

Coils 1 to 4096.

Registers 1 to 2048.


Force Coils command (Setup menu)

Use this command to force several coils.

As default the Slave ID, Address and Length are the same as defined for the view window.

With the save button you can save the coil pattern and you can load the coils from a previously saved file.

How to force a single coil click here

Shortcuts

Keys:	F9


Preset Registers command (Setup menu)

Use this command to preset several registers.

As default the Slave ID, Address and Length are the same as defined for the view window.

With the save button you can save the registers and you can load the registers from a previously saved file.

To edit a value you can double click the value or you can press edit when the value is selected.

How to preset a single register click here

Shortcuts

Keys:	F10


Log command (Setup menu)

Use this command to log the data to a text file.

When the file name is entered you have to select the log rate. You can log each poll or you can enter the number of seconds between each log.

When you want to stop the data logging then select the logging off command on the setup menu.

Remark: If the scan rate is e.g. 10 sec. It make no sense to set a 1 sec log rate as data are logged only when new data are ready.

Example of a text file:

22:28:13 <40001>  17395      0      0      0      0      0      0      0      0

22:28:14 <40001>  17396      1      0      0      0      0      0      0      0

22:28:15 <40001>  17394      1      0      0      2     55      0      0      0

22:28:16 <40001>  13350      1      0      0      4      0      0      0      0

You can import the data to an Excel spreadsheet.


Logging Off command (Setup menu)

Use this command to stop the logging function.


Reset Counters command (Setup menu)

Use this command to reset the poll and error counter.


Use as Default command (Setup menu)

Use this command to store the settings of the current window.

Those settings will be used as default next time you open a window.


Test Center command (Setup menu)

Use this command to open the test center dialog.

The purpose of this test dialog is to help modbus slave device developers to test the device with any string of their own composition.

The list box display the transmitted data as well as the received data.

You can have several test strings in the pull down list box. When you have entered a string the press the ‘Add to List’ button then the string is added to the list.

The selected string is send when the send button is pressed.

With the ‘save list’ button you can store the strings in a text file.

Check the ‘Add Check’ check box if you wand to add a CRC or LRC to the end of the input string.

ASCII Example:

String in the combo box

3A 30 31 30 33 30 30 30 30 30 30 30 41

The transmitted string if LRC is added:

3A 30 31 30 33 30 30 30 30 30 30 30 41 46 32 0D 0A

A CR LF pair are also added

Hint: With a text editor as notepad or similar you can prepare strings to be used in the test.

The first line in the file must be the string ‘Test Center’. This is how modbus Slave know that the file is the correct format.

Remark: Only added strings are saved. A string in the edit field is not saved if not added to the list.


Signed command (Display menu)

Use this command to display data as signed 16 bit integers. Range -32767 to 32768.


Unsigned command (Display menu)

Use this command to display data as signed 16 bit integers. Range 0 to 65535.


Hex command (Display menu)

Use this command to display data as HEX values. Range 0 to FFFF.


Binary command (Display menu)

Use this command to display data as binary values 0000100010000011


Signed Long command (Display menu)

Use this command to display data as signed 32 bit integers. Range -2147483647 to 2147483648.


Signed Long Inverse command (Display menu)

Use this command to display data as signed 32 bit integers. Range -2147483647 to 2147483648.

Hi and Lo registers are swapped.


Float command (Display menu)

Use this command to display data in floating point format. 2 Registers are used.

IEEE specification is used.


Float Inverse command (Display menu)

Use this command to display data in floating point format. 2 Registers are used.

Hi and Lo registers are swapped.

IEEE specification is used.


Double command (Display menu)

Use this command to display data in double floating point format. 4 Registers are used.

IEEE specification is used.


Double Inverse command (Display menu)

Use this command to display data in double floating point format. 4 Registers are used.

Hi and Lo registers are swapped.

IEEE specification is used.


PLC Addresses command (Display menu)

Use this command to display addresses starting from 40001 if e.g. holding registers are displayed.

Base 1 is used for the address.


Protocol Addresses command (Display menu)

Use this command to display addresses as in the protocol request and response.

Base 0 is used for the address.

This is convenient when simulate the protocol of a slave device as protocol addresses always starts from zero.

Further more is the address field in the slave definition dialog box not limited by the max of 9999 but 65535. This is useful if you want to simulate modbus incompatible addresses.


Communication command (Display menu)

Use this command to display the traffic on the serial line. Use the stop button to temporary stop the update of the window in order to look closer to the data or save them to a file in text format.

Use Copy to copy a selected line to the clipboard. Then use ctrl+V to paste it e.g. in the test center.

HINT:

Leave this window open while doing other commands.


View Toolbar command
Toolbar command (View menu)

Use this command to display and hide the Toolbar, which includes buttons for some of the most common commands in Modbus Slave, such as File Open.  A check mark appears next to the menu item when the Toolbar is displayed.

See Toolbar for help on using the toolbar.


Toolbar

The toolbar is displayed across the top of the application window, below the menu bar.  The toolbar provides quick mouse access to many tools used in Modbus Slave,

To hide or display the Toolbar, choose Toolbar from the View menu (ALT, V, T).


View Status Bar Command
Status Bar command (View menu)

Use this command to display and hide the Status Bar, which describes the action to be executed by the selected menu item or depressed toolbar button, and keyboard latch state. A check mark appears next to the menu item when the Status Bar is displayed.

See Status Bar for help on using the status bar.


Status Bar

The status bar is displayed at the bottom of the Modbus Slave window.  To display or hide the status bar, use the Status Bar command in the View menu.

The left area of the status bar describes actions of menu items as you use the arrow keys to navigate through menus.  This area similarly shows messages that describe the actions of toolbar buttons as you depress them, before releasing them.  If after viewing the description of the toolbar button command you wish not to execute the command, then release the mouse button while the pointer is off the toolbar button.

The right areas of the status bar indicate which of the following keys are latched down:

Indicator	Description

CAP	The Caps Lock key is latched down.

NUM	The Num Lock key is latched down.

SCRL	The Scroll Lock key is latched down.


Cascade command (Window menu)

Use this command to arrange multiple opened windows in an overlapped fashion.


Tile command (Window menu)

Use this command to arrange multiple opened windows in a non-overlapped fashion.


Window Arrange Icons Command

Use this command to arrange the icons for minimized windows at the bottom of the main window.  If there is an open document window at the bottom of the main window, then some or all of the icons may not be visible because they will be underneath this document window.


1, 2, ... command (Window menu)

Modbus Slave displays a list of currently open document windows at the bottom of the Window menu.  A check mark appears in front of the document name of the active window.  Choose a document from this list to make its window active.


Index command (Help menu)

Use this command to display the opening screen of Help.  From the opening screen, you can jump to step-by-step instructions for using Modbus Slave and various types of reference information.

Once you open Help, you can click the Contents button whenever you want to return to the opening screen.


Help Using Help Command
Context Help command

Use the Context Help command to obtain help on some portion of Modbus Slave.  When you choose the Toolbar's Context Help button, the mouse pointer will change to an arrow and question mark.  Then click somewhere in the Modbus Slave window, such as another Toolbar button.  The Help topic will be shown for the item you clicked.

Shortcut

Keys:	SHIFT+F1


Title Bar

<< Modbus Slave. >>

The title bar is located along the top of a window.  It contains the name of the application and document.

To move the window, drag the title bar.  Note: You can also move dialog boxes by dragging their title bars.

A title bar may contain the following elements:

Application Control-menu button

Document Control-menu button

Maximize button

Minimize button

Name of the application

Name of the document

Restore button


Scroll bars

Displayed at the right and bottom edges of the document window.  The scroll boxes inside the scroll bars indicate your vertical and horizontal location in the document.  You can use the mouse to scroll to other parts of the document.


Size command (System menu)

Use this command to display a four-headed arrow so you can size the active window with the arrow keys.

After the pointer changes to the four-headed arrow:

1.	Press one of the DIRECTION keys (left, right, up, or down arrow key) to move the pointer to the border you want to move.

2.	Press a DIRECTION key to move the border.

3.	Press ENTER when the window is the size you want.

Note:  This command is unavailable if you maximize the window.

Shortcut

Mouse:	Drag the size bars at the corners or edges of the window.


Move command (Control menu)

Use this command to display a four-headed arrow so you can move the active window or dialog box with the arrow keys.

Note:  This command is unavailable if you maximize the window.

Shortcut

Keys:	ALT+SPACE M


System Minimize Command
Minimize command (application Control menu)

Use this command to reduce the Modbus Slave window to an icon.

Shortcut

Mouse:	Click the minimize icon [image] on the title bar.


Maximize command (System menu)

Use this command to enlarge the active window to fill the available space.

Shortcut

Mouse:	Click the maximize icon [image] on the title bar; or double-click the title bar.


Next Window command (document Control menu)

Use this command to switch to the next open document window.  Modbus Slave determines which window is next according to the order in which you opened the windows.

Shortcut

Keys:	CTRL+F6


Previous Window command (document Control menu)

Use this command to switch to the previous open document window.  Modbus Slave determines which window is previous according to the order in which you opened the windows.

Shortcut

Keys:	SHIFT+CTRL+F6


Close command (Control menus)

Use this command to close the active window or dialog box.

Double-clicking a Control-menu box is the same as choosing the Close command.

Shortcuts

Keys: 	CTRL+F4 closes a document window

ALT+F4 closes the program or dialog box


Restore command (Control menu)

Use this command to return the active window to its size and position before you chose the Maximize or Minimize command.


Data Window

You can double click on a data item in order to enter a new value.

The top line shows the ID number.

Note:

In Windows it is not possible to measure the 3.5 character time between two Modbus frames. That means that it may not be possible to use Modbus Slave in parallel with an other slave device unless you are sure that the delay in the slave is > 20ms.

Main Index


No Help Available

No help is available for this area of the window.


No Help Available

No help is available for this item.


Registration and license information

This Software is owned by Witte Communications, and protected by national copyright laws and international copyright treaties

Modbus Slave is a shareware application which may be distributed to any person for test without charge.

The trial period is limited to 30 days.

All features are enabled during the first 10 minutes after port connection hereafter the port will be disconnected and you have to restart.

When you register you will receive a registration key based on your name and company name.

A single user license allows you to run the software on a single computer at a given time.

For information on quantity pricing and site licenses, please visit http://www.modbustools.com

LIMITED WARRANTY. THE SOFTWARE IS PROVIDED AS IS AND WITTE COMMUNICATIONS DISCLAIMS ALL WARRANTIES RELATING TO THIS SOFTWARE, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

LIMITATION ON DAMAGES. NEITHER WITTE COMMUNICATIONS NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE SUCH SOFTWARE EVEN IF WITTE COMMUNICATIONS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL WITTE COMMUNICATIONS’ LIABILITY FOR ANY DAMAGES EXCEED THE PRICE PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.


Protocol Description

MODBUS® Protocol is a messaging structure, widely used to establish master-slave communication between intelligent devices. A MODBUS message sent from a master to a slave contains the address of the slave, the ‘command’ (e.g. ‘read register’ or ‘write register’), the data, and a check sum (LRC or CRC).

Since Modbus protocol is just a messaging structure, it is independent of the underlying physical layer. It is traditionally implemented using RS232, RS422, or RS485

The Query

The function code in the query tells the addressed slave device what kind of action to perform. The data bytes contain any additional information that the slave will need to perform the function. For example, function code 03 will query the slave to read holding registers and respond with their contents. The data field must contain the information telling the slave which register to start at and how many registers to read. The error check field provides a method for the slave to validate the integrity of the message contents.

The Response

If the slave makes a normal response, the function code in the response is an echo of the function code in the query. The data bytes contain the data collected by the slave, such as register values or status. If an error occurs, the function code is modified to indicate that the response is an error response, and the data bytes contain a code that describes the error. The error check field allows the master to confirm that the message contents are valid.

Controllers can be setup to communicate on standard Modbus networks using either of two transmission modes: ASCII or RTU.

ASCII Mode

When controllers are setup to communicate on a Modbus network using ASCII (American Standard Code for Information Interchange) mode, each eight-bit byte in a message is sent as two ASCII characters. The main advantage of this mode is that it allows time intervals of up to one second to occur between characters without causing an error.

Coding System

Hexadecimal ASCII printable characters 0 ... 9, A ... F

Bits per Byte

1 start bit

7 data bits, least significant bit sent first

1 bit for even / odd parity-no bit for no parity

1 stop bit if parity is used-2 bits if no parity

Error Checking

Longitudinal Redundancy Check (LRC)

RTU Mode

When controllers are setup to communicate on a Modbus network using RTU (Remote Terminal Unit) mode, each eight-bit byte in a message contains two four-bit hexadecimal characters. The main advantage of this mode is that its greater character density allows better data throughput than ASCII for the same baud rate. Each message must be transmitted in a continuous stream.

Coding System

Eight-bit binary, hexadecimal 0 ... 9, A ... F

Two hexadecimal characters contained in each eight-bit field of the message

Bits per Byte

1 start bit

8 data bits, least significant bit sent first

1 bit for even / odd parity-no bit for no parity

1 stop bit if parity is used-2 bits if no parity

Error Check Field

Cyclical Redundancy Check (CRC)

In ASCII mode, messages start with a colon ( : ) character (ASCII 3A hex), and end with a carriage return-line feed (CRLF) pair (ASCII 0D and 0A hex).

The allowable characters transmitted for all other fields are hexadecimal 0 ... 9, A ... F. Networked devices monitor the network bus continuously for the colon character. When one is received, each device decodes the next field (the address field) to find out if it is the addressed device.

Intervals of up to one second can elapse between characters within the message. If a greater interval occurs, the receiving device assumes an error has occurred. A typical message frame is shown below.

Start	Address	Function	Data	LRC	End
:	2 Chars	2 Chars	N Chars	2 Chars	CR LF

RTU Framing

In RTU mode, messages start with a silent interval of at least 3.5 character times. This is most easily implemented as a multiple of character times at the baud rate that is being used on the network (shown as T1-T2-T3-T4 in the figure below). The first field then transmitted is the device address.

The allowable characters transmitted for all fields are hexadecimal 0 ... 9, A ... F. Networked devices monitor the network bus continuously, including during the silent intervals. When the first field (the address field) is received, each device decodes it to find out if it is the addressed device.

Following the last transmitted character, a similar interval of at least 3.5 character times marks the end of the message. A new message can begin after this interval.

The entire message frame must be transmitted as a continuous stream. If a silent interval of more than 1.5 character times occurs before completion of the frame, the receiving device flushes the incomplete message and assumes that the next byte will be the address field of a new message.

Similarly, if a new message begins earlier than 3.5 character times following a previous message, the receiving device will consider it a continuation of the previous message. This will set an error, as the value in the final CRC field will not be valid for the combined messages. A typical message frame is shown below.

Start	Address	Function	Data	CRC	End
3.5 Char time	16Bit	8Bit	N * 8Bit	16Bit	3.5 Char time

Address Field

The address field of a message frame contains two characters (ASCII) or eight bits (RTU). The individual slave devices are assigned addresses in the range of 1 ... 247.

Function Field

The Function Code field tells the addressed slave what function to perform.

The following functions are supported by Modbus Slave

01	READ COIL STATUS

02	READ INPUT STATUS

03	READ HOLDING REGISTER

04	READ INPUT REGISTER

05	FORCE SINGLE COIL

06	PRESET SINGLE REGISTER

15	FORCE MULTIPLE COIL

16	PRESET MULTIPLE REGISTER

The data field contains the requested or send data

Contents of the Error Checking Field

Two kinds of error-checking methods are used for standard Modbus networks. The error checking field contents depend upon the method that is being used.

ASCII

When ASCII mode is used for character framing, the error-checking field contains two ASCII characters. The error check characters are the result of a Longitudinal Redundancy Check (LRC) calculation that is performed on the message contents, exclusive of the beginning colon and terminating CRLF characters.

The LRC characters are appended to the message as the last field preceding the CRLF characters.

LRC Example Code

RTU

When RTU mode is used for character framing, the error-checking field contains a 16-bit value implemented as two eight-bit bytes. The error check value is the result of a Cyclical Redundancy Check calculation performed on the message contents.

The CRC field is appended to the message as the last field in the message. When this is done, the low-order byte of the field is appended first, followed by the high-order byte. The CRC high-order byte is the last byte to be sent in the message. CRC Example Code


Protocol Exceptions

When a master device sends a query to a slave device, it expects a normal response. One of four possible events can occur from the master's query:

If the slave device receives the query without a communication error and can handle the query normally, it returns a normal response.

If the slave does not receive the query due to a communication error, no response is returned. The master program will eventually process a time-out condition for the query.

If the slave receives the query, but detects a communication error (CRC), no response is returned. The master program will eventually process a time-out condition for the query.

If the slave receives the query without a communication error, but cannot handle it (for example if the request is to read a non-existent register), the slave will return an exception response informing the master of the nature of the error.

The exception response message has two fields that differentiate it from a normal response:

Function code field: In a normal response the slave echoes the function code of the original query in the function code field of the response. All function codes have a most-significant bit (MSB) of 0. This makes the function code value in an exception response exactly 80 hexadecimal higher than the value would be for a normal response.

With the function code's MSB set, the master's application program can recognize the exception response and can examine the data field for the exception code.

Data field: In a normal response the slave may return data or statistics in the data field (any information that was requested in the query). In an exception response the slave returns an exception code in the data field. This defines the slave condition that caused the exception.

Example of a master query and slave exception response:

Query

Field Name	RTU (hex)
Slave Address	01
Function	03
Starting Address HI	07
Starting Address LO	03
No of Registers Hi	00
No of Registers Lo	02
Error Check Lo	C0
Error Check Hi	3C

Response

Example of a response to the query:

Field Name	RTU (hex)
Slave Address	04
Function	01
Exception Code	02
Error Check Lo	C0
Error Check Hi	F1

The master addresses a query to slave device 01h. The function code (03) is for a Read Registers, it requests the status of the register at an address, which is out of range.

Exception Codes

Code	Field Name	Meaning
01	ILLIGAL FUNCTION	The function code received in the query is not an allowable action for the slave
02	ILLIGAL DATA ADDRESS	The data address received in the query is not an allowable address for the slave
03	ILLIGAL DATA VALUE	A value contained in the query data fields is not an allowable value for the slave
04	SLAVE DEVICE FAILURE	An unrecoverable error occurred while the slave was attempting to perform the requested action
05	ACKNOWLEDGE	The slave has accepted a request and is processing it, but a long duration of time is required. This response is returned to prevent a timeout.
06	SLAVE DEVICE BUSY	The slave is processing a long duration program command. The master should retransmit the message later when the slave is free.
07	NEGATIVE ACKNOWLEDGMENT	The function just requested could not be performed.


Function 01 (01hex) Read Coil Status

Reads the ON/OFF status of discrete coils in the slave.

The query message specifies the starting coil and quantity of coils to be read.

Example of a query to read 10...22 (Coil 11 to 23) from slave device address 4:

Query

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	04	0  4
Function	01	0  1
Starting Address HI	00	0  0
Starting Address LO	0A	0  A
No of Coils Hi	00	0  0
No of Coils Lo	0D	0  D
Error Check Lo	DD	LRC (E  4)
Error Check Hi	98
Trailer	None	CR LF
Total Bytes	8	17

Response

The coil status response message is packed as one coil per bit of the data field. Status is indicated as: 1 is the value ON, and 0 is the value OFF. The LSB of the first data byte contains the coil addressed in the query. The other coils follow toward the high-order end of this byte and from low order to high order in subsequent bytes. If the returned coil quantity is not a multiple of eight, the remaining bits in the final data byte will be padded with zeroes (toward the high-order end of the byte). The byte count field specifies the quantity of complete bytes of data.

Example of a response to the query:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	04	0  4
Function	01	0  1
Byte Count	02	0  2
Data (Coils 7...10)	0A	0  A
Data (Coils 27...20)	11	1  1
Error Check Lo	B3	LRC (D  E)
Error Check Hi	50	None
Trailer	None	CR LF
Total Bytes	7	15


Function 02(02hex) Read Input Status

Reads the ON/OFF status of discrete inputs in the slave.

The query message specifies the starting input and quantity of inputs to be read.

Example of a query to read 10...22 (input 10011 to 10023) from slave device address 4:

Query

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	04	0  4
Function	02	0  2
Starting Address HI	00	0  0
Starting Address LO	0A	0  A
No of inputs Hi	00	0  0
No of inputs Lo	0D	0  D
Error Check Lo	99	LRC (E  3)
Error Check Hi	98
Trailer	None	CR LF
Total Bytes	8	17

Response

The input status response message is packed as one input per bit of the data field. Status is indicated as: 1 is the value ON, and 0 is the value OFF. The LSB of the first data byte contains the input addressed in the query. The other inputs follow toward the high-order end of this byte and from low order to high order in subsequent bytes. If the returned input quantity is not a multiple of eight, the remaining bits in the final data byte will be padded with zeroes (toward the high-order end of the byte). The byte count field specifies the quantity of complete bytes of data.

Example of a response to the query:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	04	0  4
Function	02	0  2
Byte Count	02	0  2
Data (Inputs 17...10)	0A	0  A
Data (Inputs 27...20)	11	1  1
Error Check Lo	B3	LRC (D  D)
Error Check Hi	14	None
Trailer	None	CR LF
Total Bytes	7	15


Function 03 (03hex) Read Holding Registers

Read the binary contents of holding registers in the slave.

The query message specifies the starting register and quantity of registers to be read. Example of a request to read 0...1 (register 40001 to 40002) from slave device 1:

Query

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	01	0  1
Function	03	0  3
Starting Address HI	00	0  0
Starting Address LO	00	0  0
No of Registers Hi	00	0  0
No of Registers Lo	02	0  2
Error Check Lo	C4	LRC (F  A)
Error Check Hi	0B
Trailer	None	CR LF
Total Bytes	8	17

Response

The register data in the response message are packed as two bytes per register, with the binary contents right justified within each byte. For each register the first byte contains the high-order bits, and the second contains the low-order bits.

Example of a response to the query:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	01	0  1
Function	03	0  3
Byte Count	04	0  4
Data Hi	00	0  0
Data Lo	06	0  6
Data Hi	00	0  0
Data Lo	05	0  5
Error Check Lo	DA	LRC (E  D)
Error Check Hi	31	None
Trailer	None	CR LF
Total Bytes	8	19


Function 04 (04hex) Read Input Registers

Read the binary contents of input registers in the slave.

The query message specifies the starting register and quantity of registers to be read. Example of a request to read 0...1 (register 30001 to 30002) from slave device 1:

Query

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	01	0  1
Function	04	0  4
Starting Address HI	00	0  0
Starting Address LO	00	0  0
No of Registers Hi	00	0  0
No of Registers Lo	02	0  2
Error Check Lo	71	LRC (F  9)
Error Check Hi	CB
Trailer	None	CR LF
Total Bytes	8	17

Response

The register data in the response message are packed as two bytes per register, with the binary contents right justified within each byte. For each register the first byte contains the high-order bits, and the second contains the low-order bits.

Example of a response to the query:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	01	0  1
Function	04	0  4
Byte Count	04	0  4
Data Hi	00	0  0
Data Lo	06	0  6
Data Hi	00	0  0
Data Lo	05	0  5
Error Check Lo	DB	LRC (E  C)
Error Check Hi	86	None
Trailer	None	CR LF
Total Bytes	9	19


Function 05 (05hex) Force Single Coil

Forces a single coil to either ON or OFF.

Query

The query message specifies the coil reference to be forced. Coils are addressed starting at zero-coil 1 is addressed as 0.

The requested ON / OFF state is specified by a constant in the query data field. A value of FF 00 hex requests the coil to be ON. A value of 00 00 requests it to be OFF. All other values are illegal and will not affect the coil.

Here is an example of a request to force coil 173 ON in slave device 17:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	05	0  5
Coil Address HI	00	0  0
Coil Address LO	AC	A  C
Force Data Hi	FF	F  F
Force Data Lo	00	0  0
Error Check Lo	4E	LRC (3  F)
Error Check Hi	8B
Trailer	None	CR LF
Total Bytes	8	17

Response

The normal response is an echo of the query, returned after the coil state has been forced.

Example of a response to the query:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	05	0  5
Coil Address HI	00	0  0
Coil Address LO	AC	A  C
Force Data Hi	FF	F  F
Force Data Lo	00	0  0
Error Check Lo	4E	LRC (3  F)
Error Check Hi	8B
Trailer	None	CR LF
Total Bytes	8	17


Function 06 (06hex) Preset Single Register

Presets a value into a single holding register.

Query

The query message specifies the register reference to be preset. Registers are addressed starting at zero-register 1 is addressed as 0.

The requested preset value is specified in the query data field. Here is an example of a request to preset register 40002 to 00 03 hex in slave device 17.

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	06	0  6
Register Address HI	00	0  0
Register Address LO	01	0  1
Preset Data Hi	00	0  0
Preset Data Lo	03	0  3
Error Check Lo	9A	LRC (E  5)
Error Check Hi	9B
Trailer	None	CR LF
Total Bytes	8	17

Response

The normal response is an echo of the query, returned after the register contents have been preset.

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	06	0  6
Coil Address HI	00	0  0
Coil Address LO	01	0  1
Force Data Hi	00	0  0
Force Data Lo	03	0  3
Error Check Lo	9A	LRC (E  5)
Error Check Hi	9B
Trailer	None	CR LF
Total Bytes	8	17


Function 15 (0Fhex) Force Multiple Coils

Forces each coil in a sequence of coils to either ON or OFF.

Query

The query message specifies the coil references to be forced. Coils are addressed starting at zero-coil 1 is addressed as 0.

The requested ON / OFF states are specified by contents of the query data field. A logical 1 in a bit position of the field requests the corresponding coils to be ON. A logical 0 requests it to be OFF.

Below is an example of a request to force a series of ten coils starting at coil 20 (addressed as 19, or 13 hex) in slave device 17.

The query data contents are two bytes: CD 01 hex (1100 1101 0000 0001 binary). The binary bits correspond to the coils in the following way:

Bit: 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1

Coil: 27 26 25 24 23 22 21 20 - - - - - - 29 28

The first byte transmitted (CD hex) addresses coils 27 ... 20, with the least significant bit addressing the lowest coil (20) in this set.

The next byte transmitted (01 hex) addresses coils 29 and 28, with the least significant bit addressing the lowest coil (28) in this set. Unused bits in the last data byte should be zero-filled.

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	0F	0  F
Coil Address HI	00	0  0
Coil Address LO	13	1  3
Number of Coils Hi	00	0  0
Number of Coils Lo	0A	0  A
Byte Count	02	0  2
Force Data Hi	CD	C  D
Force Data Lo	01	0  1
Error Check Lo	BF	LRC (F  3)
Error Check Hi	0B
Trailer	None	CR LF
Total Bytes	11	23

Response

The normal response returns the slave address, function code, starting address, and number of coils forced. Here is an example of a response to the query shown above

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	0F	0  F
Coil Address HI	00	0  0
Coil Address LO	13	1  3
Number of Coils Hi	00	0  0
Number of Coils Lo	0A	0  A
Error Check Lo	26	LRC (C  3)
Error Check Hi	99
Trailer	None	CR LF
Total Bytes	8	17


Function 16 (10hex) Preset Multiple Registers

Presets values into a sequence of holding registers

Query

The query message specifies the register references to be preset. Registers are addressed starting at zero-register 1 is addressed as 0.

The requested preset values are specified in the query data field. Data is packed as two bytes per register.

Here is an example of a request to preset two registers starting at 40002 to 00 0A and 01 02 hex, in slave device 17:

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	10	1  0
Starting Address HI	00	0  0
Starting Address LO	01	0  1
Number of Registers Hi	00	0  0
Number of Registers Lo	02	0  2
Byte Count	04	0  4
Data Hi	00	0  0
Data Lo	0A	0  A
Data Hi	01	0  1
Data Lo	02	0  2
Error Check Lo	C6	LRC (C  B)
Error Check Hi	F0
Trailer	None	CR LF
Total Bytes	13	23

Response

The normal response returns the slave address, function code, starting address, and quantity of registers preset. Here is an example of a response to the query shown above.

Field Name	RTU (hex)	ASCII Characters
Header	None	: (Colon)
Slave Address	11	1  1
Function	10	1  0
Coil Address HI	00	0  0
Coil Address LO	01	0  1
Number of Coils Hi	00	0  0
Number of Coils Lo	02	0  2
Error Check Lo	12	LRC (D  C)
Error Check Hi	98
Trailer	None	CR LF
Total Bytes	8	17


CRC Example Code

This function is an example how to calculate a CRC word using the C language.

WORD CRC16 (const BYTE *nData, WORD wLength)

{

static const WORD wCRCTable[] = {

   0X0000, 0XC0C1, 0XC181, 0X0140, 0XC301, 0X03C0, 0X0280, 0XC241,

   0XC601, 0X06C0, 0X0780, 0XC741, 0X0500, 0XC5C1, 0XC481, 0X0440,

   0XCC01, 0X0CC0, 0X0D80, 0XCD41, 0X0F00, 0XCFC1, 0XCE81, 0X0E40,

   0X0A00, 0XCAC1, 0XCB81, 0X0B40, 0XC901, 0X09C0, 0X0880, 0XC841,

   0XD801, 0X18C0, 0X1980, 0XD941, 0X1B00, 0XDBC1, 0XDA81, 0X1A40,

   0X1E00, 0XDEC1, 0XDF81, 0X1F40, 0XDD01, 0X1DC0, 0X1C80, 0XDC41,

   0X1400, 0XD4C1, 0XD581, 0X1540, 0XD701, 0X17C0, 0X1680, 0XD641,

   0XD201, 0X12C0, 0X1380, 0XD341, 0X1100, 0XD1C1, 0XD081, 0X1040,

   0XF001, 0X30C0, 0X3180, 0XF141, 0X3300, 0XF3C1, 0XF281, 0X3240,

   0X3600, 0XF6C1, 0XF781, 0X3740, 0XF501, 0X35C0, 0X3480, 0XF441,

   0X3C00, 0XFCC1, 0XFD81, 0X3D40, 0XFF01, 0X3FC0, 0X3E80, 0XFE41,

   0XFA01, 0X3AC0, 0X3B80, 0XFB41, 0X3900, 0XF9C1, 0XF881, 0X3840,

   0X2800, 0XE8C1, 0XE981, 0X2940, 0XEB01, 0X2BC0, 0X2A80, 0XEA41,

   0XEE01, 0X2EC0, 0X2F80, 0XEF41, 0X2D00, 0XEDC1, 0XEC81, 0X2C40,

   0XE401, 0X24C0, 0X2580, 0XE541, 0X2700, 0XE7C1, 0XE681, 0X2640,

   0X2200, 0XE2C1, 0XE381, 0X2340, 0XE101, 0X21C0, 0X2080, 0XE041,

   0XA001, 0X60C0, 0X6180, 0XA141, 0X6300, 0XA3C1, 0XA281, 0X6240,

   0X6600, 0XA6C1, 0XA781, 0X6740, 0XA501, 0X65C0, 0X6480, 0XA441,

   0X6C00, 0XACC1, 0XAD81, 0X6D40, 0XAF01, 0X6FC0, 0X6E80, 0XAE41,

   0XAA01, 0X6AC0, 0X6B80, 0XAB41, 0X6900, 0XA9C1, 0XA881, 0X6840,

   0X7800, 0XB8C1, 0XB981, 0X7940, 0XBB01, 0X7BC0, 0X7A80, 0XBA41,

   0XBE01, 0X7EC0, 0X7F80, 0XBF41, 0X7D00, 0XBDC1, 0XBC81, 0X7C40,

   0XB401, 0X74C0, 0X7580, 0XB541, 0X7700, 0XB7C1, 0XB681, 0X7640,

   0X7200, 0XB2C1, 0XB381, 0X7340, 0XB101, 0X71C0, 0X7080, 0XB041,

   0X5000, 0X90C1, 0X9181, 0X5140, 0X9301, 0X53C0, 0X5280, 0X9241,

   0X9601, 0X56C0, 0X5780, 0X9741, 0X5500, 0X95C1, 0X9481, 0X5440,

   0X9C01, 0X5CC0, 0X5D80, 0X9D41, 0X5F00, 0X9FC1, 0X9E81, 0X5E40,

   0X5A00, 0X9AC1, 0X9B81, 0X5B40, 0X9901, 0X59C0, 0X5880, 0X9841,

   0X8801, 0X48C0, 0X4980, 0X8941, 0X4B00, 0X8BC1, 0X8A81, 0X4A40,

   0X4E00, 0X8EC1, 0X8F81, 0X4F40, 0X8D01, 0X4DC0, 0X4C80, 0X8C41,

   0X4400, 0X84C1, 0X8581, 0X4540, 0X8701, 0X47C0, 0X4680, 0X8641,

   0X8201, 0X42C0, 0X4380, 0X8341, 0X4100, 0X81C1, 0X8081, 0X4040 };

BYTE nTemp;

WORD wCRCWord = 0xFFFF;

   while (wLength--)

   {

      nTemp = *nData++ ^ wCRCWord;

      wCRCWord >>= 8;

      wCRCWord  ^= wCRCTable[nTemp];

   }

   return wCRCWord;

} // End: CRC16


LRC Example Code

This function is an example how to calculate a LRC BYTE using the C language.

BYTE LRC (BYTE *nData, WORD wLength)

{

BYTE nLRC = 0 ; // LRC char initialized

   for (int i = 0; i < wLength; i++)

      nLRC += *nData++;

   return (BYTE)(-nLRC);

} // End: LRC


Automation Overview

Automation (formerly known as OLE Automation) makes it possible for one application to manipulate objects implemented in another application.

An Automation client is an application that can manipulate exposed objects belonging to another application. This is also called an Automation controller.

An Automation server is an application that exposes programmable objects to other applications. Modbus Slave is an automation server

That means you can use any program that supports VBA (Visual Basic for Applications) such as Visual Basic, Excel etc. to interpret and show the modbus data according to your specific requirements.

The VBA links to the mbslave.tlb file, (Type Library) which is installed in the directory where you installed Modbus Slave. If not registered automatic then use references in the tools menu in Visual Basic and browse for mbslave.tlb.

Refer to the Excel example

Excel example sheet for additional details.

Hint:

You should enable the auto connection in the connection menu in order to establish a connection when Modbus Slave is started by a client.


Automation Setup Functions

Function CreateSlave(SlaveID As Long,

Function As Long,

Address As Long,

Length As Long) As Long

Return Value

True if success. False if not success

Parameters

SlaveID, The slave address 1 to 255. (247 is max according to Modbus specification)

Function, 1, 2, 3 or 4

Address, The data address (Base 0)

Length, The number of data. 1 to 127 if registers. 1 to 256 if coils

Remarks

You have to create a slave before you can use properties to read

Sub ShowWindow()

Call this function if you want the window to be shown in Modbus Poll. If ShowWindow is not called the Modbus Poll is not visible.

DisplayFormat As Long

Values

0 = DISPLAY SIGNED

1 = DISPLAY UNSIGNED,

2 = DISPLAY HEX,

3 = DISPLAY BINARY,

4 = DISPLAY FLOAT,

5 = DISPLAY FLOAT INVERSE,

6 = DISPLAY DOUBLE,

7 = DISPLAY DOUBLE INVERSE,

8 = DISPLAY INT,

9 = DISPLAY INT INVERSE


Automation Properties

The below properties are used to set or get values in the internal write/read arrays in Modbus Slave.

Property Coil(Index As Integer) As Integer

Description

Sets a coil in the write array structure or return a coil from the read array

Syntax

Object.Coil(Index) [=newvalue]

Property Register(Index As Integer) As Integer

Description

Sets a register in the write array structure or return a register from the read array

Syntax

Object.Register (Index) [=newvalue]


Automation Excel Example

Public m_svr1 As Object

Public m_svr2 As Object

Dim status As Integer

Dim Created As Boolean

Private Sub MBTimer1_MBTimer()

If Created Then

      For n = 0 To 9

         Cells(5 + n, 2) = m_svr1.Register(n)  'Show the registers

      Next n

      For n = 0 To 9

         Cells(18 + n, 2) = m_svr2.Coil(n) 'Show the coils

      Next n                               'Note that the coils are read from index 0

End If                                     'no matter we simulate 00010 - 00019

End Sub

Private Sub OpenModbusSlave_Click()

   Set m_svr1 = CreateObject("mbslave.Document")

   Set m_svr2 = CreateObject("mbslave.Document")

   status = m_svr1.CreateSlave(1, 3, 0, 10) ' 10 Holding Register 40001 - 40010

   status = m_svr2.CreateSlave(1, 1, 9, 10) ' 10 Coils Status 00010 - 00019

   MBTimer1.Enabled = True ' Start the timer

   Created = True

   'Use this lines if you want to show the windows in Modbus Slave

   'status = m_svr1.ShowWindow

   'status = m_svr2.ShowWindow

   m_svr1.DisplayFormat = 0  'Format data as registers

   m_svr2.DisplayFormat = 0  'Format data as registers

   WriteValues.Enabled = True 'Enable the buttons

   WriteCoils.Enabled = True

End Sub

Private Sub Worksheet_Change(ByVal Target As Range)

'Hint: Use this event to auto update the slave whenever you chenge a value

 '  For n = 0 To 9

 '     m_svr1.Register(n) = Cells(5 + n, 3) ' Change the 10 Holding registers in the slave

 '  Next n

End Sub

Private Sub WriteCoils_Click()

   For n = 0 To 9

      m_svr2.Coil(n) = Cells(18 + n, 3)  ' Change the 10 coils in the slave

   Next n

End Sub

Private Sub WriteValues_Click()

   For n = 0 To 9

      m_svr1.Register(n) = Cells(5 + n, 3) ' Change the 10 Holding registers in the slave

   Next n

End Sub


File Print command
Print command (File menu)

Use this command to print a document.   This command presents a Print dialog box, where you may specify the range of pages to be printed, the number of copies, the destination printer, and other printer setup options.

Shortcuts

Toolbar:

Keys:	CTRL+P


Print dialog box

The following options allow you to specify how the document should be printed:

Printer

This is the active printer and printer connection.  Choose the Setup option to change the printer and printer connection.

Setup

Displays a Print Setup dialog box, so  you can select a printer and printer connection.

Print Range

Specify the pages you want to print:

All	Prints the entire document.
Selection	Prints the currently selected text.
Pages	Prints the range of pages you specify in the From and To boxes.
Copies

Specify the number of copies you want to print for the above page range.

Collate Copies

Prints copies in page number order, instead of separated multiple copies of each page.

Print Quality

Select the quality of the printing.  Generally, lower quality printing takes less time to produce.


Print Progress Dialog

The Printing dialog box is shown during the time that <<YourApp>> is sending output to the printer.  The page number indicates the progress of the printing.

To abort printing, choose Cancel.


File Print Preview command
Print Preview command (File menu)

Use this command to display the active document as it would appear when printed.  When you choose this command, the main window will be replaced with a print preview window in which one or two pages will be displayed in their printed format.  The print preview toolbar offers you options to view either one or two pages at a time; move back and forth through the document; zoom in and out of pages; and initiate a print job.


Print Preview toolbar

The print preview toolbar offers you the following options:

Print

Bring up the print dialog box, to start a print job.

Next Page

Preview the next printed page.

Prev Page

Preview the previous printed page.

One Page / Two Page

Preview one or two printed pages at a time.

Zoom In

Take a closer look at the printed page.

Zoom Out

Take a larger look at the printed page.

Close

Return from print preview to the editing window.


File Print Setup command
Print Setup command (File menu)

Use this command to select a printer and a printer connection.  This command presents a Print Setup dialog box, where you specify the printer and its connection.


Print Setup dialog box

The following options allow you to select the destination printer and its connection.

Printer

Select the printer you want to use.  Choose the Default Printer; or choose the Specific Printer option and select one of the current installed printers shown in the box.  You install printers and configure ports using the Windows Control Panel.

Orientation

Choose Portrait or Landscape.

Paper Size

Select the size of paper that the document is to be printed on.

Paper Source

Some printers offer multiple trays for different paper sources.  Specify the tray here.

Options

Displays a dialog box where you can make additional choices about printing, specific to the type of printer you have selected.

Network...

Choose this button to connect to a network location, assigning it a new drive letter.


File Page Setup Command
Page Setup command (File menu)

<< Write application-specific help here. >>