DGUS - SDK User Guide: Beijing DWIN Technology Co., LTD
DGUS - SDK User Guide: Beijing DWIN Technology Co., LTD
DGUS - SDK User Guide: Beijing DWIN Technology Co., LTD
Contents
1. DGUS_SDK Instruction
1.1 Operation of DGUS_SDK
1. DGUS (DWIN Graphical Utility Software) is an intelligent GUI design software for DWIN DGUS
LCM with K600+. By using DGUS, magnificent display effect can be achieved easily and rapidly
with much less programming than ever before. Variables are defined by DGUS_SDK and users
can feel free to design the visualize GUI. All parameters and images can be downloaded via SD
card which stores related .bin files to make your design into real application.
2. Install DGUS_SDK_V4.9:
Unzip DGUS_SDK_V4.9.rar, and click DGUS ToolV4.9.exe to run it.
(.net Framework 2.0 is required to run the software).
3. Variable Definition
VP (Variable Pointer): The addresses of variables in variable SRAM (56KB). Users can set
buttons with defined VP, to change the value in this address and display contents
corresponding with the value in VP address.
E.g.: If SP valued as 0x5000 for WordArt variable, VP parameter will be saved in the ADDRESS of
0x5000. Variable position parameters will be saved in 0x5001-0x5002
4. If you need to handle with icons, please drop icon files into Icon Generator to make icon file
running in DGUS correctly.
or
Navigation Bar:
New Create a new project.
Open Open an existing project (.hmi file).
Save Save the current project.
Save As Save the current project in a new folder.
Close Close the current project.
Resolution Modify resolution of project.
System Properties Modify system properties and save the settings in config.txt. Refer to
illustration below
Create Config. Generate <13Touch_Control_Config.bin> and <14Variable_Config.bin>.
Import Config. Import existing config. files to the current project.
Variable Export Generate <TouchConfig.xls> and <DisplayConfig.xls> for quick view of
buttons & variables.
Align Left Align the selected buttons and variables to left.
ToolBar:
Switching between "Touch Config" & "Variable Config" & Edit Tools using Navigation bar, or
shortcut key F2, F3,F4.
Variable Config : users can use DGUS_SDK to add variables on screen, including Variable Icon,
Animation Icon, Slider, WordArt, Image Animation, Icon Rotation, Data Variable, Text Display, RTC
Display, Analog Clock Display, Dynamic Trend Curve Display, Table Display, and Basic Graphic
Display, Bit Icon, Timer Variable. Variables are shown as light-blue rectangles in
DGUS_SDK_V49.
Parameter settings: users can use <System Properties> to adjust parameter settings of DGUS
module. Parameter with “0x” in front should be filled with hex numbers.
Ignore decimal point while setting range restriction for return value. E.g.: the setting is 3 integer
bits and 2 decimal bits, and then the top limit is 10000, rather than 100.
This function is only for making touching area for slider. To display it, please use <Slider display>
function.
Hold the button over 0.5 second and slide the slider to modify number in the right, the value will also be changed.
2.1.5 RTC
Selected Area: selected button area.
Preview: preview button effect.
Name: name this button for viewing it in .xls file.
Data Auto Upload: after pressing the button, key code auto sent
to serial port.
Button Effect: set picture ID for touching effect, -1: null.
Display Position: data position when typing.
Font Color: data color when typing.
Font Lib_ID: address of ASCII font file.
Font Size: horizontal pixel numbers.
Cursor Color: white/black cursor.
Keyboard setting:
Set the keyboard picture ID and the keyboard area.
Image ID: image ID of keyboard area.
Cut Area: cut area in image ID.
Paste Position: position of the keyboard on current screen.
Click <RTC> button - Keyboard Pops Up - Clock Sets Up the Current Time.
Set a <Return Key Code> button, of which VP is 0x000A, key value is 0x0005.
Note: Create <Touch control> buttons on keyboard to define the key code of the button (0x4161
indicates “A”).
Setup Mode
Mode Data Pack Description Function
Transmit data from register to variable SRAM in 0x6F00 to 0x6FFF (low
0x00 No No
bytes).
Transmit data from address 0x6F00 to 0x6FFF in variable SRAM (low
0x01 No No bytes) to register and reset module parameters including R1-R3,
R5-RA.
Coordinates of top-left Convert designated area to monochrome bitmap (vertical mode) and
Tran_Area
and bottom-right of area. save the data to designated VP address.
VP address for restoring A. Width (Xe-Xs+1) should be even.
*VP
bitmap data. B. Height (Ye-Ys+1) should be multiple of 8.
C. VP data format shown as below:
VP: status indicator, refreshed to 0x5555 after operation.
0x02
VP+1: horizontal length, by word. (Xe-Xs+1) &0xFFFE/2
VP+2: numbers of data segment. (Ye-Ys+1) &0xFFF8/8
VP+3: bitmap data, with MSB priority.
If the key code automatically upload is enabled (R2.3=1), module will
upload message (value in VP address upload to 0x5555) to serial port.
The command is mainly for printing of current screen.
*VP Variable pointer. Upload data in designated VP address to serial port.
0x03
Tx_LEN Length of data to be sent. Range of Tx_LEN: 0x0001-0xFFFF.
0x04 Same function with 0x03, uploading data to COM2 (reserved port).
Coordinates of top-left Convert designated area to monochrome bitmap (horizontal mode) and
Tran_Area
and bottom-right of area. save the data to designated VP address.
A. Width (Xe-Xs+1) should be multiple of 16.
B. VP data format as shown below:
VP: status indicator, refreshed to 0x5555 after operation.
0x05 VP+1: horizontal length, by word. (Xe-Xs+1) &0xFFF0/16
VP address for restoring
*VP VP+2: numbers of data segment. (Ye-Ys+1)
bitmap data.
VP+3: bitmap data, with MSB priority.
If the key code automatically upload is enabled (R2.3=1), module will
upload message (value in VP address upload to 0x5555) to serial port.
The command is mainly for printing of current screen.
Frame_He Send the current touched position to COM2 (serial port for reserving the
Frame header (2byte)
ad system), the format is:
0x06 Frame_Head + X + Y + Check (The cumulative Sum for 1 byte of X, Y)
Frame_En
Frame end (2byte) + Frame_end.
d
...... ......
2.2.3 Slider
Selected Area: (X, Y) are the top-left coordinates of icons.
X, W is start/end point of horizontal slider.
Y, H is start/end point of vertical slider.
Preview: preview VAR display effect.
Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
VP: variable pointer.
Start/End Value: value corresponding to start/end point.
Slider Mode: horizontal/vertical.
ICON File: address of icon file.
ICON ID: icon address in icon file.
Display Mode: transparent/background.
Coordinate Offset:
Offset to the left/top.
VAR Type:
Integer (whole VP address).
High byte in VP address.
Low byte in VP address.
Initial Value: Set the initial value & save it in the 22 config
file,the system will be initiated according to 22 config file when
the DGUS is started.
Note: Set same VP address for <Slider> button and <Slider display> variable to combine them.
2.2.4 WordArt
Selected Area: (X, Y) are the top-left coordinates of icons.
Preview: preview VAR display effect.
Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
VP: variable pointer.
ICON File: address of icon file.
ICON 0: icon address corresponding to number 0.
ICON Display Mode: transparent/background.
VAR Type: integer/long integer.
Number of INT/DEC bit: length of integer/decimal digits.
Initial Value: Set the initial value & save it in the 22 config
file,the system will be initiated according to 22 config file
when the DGUS is started.
Send serial commands or press buttons to change value in VP address, and then to adjust the
angle of pointer.
Illustration of variable <Icon Rotation >:
Icons file for rotation:
If the length of data is shorter than designated, please use 0xFFFF as end mark of data in this cell.
For oversized table, users can use slider to pull the table.
String Format
Address Definition Description
VP CMD Command
VP+1 Data_Pack_Num_Max Data Pack Number
VP+2 DATA_Pack
String Format
Address Definition Description
VP CMD Command
VP+1 Data_Pack_Num_Max Data Pack Number
VP+2 DATA_Pack
Value of bit
Display_Mode
0 1
0x00 ICON0S ICON1S
0x01 ICON0S Null.
0x02 ICON0S Animation: ICON1S - ICON1E.
0x03 Null. ICON1S
0x04 Null. Animation: ICON1S - ICON1E.
0x05 Animation: ICON0S - ICON0E. ICON1S
0x06 Animation: ICON0S - ICON0E. Null.
0x07 Animation: ICON0S - ICON0E. Animation: ICON1S - ICON1E.
3. Commands
3.1 Data Frame
Serial data frame is constituted with 5 parts as shown in chart below:
Data Block 1 2 3 4 5
Command Data
Definition Frame header Data length CRC checksum
type string
Data Length 2 1 1 N 2
Defined by R3 Including
and RA command type, Enabled by R2
Description 0x80-0x84
parameter in data string and parameter in config.txt
config.txt CRC checksum
3.3 Register
Register, 256 bytes, is used for hardware operation and process control.
Register Length
Address
Definition
(Byte)
Description
0x00 Version 1 DGUS version number, BCD code, 0x10 indicates V1.0.
0x01 LED_NOW 1 LED brightness, 0x00-0x40.
Variable SRAM
Variable SRAM, 28K words, is for storing real-time data. Variable SRAM is divided into 28K
address, ranging from 0x0000 to 0x6FFF.
Variable SRAM is read and written by word.
Variable SRAM is accessed by command 0x82/0x83.
Trend Curve Buffer
Trend curve buffer is for storing real-time trend curve data, supporting 8 trend curves
simultaneously. Trend curve buffer is written by word, each dot of trend curve occupies 2 bytes.
Trend curve buffer is accessed by command 0x84, write only.