0% found this document useful (0 votes)
76 views20 pages

COMTool User Guide

This document provides instructions for installing and using the US Digital COMTool application. It describes downloading the application from the US Digital website and walking through the installation process. The COMTool allows debugging of serial communication between a PC and US Digital devices and includes preloaded commands for common US Digital products.

Uploaded by

Manolo Medrano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views20 pages

COMTool User Guide

This document provides instructions for installing and using the US Digital COMTool application. It describes downloading the application from the US Digital website and walking through the installation process. The COMTool allows debugging of serial communication between a PC and US Digital devices and includes preloaded commands for common US Digital products.

Uploaded by

Manolo Medrano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

COMTool User Guide

Version 1.1
12/02/2013

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
1 of 20
COMTool User Guide
Version 1.1
12/02/2013

Contents
Terms and Conditions of License for use of gratuitous software .................................................................. 3
Purpose: ........................................................................................................................................................ 3
Installation Instructions:................................................................................................................................. 4
Using COMTool: ............................................................................................................................................ 8
Select a COM Port ..................................................................................................................................... 8
Select a product ......................................................................................................................................... 8
Selecting data as Hex or ASCII ............................................................................................................... 10
Calculating 2’s compliment, XOR’d, or Modbus CRC16 value ............................................................... 10
Big-Endian vs. Little-Endian .................................................................................................................... 11
Entering a Command............................................................................................................................... 11
Transmitting Data .................................................................................................................................... 11
Clear Transmit or Receive Text Boxes .................................................................................................... 12
Copy Selected Received bytes to Clipboard ........................................................................................... 12
Commands Tab ....................................................................................................................................... 15
Scripts Tab............................................................................................................................................... 16
Adding a New Script Command .............................................................................................................. 17
Editing a Script Command ....................................................................................................................... 18
Deleting a Script Command..................................................................................................................... 18
Reorder Command Sequence ................................................................................................................. 18
Selecting Commands to Execute ............................................................................................................ 18
Executing a Scripts Command ................................................................................................................ 19

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
2 of 20
COMTool User Guide
Version 1.1
12/02/2013

Terms and Conditions of License for use of gratuitous software

Thank you for purchasing US Digital products.

By downloading or using US Digital software, you agree to the terms and conditions below and as further
detailed on our website at http://www.usdigital.com/company/terms-conditions.shtml. If you do not agree
with such terms and conditions, do not use the software. You may promptly return the software and other
items that are part of this product in their original package with your sales receipt to your point of
purchase for a full refund, or if you have downloaded this software from a US Digital web site, then you
must stop using the software and destroy any copies of the software in your possession or control. These
terms and conditions which accompany the original or new versions of the software and patches, point
releases, maintenance releases, updates, enhancements, or upgrades thereto upon installation or
download, are applicable.

Permission to use, copy, modify and distribute this software without fee is hereby granted. US Digital
makes no warranty or representations about the suitability of the software for any purpose. It is provided
"AS IS" without any express or implied warranty, including the implied warranties of merchantability,
fitness for a particular purpose and non-infringement. US Digital shall not be liable for any direct, indirect,
special or consequential damages resulting from the loss of use, data or projects, whether in an action of
contract or tort, arising out of or in connection with the use or performance of this software. Your use of
the software is entirely at your own risk. In connection with the software, you agree to comply with all
export laws and restrictions and regulations of the Department of Commerce, the United States
Department of Treasury Office of Foreign Assets Control ("OFAC"), or other United States or foreign
agency or authority, and you agree not to export, or allow the export or re-export of the software in
violation of any such restrictions, laws or regulations. Downloading or using US Digital software is implicit
acceptance of these terms and conditions and as further detailed at
http://www.usdigital.com/company/terms-conditions.shtml.

Purpose:
The US Digital COMTool application is designed to assist debugging of serial
communication between host PC and US Digital devices that provide a serial interface.
This document describes how to install the COMTool application and use all available
features.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
3 of 20
COMTool User Guide
Version 1.1
12/02/2013

Installation Instructions:
Download the COMTool application from US Digital website
http://usdigital.com/support/software/comtool and run the COMTool Installation.

The installation program will install the COMTool application with a preloaded list of
commonly used commands for US Digital serial devices. Drivers for a specific US
Digital device can be downloaded from US Digital’s device specific software page.

The following is a list of some of the US Digital serial devices supported by the
COMTool application: A2, QSB, T7 (mod2 and mod4), and X3.

The COMTool setup program displays the following sequence of screen shots. Typically
the Next button is clicked on each screen to install the default COMTool configuration.

Click the Next button.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
4 of 20
COMTool User Guide
Version 1.1
12/02/2013

Click the Next button unless the default program destination folder needs to be
changed.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
5 of 20
COMTool User Guide
Version 1.1
12/02/2013

Click the Next button.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
6 of 20
COMTool User Guide
Version 1.1
12/02/2013

Click the Finish button.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
7 of 20
COMTool User Guide
Version 1.1
12/02/2013

Using COMTool:
Locate and start the COMTool program.

Click on the Windows Start Icon. Click on the All Programs menu item. Locate and click
the US Digital\COMTool menu item from the Windows Start menu.

Select a COM Port

Select the COM port that the target device uses. If there is more than one COM port
listed, then the target device COM port can be identified by observing the COM Port list
while the device is unplugged and then re-plugged. The device will disappear when
unplugged and then re-appear once plugged back in.

Select a product

Selecting a predefined product causes the COM port settings to automatically be


selected for Baud Rate, Parity, Data Bits, Stop Bit, and Hand Shaking. These COM port
settings will be disabled except for baud rate on most US Digital devices. If non-
standard COM settings are required, then select User Defined Product.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
8 of 20
COMTool User Guide
Version 1.1
12/02/2013

After the appropriate COM port settings have been set, click on the Connect button.
If the selected COM port is successfully opened, then connection icon will show
connected with a green arrow.

If the COM port is already opened by another application, then the following message
will be displayed. Only one application can have the COM port open at a time.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
9 of 20
COMTool User Guide
Version 1.1
12/02/2013

Selecting data as Hex or ASCII


Select either Hex or ASCII format. The COMTool provides the ability to send and
receive data as either Hex or ASCII characters. Selecting a predefined product
automatically selects the appropriate data format. Most of the US Digital products use
Hex formatted commands.

Calculating 2’s compliment, XOR’d, or Modbus CRC16 value


To ensure data integrity, some devices require that commands include a checksum
especially when performing a write command or changing a device’s configuration. By
selecting the bytes to be transmitted, the COMTool automatically calculates three
different types of checksum values: 2’s compliment, XOR’d, or Modbus CRC16.
To append the checksum value to the end of the command, click on the add button
next to the desired value. The checksum fields and the Hex to Integer field will display
“na” when no data is highlighted in the Transmit or Receive field, otherwise the
appropriate checksum and Hex to Integer value will be calculated. The Hex to Integer
field will only have a valid value if four or less bytes are selected.
US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 
Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
10 of 20
COMTool User Guide
Version 1.1
12/02/2013

To determine the hexadecimal value for a decimal number, enter the decimal number
into the Convert Decimal to Hex field. The Hex value will automatically update as the
decimal value is entered. To append the converted decimal to hex value to the end of
the command, click on the add button.

Big-Endian vs. Little-Endian


For most devices, the Endian value is set to Big-Endian where the first byte is most
significant and the last byte is least significant.
Example: Decimal 123456 in Big-Ending is hex value 00 01 E2 40 and in Little-Ending is
40 E2 01 00.

Entering a Command
The data can be entered manually or by selecting a command from the Commands list
view. Double-clicking the command in the Commands list view will automatically copy
the command to the transmit text box and send the command to the device. If sending
hex commands, separate each hex byte with a space.

Every character or byte sent is accumulated and displayed in the Sent count label.
Every character or byte received is accumulated and displayed in the Received count
label.

Transmitting Data

Click on the send button to transmit the value in the transmit text box to the
device. Double-clicking a command in the Commands list view will place the command
in the Transmit text box and automatically send the command to the device. The
response from the device will appear in the Receive area text box. Each command
response will be appended to the end of the previously received data.
US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 
Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
11 of 20
COMTool User Guide
Version 1.1
12/02/2013

To continuously transmit the same command to the device, check the Auto Transmit
checkbox and then click the send button. Click the Auto Clear Received check box to
clear the Received textbox prior to sending the next command. To translate a specific
hex value returned from the device to an integer value, highlight the hex value to
translate. The Hex to Integer field will automatically be updated to reflect the integer
value. If reporting the absolute position of an A2 encoder, highlight the returned hex
position value and the Hex to Integer field will show the translated valued. With the hex
position values still highlighted, check the Auto Transmit checkbox and then click send.
The highlighted position values will remain highlighted and the Hex to Integer value will
automatically be updated on the return of a read position command. This feature makes
it easier to decipher the reported position value as the encoder position value changes.

Clear Transmit or Receive Text Boxes

To clear the Transmit or Receive area text boxes, click the clear button within the
respective area.

Copy Selected Received bytes to Clipboard

There are a couple options when it comes to copying the bytes received from the device
to the clipboard. The default format used to copy the received data to the Windows
clipboard is one byte at a time separated by a space and left in the hex format.

 Specify the number of bytes to be grouped together. The possible options


available in the Bytes drop down list are 1, 2, and 4.
 Specify the delimiter to be used to separate the evaluated groupings. The
possible options available in the Delimiter dropdown list are Space, Comma, Tab,
and CR-LF.
 Specify the output format. The possible Format values are Hex and Integer.
Highlight the data received that is to be copied to the clipboard.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
12 of 20
COMTool User Guide
Version 1.1
12/02/2013

Highlight the data received using the mouse cursor and click the copy to clipboard
button. If the received data looks like the following, then the table below shows
examples for the clipboard content format.
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

Bytes Delimiter Format Clipboard Contents


1 Space Hex 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
2 Space Hex 0001 0203 0405 0607 0809 0A0B 0C0D 0E0F
4 Space Hex 00010203 04050607 08090A0B 0C0D0E0F
2 Comma Hex 0001,0203,0405,0607,0809,0A0B,0C0D,0E0F
2 Comma Integer 1,515,1029,1543,2057,2571,3085,3599
4 Comma Integer 66051,67438087,134810123,202182159
4 CR-LF Integer 66051
67438087
134810123
202182159

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
13 of 20
COMTool User Guide
Version 1.1
12/02/2013

COM I/O Status Indicators


RS-232 device may be classified as Data Terminal Equipment (DTE) or Data
communication Equipment (DCE). The COM I/O Status indicators represent the status
of some of the primary communication lines and will be greyed out when the COM port
is closed otherwise they are red or green.

The DCD indicator stands for Data Carrier Detect and is green when holding and red
when not holding.

The CTS indicator stands for Clear to Send and is green when the data communication
equipment is ready to accept data and the line is high and the indicator red when it is
low and not ready to receive data.

The DSR indicator stands for Data Set Ready and is green when the data
communication equipment is ready to receive commands or data and is red when not
ready.

The DTR indicator stands for Data Terminal Ready and is green when the presence of
DTE to DCE is detected and red when it is not connected.

The RTS indicator stand for Request to Send and is green when the DTE request the
DCE to prepare to receive data and red when no request is present.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
14 of 20
COMTool User Guide
Version 1.1
12/02/2013

Commands Tab
The Commands tab on the right half of the COMTool application is used to list a
predefined set of device commands that are stored in an MS Access database or .mdb
file. Each command contains a Description and Command field. The Description field
typically identifies the device and what the command does. The Command filed
contains the ASCII text or hex bytes that can be sent to a device. When the COMTool
application is first launched, the user may be prompted for the location of the
COMTool.mdb file. The typical path is C:\Program Files(x86)\US
Digital\COMTool\COMTool.mdb for 64 bits Windows and C:\Program Files\US
Digital\COMTool\COMTool.mdb for 32 bit systems.

To specify the location of the command database file, click on the open file button.

To save the device commands to a new database file, click on the save button.

 The database file contains commands for multiple device types. To filter the
commands by device product, click on the Filter by Product checkbox, otherwise
commands for all products will be listed.
 To add a command, enter the command description, press tab, enter the
command text and then press Enter key. The command will be saved to the
database using the selected Product.
 To delete a command, click on the desired command row selector and then
press the Delete key. Multiple command rows may be selected and deleted.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
15 of 20
COMTool User Guide
Version 1.1
12/02/2013

Scripts Tab
The Scripts tab on the right half of the COMTool application is also used to read, edit,
delete, execute, and save commands. The check boxes in front of each command listed
allows multiple commands to be selected and executed in a sequence. The list view
provides additional status information for each command executed.

The commands can be read from a tab delimited file by clicking on the open button and
saved to a file by clicking on the save button.

Each command has the following fields: Description, Command, Expected Reply,
Pause, Count, Reply, Status, and Completed.

Description
Field Name Comment
Description Identifies the device and what the command does.
Command Contains the ASCII text or hex bytes that can be sent to a device.
Expected Reply Contains the ASCII text or hex bytes that are compared with the
response from the device.
Pause (ms) Identifies the number of milliseconds to wait before attempting to
read the command reply.
Count Identifies the number of times to send the command.
Reply Contains the last command received.
Status Displays “Unknown” until a command is sent. Displays “Passed”
or “Failed” when a command is sent and a reply is received and
compared with the expected reply.
Completed Contains the number of times the specified command was
successfully sent and the reply match the Expected Reply.
US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 
Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
16 of 20
COMTool User Guide
Version 1.1
12/02/2013

Adding a New Script Command


To add a new script command, click on the Add button. The Add Script form will appear
allowing the user to enter update the script command fields.

Enter a description for the command being added in the Description field. The
Command and Expected Reply fields are automatically filled in with the contents of the
Transmit and Received fields.

If the command being entered is something like the A2 Read Position command where
the first byte is always the same and the last two bytes can vary depending on the
encoder position, then the Expected Reply can be modified to match the expected
format. The A2 Read Position will reply with a “1F xx xx” value, where the “xx xx”
pattern represents the position returned. The following regular expression may be used
to match the pattern: ^1F [A-F0-9]{2} [A-F0-9]{2}$

The “^” indicates the start of a string.


The open and closing brackets “[…]” look for an explicit set of characters to match.
The open and closing braces “{…}” look an explicit number of times the previous
qualifier is to be matched.
The “$” indicates the end of a string.

To test the regular expression, enter a sample reply in the Test Reply field. If the match
is successful, then the Test Reply Matches Expected Reply field will display “True”
otherwise “False”. The Expected Reply and the Test Reply are constantly evaluated as
characters are typed into these fields.

To copy and paste the example regular expression in the Expected Reply textbox, click
on the Copy + Paste button.

To see more examples on how to use regular expressions, click on the More Help
button.

Enter the number of milliseconds to wait before reading the reply in the Pause Delay
(ms) field.

Enter the number of times the command is to be executed in the Count Field.

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
17 of 20
COMTool User Guide
Version 1.1
12/02/2013

Click OK to accept the changes and add the command to the list view, otherwise click
Cancel to ignore the changes.

Editing a Script Command


To edit a script command, select the command row and then click to the Edit button.
The Edit Script Command dialog will appear containing the same fields and behavior as
the Add Script Command dialog.

Deleting a Script Command


To delete a command, select a command row and then click the Delete button.

Reorder Command Sequence


To change the sequence commands are listed and executed, click on either the Move
Up or Move Down button.

Selecting Commands to Execute


To check all commands, click on the Check All button. To uncheck all commands, click
on the Uncheck All button.
US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 
Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
18 of 20
COMTool User Guide
Version 1.1
12/02/2013

Executing a Scripts Command


To execute a script command, ensure that the device is connected and at least one
script command is selected and that a Script File is provided then click the run script

command button. The script file is used to identify the log file that is written to
when commands are executed. The results of each executed command are written to
the log file. The log file name is the same as the script file except the file extension is
renamed to .log.

When the script command button is pressed, the status and completed fields are reset
for each command that is checked for execution. As each command is executed, it is
copied to the Transmit field, the Receive field is cleared, the command is sent, and the
process then waits the Pause (in milliseconds) time before comparing the returned
results with the Expected Reply. If the comparison matches, then the Status field is
updated with “Passed” and the Completed field value is incremented by 1. If the
comparison does not match, then the Status field is updated with “Failed” and the next
selected command will be executed. The same command can be executed multiple
times, as long as the result from each comparison matches the Expected Reply.
Completed count shows the number of times the command was successfully executed.

The reply and comparison result of each executed command are written to a log file.
Sample script log file:
8/16/2012 10:19:49 AM Sent = F2 01Received = F2 01 F3 Passed = True Completed= 1
8/16/2012 10:19:49 AM Sent = 22 Received = 22 00 00 00 Passed = True Completed= 1
8/16/2012 10:19:50 AM Sent = F2 0D 08 Received = F2 0D 08 F7 Passed = True Completed= 1
8/16/2012 10:19:50 AM Sent = 1F Received = 1F 00 00 Passed = True Completed= 1
8/16/2012 10:19:50 AM Sent = 1F Received = 1F 00 00 Passed = True Completed= 2
8/16/2012 10:19:50 AM Sent = 1F Received = 1F 00 00 Passed = True Completed= 3

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
19 of 20
COMTool User Guide
Version 1.1
12/02/2013

8/16/2012 10:19:50 AM Sent = 1F Received = 1F 00 00 Passed = True Completed= 4


8/16/2012 10:19:50 AM Sent = 1F Received = 1F 00 00 Passed = True Completed= 5

US Digital  1400 NE 136th Avenue  Vancouver, Washington  98684  USA 


Local: 360-260-2468  Toll-free: 800-736-0194  Support: 360-397-9999  Fax: 360-260-2469
Email: [email protected]  Website: www.usdigital.com
20 of 20

You might also like