You are on page 1of 10

POWER ELECTRONICS GROUP

DVRView
32-bit Windows Upgrade
Software Design Document

REVISION LOG

Rev.

Date

Description

0.1
1.0
1.1

January 17, 2002


March 7, 2002
May 3, 2002

Draft
Initial Release
Incorporate DVRView_SDD11.doc

POWER ELECTRONICS GROUP

TABLE OF CONTENTS
1.

GENERAL............................................................................................................................................................................... 4
1.1.

SCOPE.................................................................................................................................................................................4

1.2. PRODUCT DESCRIPTION...............................................................................................................................................4


1.2.1.
General Functionality.............................................................................................................................................4
1.2.2.
Interface Requirements ..........................................................................................................................................4

2.

1.3.

REFERENCES.....................................................................................................................................................................5

1.4.

DEFINITIONS....................................................................................................................................................................5

CHANGES FOR 32-BIT OPERATION............................................................................................................................. 5


2.1. COMMUNICATIONS ......................................................................................................................................................5
2.1.1.
OpenComm & CloseComm....................................................................................................................................5
2.1.2.
ReadFile and WriteFile...........................................................................................................................................5
2.1.3.
Communications Thread........................................................................................................................................5
2.1.4.
Thread Events .........................................................................................................................................................6
2.1.5.
Formatted Transmissions......................................................................................................................................6
2.2. MISCELLA NY...................................................................................................................................................................6
2.2.1.
Replacement of 0 parameters with NULL...........................................................................................................6
2.2.2.
Modification of About Diaglog............................................................................................................................6

3.

4.

APPLICATION CORRECTIONS...................................................................................................................................... 7
3.1.

MINUMUM to MINIMUM .............................................................................................................................................7

3.2.

DEMO MODE MONITOR SELECTION LOCK-OUT...............................................................................................7

ADDITTIONS AND MODIFICATIONS ........................................................................................................................... 7


4.1.

OPTIONS MENU SELECTION RE-NAME................................................................................................................7

4.2.

PF/KVAR AND PF REFERENCE EDIT WINDOW CHANGES..................................................................................7

4.3. VOLTAGE ADJUST CHANGES .....................................................................................................................................7


4.3.1.
PARAMETER vs. MONITIOR.............................................................................................................................7
4.3.2.
DATA DISPLAY....................................................................................................................................................8
4.3.3.
DATA STORAGE...................................................................................................................................................8

Prepared for Leroy Somer

Page 2 of 10

May 3, 2002

POWER ELECTRONICS GROUP


4.3.4.

PARAMETER ACCESS.........................................................................................................................................8

4.4. PF/KVAR............................................................................................................................................................................8
4.4.1.
PARAMETER vs. MONITOR ..............................................................................................................................8
4.4.2.
DATA DISPLAY....................................................................................................................................................8
4.4.3.
DATA STORAGE...................................................................................................................................................9
4.4.4.
PARAMETER ACCESS.........................................................................................................................................9
5.

6.

TESTING PLATFORMS ..................................................................................................................................................... 9


5.1.

WINDOWS 95 ...................................................................................................................................................................9

5.2.

WINDOWS 98 ...................................................................................................................................................................9

5.3.

WINDOWS NT..................................................................................................................................................................9

5.4.

WINDOWS 2000 .............................................................................................................................................................10

DEVELOPMENT ENVIRONMENT.................................................................................................................................10
6.1.

PC PLATFORM ...............................................................................................................................................................10

6.2.

DEVELOPMENT TOOLS ...............................................................................................................................................10

6.3.

REGULATOR...................................................................................................................................................................10

Prepared for Leroy Somer

Page 3 of 10

May 3, 2002

POWER ELECTRONICS GROUP

1.

GENERAL
1.1.

SCOPE

This document comprises the design of the 32-bit Windows upgrade of the DVRView application software
used for communications with a Regulator, Parameter display, and editing and data display.
1.2.

PRODUCT DESCRIPTION
1.2.1.

General Functionality

The DVRView software is an application that is a graphical interface to a microprocessor-based


voltage regulator. The application provides a graphical means for an individual to observe and
modify parameters and data. The program interfaces to the regulator using one of two methods,
either a serial connection or a modem based cable connection. Parameters may be both displayed
and edited. Data inputs may be observed and displayed in several ways: Histogram, VU Meter,
Strip Chart or Analog Meter.
The application was originally written to run on a 16-bit Windows platform. The main purpose of
this upgrade is to convert the program to run on 32-bit Windows platforms, namely Windows
95/NT/98/2000.
Other changes to the application were requested to alter existing functionality or correct errors that
were present in the original version.
1.2.2.

Interface Requirements
1.2.2.1. Serial Connection
The serial port connection is selectable by the user. The operator may choose from Comm
Ports 1 through 8. The other settings for the serial communications link are not accessible
to the user and were hard coded in the original application:
BAUD
Data bits
Parity
Stop bits

9600
8
None
1

1.2.2.2. Modem Cable Connection


This connection is similar to the straight serial connection in its set up. The Port to
which the modem is connected is selectable by the operator. Similarly, the
communications parameters for the connection to the modem through the COMM port
remains hard coded in the application software as in the original version.

Prepared for Leroy Somer

Page 4 of 10

May 3, 2002

POWER ELECTRONICS GROUP

BAUD
Data bits
Parity
Stop bits

9600
8
None
1

The operator is allowed to configure the Modem initialization, Hang up and the Dial
Strings through a dialog window.
1.3.

REFERENCES

Specification Systems Operation Testing and Adjusting Digital Voltage Regulator


Caterpillar
SENR5833-02
April 1999
1.4.
2.

DEFINITIONS

CHANGES FOR 32-BIT OPERATION


Several library routines have either changed or are no longer supported when comparing the 16-bit and 32bit development environments. The calls to routines that still exist were modified when necessary to allow
continued operation and compilation. When an older methodology or routine was no longer supported, it
was replaced with a 32-bit equivalent.
2.1.

COMMUNICATIONS
2.1.1.

OpenComm & CloseComm

These routines are not supported in the 32-bit development environment. They were used to open
and close the communications ports. In the 32-bit environment they have been replaced by the
OpenFile and CloseHandle routines.
2.1.2.

ReadFile and WriteFile

The 16-bit routines for reading and writing to a COMM port were ReadComm and WriteComm. The
32-bit replacements for these routines are ReadFile and WriteFile. Reading and writing in Win32 is
significantly different from reading and writing serial communications ports in 16-bit Windows.
Win32 reading and writing can involve many more functions and choices. These new routines to
read and write the Comm port allow the use of the overlapped method of communication, which
provides for the possibility of other communications threads to be run simultaneously and for
these threads to work in the background of the application.
2.1.3.

Communications Thread

Rather than utilizing the methodology of 16-bit Windows, WIN32 requires a separate thread be
created for controlling the communications. This thread is monitored for the transmission and
reception of communications. The thread is set up as overlapped so that the communications does

Prepared for Leroy Somer

Page 5 of 10

May 3, 2002

POWER ELECTRONICS GROUP


not become a bottleneck for the application. For instance, a transmission is started and then the
main application continues to run. The thread for the communications takes care of completing the
transmission. In this way one does not need to wait for the transmission to be completed before
continuing on with rest of the application.
2.1.4.

Thread Events

Due to the new method of communications being used, thread events had to be created for the
handling of communications. An event thread was created for both reading and writing to the
COMM port.
2.1.5.

Formatted Transmissions

It was necessary to format the transmission of CDUdata requests to use at least two digits for the
CDU number. This was due to the fact that when run on the Windows NT operating system, if
only a single digit was used for CDUs 1- 9 the communications failed. These CDUs needed to be
sent as 01-09 in order for the communications to function properly. The single digit sends caused
the communications protocol to hang. The other Windows platforms did not exhibit this problem.
No deleterious effects resulted from the use of the two-digit CDUs on any tested Windows
platform. The modification was implemented in the QueryNextCDU() routine.
2.2.

MISCELLANY
2.2.1.

Replacement of 0 parameters with NULL

Several routines would not compile properly under the new environment with their parameters as
they were for 16-bit development. These routines were SendMessage, PostMessage and
SendDlgItemMessage. In these routines, additional message information may be passed in the
third and fourth parameters. In the original code these value, when not actually being used, were
filled in with 0. In the new development, these routines would cause compiler errors when a 0 was
passed for those parameters. Instead of the 0 a NULL was passed and this allowed proper
compilation.
2.2.2.

Modification of About Diaglog

The About dialog was modified from the Win 3.11 version as the percent resource free attribute is
not supported in the 32-bit world. Instead the size of the physical memory and the amount of
physical memory in use is reported to the user.
The information about the Windows Platform being run has also been updated. The application
will report, through a query to the operating system, which operating is currently being run.

Prepared for Leroy Somer

Page 6 of 10

May 3, 2002

POWER ELECTRONICS GROUP


3.

APPLICATION CORRECTIONS
3.1.

MINUMUM to MINIMUM

The resource for the parameter-editing window contained a spelling mistake. The word minimum was
misspelled as minumum. This was corrected throughout the application.
3.2.

DEMO MODE MONITOR SELECTION LOCK-OUT

The demonstration mode of the original application would prevent an operator from re-entering the Monitor
menu selection once that menu selection had been exited under the 32-bit operating systems. The code was
modified to allow re-entrance into the Monitor portion of the application if it had previously been accessed.
4.

ADDITTIONS AND MODIFICATIONS


4.1.

OPTIONS MENU SELECTION RE-NAME

The VIEW menu selection choice named OPTIONS was renamed PARALLELING PARAMETERS. This
was a simple modification made to the strings used in the Create Window routine.
4.2.

PF/KVAR AND PF REFERENCE EDIT WINDOW CHANGES

It was requested that different verbiage be used for the PF/KVAR and PF Reference select windows.
Namely in the PF/KVAR select window Maximum wass replaced with KVAR and Minimum was
replaced with PF. In the PF Reference select window Maximum was replaced by Maximum Lead
and Minimum replaced by Minimum Lead and Note: 1.10 represents 0.9 lead was added as well. The
resource for the select window is not easily modified for exceptions as its display parameters are not
accessible by the application. In order to implement these changes two new resources were created, one for
PF/KVAR and the other for PF Reference. The application calls the required selection window based on
the CDU number of the parameter being accessed. In this manner, the new strings and information will be
displayed at the proper time without affecting the normal operation of the select window resource for the
other parameters. The exceptions are handled in the ParmWinProc routine under the WM_COMMAND
switch case.
4.3.

VOLTAGE ADJUST CHANGES


4.3.1.

PARAMETER vs. MONITIOR

The Voltage Adjust parameter was located in the monitor section of the application. It was
requested that it be moved to the to the Parameters window. This was accomplished by excluding
this CDU (70) from the Monitor listing of valid CDUs. The CDU was added to the Parameters valid
CDU range to allow it to be displayed in that Window. Additional changes were made to the
Parameter window selection routine so that the proper CDU number was returned when the Voltage
Adjust selection was made from list of parameters. This parameter was added to the end of the
Parameter list of CDUs.

Prepared for Leroy Somer

Page 7 of 10

May 3, 2002

POWER ELECTRONICS GROUP


4.3.2.

DATA DISPLAY

The Voltage Adjust parameter has a range of 0 to 200. This is not the range that is to be displayed
to the operator. Instead, the 0-200 range is translated to 100 to +100. It is also displayed with one
decimal point. This was accomplished by adding an exception to the ConvertDP routine to handle
this specific parameter. The ConvertDP routine already calculates the decimal place for the
displayed data so this was the logical place to add the exception handling. The exception case
added performs the translation the data.
4.3.3.

DATA STORAGE

The Voltage Adjust parameter has a range of 0 to 200. This is not the range that is displayed to
operator. The operator adjusts this value in a range of +/- 10%. The value that is sent to the
regulator must be in the 0-200 range. Therefore an exception for Voltage Adjust (CDU 70) has been
added to the SetCDUDlgProc routine. It translates and ranges the +/- 10 % range of the setting to
the 0-200 range of the regulator by multiplying the setting by 10 and then adding 100 to it. NOTE
that this is actually a monitor parameter and an updated value does not get stored in the regulators
non-volatile memory. Therefore the diagnostic window will report that the CDU 70 was not
updated to the new value.
4.3.4.

PARAMETER ACCESS

The Voltage Adjust parameter is not always going to be present on a DVR device. This was not
initially known to be the case and version 3.7.0 of the software was written under the assumption
that this parameter would be present. Since that is not the case, problems occurred when this
parameter was not present. The DVRView application poles the DVR for the initial value of all the
parameters. This parameter was not present and the DVR responded to the query with a dump of
the active parameter numbers. This caused a loop to be entered where the initial values of all the
parameters were constantly being requested. Version 3.7.1 fixes this problem, allowing DVRView to
run properly whether this parameter is present in the DVR or not.

4.4.

PF/KVAR
4.4.1.

PARAMETER vs. MONITOR

The PF/KVAR parameter was located in the Monitor section of the application. It was requested
that it be moved to the to the Parameters window. This was accomplished by excluding this CDU
(71) from the Monitor listing of valid CDUs. The CDU was added to the Parameters valid CDU
range to allow it to be displayed in that Window. Additional changes were made to the Parameter
window selection routine so that the proper CDU number was returned when the PF/KVAR
selection was made from list of parameters. This parameter was added to the end of the Parameter
list of CDUs following the added Voltage Adjust Parameter.
4.4.2.

DATA DISPLAY

The PF/KVAR parameter has a range of 0 to 200. This is not the range that is to be displayed to
the operator. Instead, the 0-200 range is translated to 100 to +100. This was accomplished by

Prepared for Leroy Somer

Page 8 of 10

May 3, 2002

POWER ELECTRONICS GROUP


adding an exception to the ConvertDP routine to handle this specific parameter. The ConvertDP
routine already calculates the decimal place for the displayed data (in this case no decimal point) so
it was the logical location for the addition of an exception handler. The added exception case, as is
done with the Voltage Adjust parameter, performs the translation the data. This effectively
shows the data in a range of +/- 100% now.
4.4.3.

DATA STORAGE

The PF/KVAR parameter has a range of 0 to 200 in the regulator. This is not the range that is
displayed to operator. The operator adjusts this value in a range of +/- 100%. The value that is
sent to the regulator must be in the 0-200 range. Therefore an exception for PF/KVAR (CDU 71)
has been added to the SetCDUDlgProc routine. It translates the +/- 100 % range of the setting to
the 0-200 range of the regulator by adding 100 to it. NOTE that this is actually a monitor parameter
and an updated v alue does not get stored in the regulators non-volatile memory. Therefore the
diagnostic window will report that CDU 71 was not updated to the new value.
4.4.4.

PARAMETER ACCESS

The PF/KVAR parameter is not always going to be present on a DVR device. This was not
initially known to be the case and version 3.7.0 of the software was written under the assumption
that this parameter would be present. Since that is not the case, problems occurred when this
parameter was not present. The DVRView application poles the DVR for the initial value of all the
parameters. This parameter was not present and the DVR responded to the query with a dump of
the active parameter numbers. This caused a loop to be entered where the initial values of all the
parameters were constantly being requested. Version 3.7.1 fixes this problem, allowing DVRView to
run properly whether this parameter is present in the DVR or not.
5.

TESTING PLATFORMS

The application is to function on four versions of the 32-bit Windows operating systems. These are Windows 95,
Windows 98, Windows NT and Windows 2000. All systems had two COM ports and each port was used to test
both the straight serial as well as the modem communications. The following versions of those operating were used
for testing.
5.1.

5.2.

5.3.

WINDOWS 95
Version 4.00.950a

WINDOWS 98
Version 4.10.2222 A

WINDOWS NT
Version 4.00.1381

Prepared for Leroy Somer

Page 9 of 10

May 3, 2002

POWER ELECTRONICS GROUP


5.4.

6.

WINDOWS 2000
Version 5.00.2195

DEVELOPMENT ENVIRONMENT

Following is the set up of the system used for the modification of the DVRView application into a 32-bit application.
6.1.

6.2.

6.3.

PC PLATFORM
PC compatible, Pentium machine
120 Megabyte RAM
Windows 2000, Version 5.00.2195
DEVELOPMENT TOOLS
Microsoft Visual Studio, Version 6.0
Microsoft Visual C++, Version 6.0
REGULATOR
Model 130-3475 (lab unit)
Control Board Software, v 1.05

Prepared for Leroy Somer

Page 10 of 10

May 3, 2002

You might also like