Dvrview 32-Bit Windows Upgrade: Power Electronics Group
Dvrview 32-Bit Windows Upgrade: Power Electronics Group
DVRView
32-bit Windows Upgrade
Software Design Document
REVISION LOG
Rev.
Date
Description
0.1
1.0
1.1
Draft
Initial Release
Incorporate DVRView_SDD11.doc
TABLE OF CONTENTS
1.
GENERAL............................................................................................................................................................................... 4
1.1.
SCOPE.................................................................................................................................................................................4
2.
1.3.
REFERENCES.....................................................................................................................................................................5
1.4.
DEFINITIONS....................................................................................................................................................................5
3.
4.
APPLICATION CORRECTIONS...................................................................................................................................... 7
3.1.
3.2.
4.2.
Page 2 of 10
May 3, 2002
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.
WINDOWS 95 ...................................................................................................................................................................9
5.2.
WINDOWS 98 ...................................................................................................................................................................9
5.3.
WINDOWS NT..................................................................................................................................................................9
5.4.
DEVELOPMENT ENVIRONMENT.................................................................................................................................10
6.1.
PC PLATFORM ...............................................................................................................................................................10
6.2.
6.3.
REGULATOR...................................................................................................................................................................10
Page 3 of 10
May 3, 2002
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
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
Page 4 of 10
May 3, 2002
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
DEFINITIONS
COMMUNICATIONS
2.1.1.
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.
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
Page 5 of 10
May 3, 2002
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.
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.
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.
Page 6 of 10
May 3, 2002
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.
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.
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.
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.
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.
Page 7 of 10
May 3, 2002
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.
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
Page 8 of 10
May 3, 2002
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
Page 9 of 10
May 3, 2002
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
Page 10 of 10
May 3, 2002