presto_en.pdf - 第69页

Page 69 eName:PCha r;Value:PC har):BOOL; stdcall; FunctionUP _SetIntValu e_Wnd(WndCl ass:PChar; Valu eName:PCha r;Value:in teger):BOO L;stdcall; FunctionUP _GetStrValu e_Wnd(WndCl ass:PChar; Valu eName:PCha …

100%1 / 101
Page 68
Example of use
var
 window:HWND;
begin
 window:=FindWindow('upv1.x',nil);
Result:=SendMessage(window,
WM_USER,0,0);
end.
1
Only parameter lParam=1 or lParam=2 are allowed for
AVR microcontrollers.
5.8
UP_DLL.DLL Library
Thanks to this library strings can be exchanged with the
UP program.
As the library needs to communicate with UP, the
program must be running. UP_DLL cannot work on its
own.
unitup_dll;
interface
FunctionUP_LoadFile(FileName:PChar;style:in
teger):integer;stdcall;
(*
*LoadFile(withextension.hexor.ppr);
*Loadingof.pprfilecanresultinloading.he
xfiletoo;
*Resultcodesaresamelikeoncommand
*line.
*
*Style|
=1;UPwillbequietonfileloaderrors
*Style|
=2;UPwilldonopreviousfilesaving
*
*)
FunctionUP_GetStrValue(ValueName:PChar;Value:
PChar;Size:integer):integer;stdcall;
FunctionUP_GetIntValue(ValueName:PChar;varVa
lue:integer):LongBool;stdcall;
FunctionUP_SetStrValue(ValueName:PChar;Value:
PChar):LongBool;stdcall;
FunctionUP_SetIntValue(ValueName:PChar;Value:
integer):LongBool;stdcall;
FunctionUP_LoadFile_Wnd(WndClass:PChar;FileNam
e:PChar;style:integer):integer;stdcall;
FunctionUP_SetStrValue_Wnd(WndClass:PChar;Valu
Page 69
eName:PChar;Value:PChar):BOOL;stdcall;
FunctionUP_SetIntValue_Wnd(WndClass:PChar;Valu
eName:PChar;Value:integer):BOOL;stdcall;
FunctionUP_GetStrValue_Wnd(WndClass:PChar;Valu
eName:PChar;Value:PChar;Size:integer):inte
ger;stdcall;
FunctionUP_GetIntValue_Wnd(WndClass:PChar;Valu
eName:PChar;varValue:integer):LongBool;std
call;
(*
*Allthesefunctionsareusedforchanging
*internalsettingsofUPinruntime.
*UP_GetIntValue,UP_SetStrValue,
*UP_SetIntValuereturnsnonzeroif
*successful
*UP_GetStrValuereturnsamountof
*characterstocopyintoValuestring
*includingnullterminator
*IfSizeislessthanrequiedsize,no
*charactersarecopied.
*)
FunctionUP_GetChecksum(Recalculate:integer;Ch
ecksum:PChar;Size:integer):BOOL;stdcall;
FunctionUP_GetChecksum_Wnd(WndClass:PChar;Reca
lculate:integer;Checksum:PChar;Size:integer
):BOOL;stdcall;
(*
*Thesefunctionsreturnchecksumvaluefromthe
UP,where:
*Recalculate=0;onlyreturnsthechecksum
*Recalculate=1;checksumwillberecalculated
first
*Checksum;thereturnedchecksumasstring
*Size;thelengthoftheChecksumarray,theca
llerhavetofill
*WndClass;theUPwindowclassname
*)
implementation
functionUP_LoadFile;external'up_dll.dll';
functionUP_GetStrValue;external'up_dll.dll';
functionUP_GetIntValue;external'up_dll.dll';
functionUP_SetStrValue;external'up_dll.dll';
functionUP_SetIntValue;external'up_dll.dll';
functionUP_LoadFile_Wnd;external'up_dll.dll';
functionUP_SetStrValue_Wnd;external'up_dll.dl
l';
functionUP_SetIntValue_Wnd;external'up_dll.dl
l';
functionUP_GetStrValue_Wnd;external'up_dll.dl
l';
functionUP_GetIntValue_Wnd;external'up_dll.dl
l';
functionUP_GetChecksum;external'up_dll.dll';
functionUP_GetChecksum_Wnd;external'up_dll.dl
l';
end.
For further information see Appendix A UP_DLL.DLL.
5.9
Running More Than
One Instance of UP
If you need to connect more than one programmer to one
computer, a separate instance of UP must be running for
each programmer connected.
UP should be running in just one instance for standard
use. Each additional instance just sends commands from
Page 70
the command line to the already running first instance or
makes it visible in another way.
However, UP can be started and run in several instances if
used together with the parameter /w and a different
window class name. Those programs (instances) having
the same window class name will communicate with each
other.
Parameters for the program controlled from the command
line are described in
Running UP from Command Line.
Example of use
The first instance of UP can be started the standard way
from the start menu.
Additional instances can be started from the command
line as up.exe /w "another up", for example.
5.10
Access of More UP
Instances to One
Programmer
Only one program or utility can access one programmer
at any one time.
The operating system takes care of the access rights of
programmers connected to the USB interface.
If UP is running, the operating system does not allow any
other program to access the selected programmer as UP
needs to continually check the GO button state and the
voltage on the feeding pin.
UP can temporarily be prohibited to access the
programmer and the programmer freed this way for
another application. This can be done by choosing
Options Select programmer. As long as this dialog is
open, another program can access the programmer. The
data the system works with in HEX editors does not get
lost by closing this dialog window.
5.11
Updating UP
If a newer program version is available on the web, it is
recommended to update the existing version as it may
eliminate known bugs or make the programming
algorithm for a particular device more efficient.
New versions also add newly supported types of devices.
Updates are free and are very easy. You can download a
new program version from
https://www.asix.tech/
prg_up_en.html
and simply install it over the previous one
by running the installer and clicking the Next button till it
finishes.
You do not have to worry about losing the settings you
created in your current program version. The installation
preserves all of them.
You can set an automatic check for newer versions on the
web in Options Program settings Others.
5.12
Appendix A UP_DLL.DLL
This appendix deals with the names of settings and
values of functions in the UP_DLL.DLL library.
Please look at the sample batch files in UP installation
folder for better understanding.
The following information is provided only for experienced
users and does not provide any guarantee.
5.12.1 Data Types
string is string
integer signed 32bit value
boolean accessed like integers; 0 is false, other
value is true