DGUS - SDK User Guide: Beijing DWIN Technology Co., LTD

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Professional, Creditable, Successful

DGUS_SDK User Guide


(Ver4.9 2013.02)

Beijing DWIN Technology Co., Ltd.


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

Contents

1. DGUS_SDK_V4.9 Instruction ...................................................................................................... 2


1.1 Operation of DGUS_SDK_V4.9 .......................................................................................... 2
1.2 Main Interface of DGUS_SDK_V4.9 ................................................................................... 4
2. Main Functions of DGUS_SDK .................................................................................................... 6
2.1 Add Touch Buttons .............................................................................................................. 7
2.1.1 Popup Window .......................................................................................................... 7
2.1.2 Variable Data Input ................................................................................................... 8
2.1.3 Incremental Adjustment .......................................................................................... 10
2.1.4 Slider Adjustment .....................................................................................................11
2.1.5 RTC ......................................................................................................................... 12
2.1.6 Touch Control .......................................................................................................... 13
2.1.7 Return Key Code .................................................................................................... 14
2.1.8 ASCII Input .............................................................................................................. 16
2.1.9 Firmware Parameter Settings ................................................................................. 17
2.2 Add Variable Buttons ......................................................................................................... 18
2.2.1 Variable Icon ........................................................................................................... 18
2.2.2 Animation Icon ........................................................................................................ 19
2.2.3 Slider ....................................................................................................................... 20
2.2.4 WordArt ................................................................................................................... 21
2.2.5 Image Animation ..................................................................................................... 22
2.2.6 Icon Rotation ........................................................................................................... 23
2.2.7 Data Variable .......................................................................................................... 24
2.2.8 Text Display............................................................................................................. 25
2.2.9 Digital RTC Display ................................................................................................. 26
2.2.10 Analog Clock Display ............................................................................................ 27
2.2.11 Dynamic Trend Curve ........................................................................................... 28
2.2.12 Table Display......................................................................................................... 29
2.2.13 Basic Graphic Display........................................................................................... 31
2.2.14 Special Industrial Application ................................................................................ 33
2.2.15 Bit Variable Icon .................................................................................................... 34
2.2.16 Timer Variable ....................................................................................................... 36
3. Commands ................................................................................................................................. 37
3.1 Data Frame ....................................................................................................................... 37
3.2 Command Set ................................................................................................................... 37
3.3 Register ............................................................................................................................. 38

Beijing DWIN Technology Co., Ltd. 1 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.

 SP (Stack Pointer): the address of definitions, starting address of description data of


variables. Change the value in particular address to modify variable properties. Take
<WordArt> function as example.
Data
Add. Definition Description
Length
0x00 0x5A03 2
0x02 *SP 2 Stack pointer, default setting is 0xFFFF.
0x04 0x0007 2 The whole process length (in terms of words).
0x06 0x00 *VP 2 Variable pointer.
0x08 0x01 X,Y 4 Top-left coordinate of text, left aligned.
0x0C 0x03 Icon0 2 Icon ID corresponding to 0, the sequence is “0123456789-.”.
0x0E 0x04:H Icon_Lib 1 Address of icon file.
ICON display mode.
0x0F 0x04:L Icon_Mode 1
0x00: transparent, others: opaque.
0x10 0x05:H Int_Num 1 Length of integer digits.
0x11 0x05:L Dec_Num 1 Length of decimal digits.
0x12 0x06:H VP_Data_Mode 1 0x00: integer (2 bytes), 0x01: long integer (4 bytes).

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

Beijing DWIN Technology Co., Ltd. 2 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

4. If you need to handle with icons, please drop icon files into Icon Generator to make icon file
running in DGUS correctly.

5. How to select area for buttons & variables.


A. Input coordinates directly.

or

B. Drag the button/variable with mouse.

6. Define SP address for variables.


SP defines the description of variable settings; to reduce overlap of SP address is necessary.
There is overlap judging embedded, Configuration files won’t be created with failure message
when it comes an overlap of SP address.

7. Import existing DGUS config. files into new project.


A. Create a new project.
B. Add pictures.
C. Import config files.
D. Copy icon files into <DWIN_SET> folder.

Note: Frame header is self-defined by users. In this document, A5 5A is taken as


frame header for instance.

Beijing DWIN Technology Co., Ltd. 3 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

1.2 Main Interface of DGUS_SDK_V49

a) Click <New Project> to activate the window below:

b) Select resolution and path for your project.

Screen Property Set.


E.g. for:
DMT80480T070_06WT.
Color T: 16bit.
Resolution 80480: 800x480.

Beijing DWIN Technology Co., Ltd. 4 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.

Align Top Align the selected buttons and variables to right


Auto Width Adjust the selected buttons & variables at same width.
Auto Height Adjust the selected buttons & variables at same height.
Copy (Ctrl + C): copy
Paste (Ctrl + V): paste
Delete (delete): delete
Front Place the button or variable at front layer.
Back Place the button or variable at backward layer.
SP Address Setting Set SP for variables.
Variables Preview Preview buttons & variables
Show Text show the names of buttons & variables or not.
Reference:Inputted data will be sent via serial port only when both <TPSAUTO> in System Config.
Window and <Data Auto Upload> settings in buttons properties are ticked.

ToolBar:

Switching between "Touch Config" & "Variable Config" & Edit Tools using Navigation bar, or
shortcut key F2, F3,F4.

Beijing DWIN Technology Co., Ltd. 5 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2. Main Functions of DGUS_SDK


Touch Config : users can use DGUS_SDK software to add buttons on screen, including Popup
Window, Variable Data Input, Incremental Adjustment, Slider Adjustment, RTC Setting, Touch
Control, Return Key Code, and ASCII Input. Buttons are shown as yellow rectangles in
DGUS_SDK_V4.9. Users can also add press effect for buttons.

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.

Beijing DWIN Technology Co., Ltd. 6 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1 Touch Config.

2.1.1 Popup Window


Selected Area: selected button area.
Preview: preview button effect.
Name: name this button for viewing it in .xls (Excel) 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.
VP: variable pointer.
VAR Type:
INT: write key code in VP address (word).
High Byte: write low byte of key code in high byte of VP.
Low Byte: write low byte of key code in low byte of VP.
Bit: write data from last bit of key code into designated bit of VP
address. (0x10 corresponds to VP.0, 0x1F corresponds to VP.F).
Popup Window: set window picture ID and window area.
Image ID: image ID of window picture.
Cut Area: cut area in image ID.
Paste Position: position of window on current screen.

Note: Only <Touch Control> buttons will work on popup window.

Illustration of button <Popup Window>:

Click <Stop> button - Window pops up - Select YES/NO.

Beijing DWIN Technology Co., Ltd. 7 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.2 Variable Data Input


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.
Jump To: switch to a new picture after pressing.
VP: variable pointer.
VAR Type:
INT: integer.
LONGINT: long integer.
High byte: high byte in VP address.
Low byte: low byte in VP address.
Number of INT Bit: length of integer digits.
Number of DEC Bit: length of decimal digits.
Position: data position when typing.
Font Color: data color when typing.
Font ID: address of ASCII font file.
Font Size: horizontal pixel numbers.
Cursor Color: white/black cursor.
Display Mode: masked by (*)/direct display.
Define Keyboard:
Set the keyboard picture ID and the keyboard area.
Image ID: image ID of the keyboard area.
Cut Area: cut area in image ID.
Paste Position: position of the keyboard on current screen.
Enable VAR Input Limitation:
Set limits for inputting numbers.

Notes: Only <Touch Control> buttons will work on keyboard:


0x00F1 (Confirm), 0-9 corresponds to 0x0030 - 0x0039, 0x00F0 (Cancel), 0x00F2 (Backspace),
0x002D (+/-), 0x002E (.).

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.

Inputted data can be displayed by <Data Variable>, <WordArt> etc.

Beijing DWIN Technology Co., Ltd. 8 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

Illustration of button <Variable Data Input>:

Click text – Keyboard pops up – Type data – OK.


Click <Cancel> to interrupt input.

Beijing DWIN Technology Co., Ltd. 9 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.3 Incremental Adjustment


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.
VP: variable pointer.
VAR Type:
0x00: integer.
0x01: high byte in VP address.
0x02: low byte in VP address.
0x10 – 0x1F: adjust value in designated bit of VP address. (0x10
corresponds to VP.0, 0x1F corresponds to VP.F) Step Size must
be 0 or 1.
Adjustment Method: ++/--.
Over-limit Operation: stop/ cycle.
Step Size: set step size for +/- buttons.
Min. Value: minimum value for adjustment.
Max. Value: maximum value for adjustment.

Adjusted data can be displayed by <Data variable>, <Icon variable>


and <WordArt> etc.

Illustration of button <Incremental Adjustment>:

Click <+> or <-> to adjust corresponding value.


Hold the button to adjust continually.

Beijing DWIN Technology Co., Ltd. 10 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.4 Slider Adjustment


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.
VP: variable pointer.
Value Return Type:
0x00: integer.
0x01: high byte in VP address.
0x02: low byte in VP address.
Direction: horizontal/vertical.
Start Return Value:
The value corresponding to left/top side of slider.
End Return Value:
The value corresponding to right/bottom side of slider.

This function is only for making touching area for slider. To display it, please use <Slider display>
function.

Adjusted data can be displayed by <Data variable>, <Variable icon> etc.

Illustration of button <Slider Adjustment>:

Hold the button over 0.5 second and slide the slider to modify number in the right, the value will also be changed.

Beijing DWIN Technology Co., Ltd. 11 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.

Notes: A keyboard setting is the same as <Data Input>.

Use <RTC display> or <Analog clock display> to display current time.

Illustration of button <RTC>:

Click <RTC> button - Keyboard Pops Up - Clock Sets Up the Current Time.

Beijing DWIN Technology Co., Ltd. 12 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.6 Touch Control


Selected Area: selected button area.
Preview: preview button effect.
Name: name this button for viewing it in .xls file.
Button Effect: set picture ID for touching effect, -1: null.
Jump To: switch to a new picture after pressing.
KeyValue:
Only <Touch Control> button works on keyboard area.

Valid key code range: 0x0030 - 0x0039 (0-9), 0x002E (.),


0x002D (+/-), 0x00F0 (Cancel), 0x00F1 (Confirm),
0x00F2 (Backspace).

Beijing DWIN Technology Co., Ltd. 13 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.7 Return Key Code


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.
Jump To: switch to a new picture after pressing.
KeyValue: self-defined keyValue for buttons.
VP: variable pointer.
VP Type:
Save in VP address.
Save in high byte of VP address.
Save in low byte of VP address.
Save in specified bit of VP address.

Illustration of button <Return Key Code>:

Set a <Return Key Code> button, of which VP is 0x000A, key value is 0x0005.

Beijing DWIN Technology Co., Ltd. 14 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

DGUS module auto uploads data 0005 to serial port as shown.

Beijing DWIN Technology Co., Ltd. 15 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.8 ASCII Input


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.
Jump To: switch to a new picture after pressing.
VP: variable pointer.
Text Length: length of text, by word, range from 1 to 123.
Input Mode: re-input/ edit text.
Font Lib_ID: address of ASCII font file.
Font Width: horizontal pixel numbers.
Font Height: vertical pixel numbers.
Cursor Color: white/black.
Font Color: data color when typing.
Upload value as typing: tying status upload.
Text Display Area: data position on screen when typing.
Keyboard Displayed in: Current Page/Other Page.
Keyboard Setting:
Set the keyboard picture ID and the keyboard area.
Image ID: image ID of the keyboard area.
Cut Area: cut area in image ID.
Paste Position: position of the keyboard on current screen.

Note: Create <Touch control> buttons on keyboard to define the key code of the button (0x4161
indicates “A”).

Inputted data can be displayed with <Text display> function.

Illustration of button <ASCII Input>:

Beijing DWIN Technology Co., Ltd. 16 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.1.9 Firmware Parameter Settings


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.
Jump To: switch to a new picture after pressing.
Mode: setup mode.
DataPack: data pack of setup.

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

Beijing DWIN Technology Co., Ltd. 17 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2 Variable Config.

2.2.1 Variable Icon


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.
Set SP to load description data into variable SRAM.
0xFFFF: load description data from configuration file.
VP: variable pointer.
ICON File: address of icon file.
Min/Max value: limits of variables, null if over limit.
Icon ID:
Icon address in icon file corresponding to the min/max
value.
Display Mode: transparent/background.
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.

Illustration of variable <Variable Icon>:

Change the value in VP address to display different icons.

Beijing DWIN Technology Co., Ltd. 18 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.2 Animation Icon


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.
V_Stop: set value to stop animation.
V_Start: set value to start animation.
ICON File: address of icon file.
ICON Stop: icon at V_stop value.
Icon_Start/Icon_End:
Start/end icon for animation at V_start Value.
ICON Display Mode: transparent/background.
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.

Illustration of variable <Animation Icon>:


When value in VP address is 0, screen display icon 0:

When value in VP address is 9, animation starts.

...... ......

Beijing DWIN Technology Co., Ltd. 19 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.

<Slider display> is also used as progress bar.

Send command to serial port:


Frame header, Length, Command, VP, Data string to display the Slider and Data above.
A5 5A 05 82 000C 002C

Beijing DWIN Technology Co., Ltd. 20 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.

Illustration of variable <WordArt >:

Send command to serial port:


Frame header, Length, Command, VP, Data string to display the WordArt above.
A5 5A 05 82 0CCC 0017

Beijing DWIN Technology Co., Ltd. 21 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.5 Image Animation


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.
Start Image ID: select starting picture of animation.
End Image ID: select ending picture of animation.
Image Switching Time:
Select switching speed for animation, by every 8ms.
I

Start image ID should be less than end image ID.


Set a <image animation> on end image to loop.
Send commands or set <touch control> button to interrupt animation.

Beijing DWIN Technology Co., Ltd. 22 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.6 Icon Rotation


Selected Area: (X, Y) are the coordinates of rotating center.
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 ID: icon address in icon file.
ICON Rotation Center:
Select rotation center (X, Y) for the icon.
Initial/End VAR Value:
Value corresponding to start/end angle, null if over limit.
Initial/End Rotation Angle:
Select start/end angle, ranging from 0 to 720, by every 0.5°.
Display Mode: transparent/background.
VP_Mode:
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.

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:

Send command to serial port:


Frame header, Length, Command, VP, Data string to display the ICON above.
A5 5A 05 82 000A 0084

Beijing DWIN Technology Co., Ltd. 23 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.7 Data Variable


Selected Area: (X, Y) are the top-left coordinates of data.
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.
Font Color: data color.
Font Lib_ID: address of ASCII font file.
Font Size: horizontal pixel numbers.
Alignment Mode: Right/Left /Centered.
VAR Type:
0x00: integer.
0x01: long integer.
0x02: high byte in VP address.
0x03: low byte in VP address.
Number of INT Bit: length of integer digits.
Number of DEC Bit: length of decimal digits.
Unit Length:
Corresponding to displayed unit automatically.
Unit Displayed:
ASCII unit for data, max length is 11 bytes.
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 commands or set buttons to modify displayed data.

Illustration of variable <Data Variable>:

Send command to serial port:


Frame header, Length, Command, VP, Data string to display the Data (left-up) above.
A5 5A 05 82 0000 0022

Beijing DWIN Technology Co., Ltd. 24 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.8 Text Display


Selected Area:
(X, Y) are top-left coordinates of data.
Textbox is the selected area.
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.
Text Color: data color.
Encoding Mode:
0x00: 8bit encoding, 0x01: GB2312, 0x02: GBK, 0x03:BIG5,
0x05: UNICODE.
Set Character Interval MANUALLY: on/off.
Text Length: select text length, by byte.
Font0_ID: address of ASCII font file.
Font1_ID: address of non-ASCII font file.
Dot Matrix in X/Y-direction: select font size. Please note that
parameter should be the same with the size of font file.
Horizontal/Vertical Separation:
Pixel distance in Horizontal/Vertical.
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.

Illustration of variable <Text Display>:

Send command to serial port:


Frame header, Length, Command, VP, Data string to display the Text (bottom-left) above.
A5 5A 0D 82 0008 64 77 69 6E 20 64 67 75 73 76

Beijing DWIN Technology Co., Ltd. 25 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.9 Digital RTC Display


Selected Area: (X, Y) are the top-left coordinates of data.
Preview: preview VAR display effect.
Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
Font Color: data color.
Font Lib_ID: address of ASCII font file.
Font Size: horizontal pixel numbers.
Date Format: refer to the red texts in picture in the left.

Use <RTC> button to modify current time.

Illustration of variable <Digital RTC Display> (Digital clock on bottom-right of screen):

Beijing DWIN Technology Co., Ltd. 26 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.10 Analog Clock Display


Selected Area: (X, Y) are the rotating center coordinates.
Preview: preview VAR display effect.
Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
ICON File: address of icon file.
Analog Clock:
ICON Hour: select hour hand ID in icon file.
Center Coordinate: rotation center in icon.
Minute Hand:
ICON Minute: select minute hand ID in icon file.
Center Coordinate: rotation center in icon.
Second Hand:
ICON Second: select second hand ID in icon file.
Center Coordinate: rotation center in icon.

Use <RTC> button to modify current time.

Illustration of variable <Analog Clock Display>:

Beijing DWIN Technology Co., Ltd. 27 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.11 Dynamic Trend Curve


Selected Area: select window area, null if over range.
Preview: preview VAR display effect.
Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
Y_Central: select center line of trend curve.
VD_Central:
Trend curve value at center line, normally average of Max
& Min value.
Curve Color: select color for trend curve.
MUL_Y: magnification in Y direction, by every 1/256.
Data Source Channel: select channel for trend curve.
Horizontal Spacing:
Transverse spacing between sampling points.

Illustration of variable <Dynamic Trend Curve Display>:

Send command to serial port:


Frame header, Length, Command, Data channel, Data string to display the trend curve above.
A5 5A 18 84 01 0800 0700 0710 0733 0800 0800 0800
0800 0900 0908 0906

Beijing DWIN Technology Co., Ltd. 28 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.12 Table Display


Selected Area: select table area, null if over range.
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, starting address of the data in table.
Column/Row Number: set the size of table.
Start Display Column/Row:
Select starting column/row to be displayed.
Unit_Data_Num:
0x01-0x7F: length of data for one cell.
0x00: data in VP address defines the length of each column.
When Unit_Data_Num is 00, starting address of data will be
(Row number/2, round up to integer) backward from VP
address.
Encoding Mode:
0x00: 8bit, 0x01: GB2312, 02: GBK, 03: BIG5, 04: SJIS, 05:
UNICODE.
Set Character Interval MANUALLY: on/off.
Boarder Color: select table boarder color.
Text Color: select text color.
FONT0_ID: address of ASCII font file.
FONT1_ID: address of none-ASCII font file.
X/Y-Direction Size:
Select font size, accordant with width of fonts in font file.
Column Header: Valid Display/Invalid Display.
Row Header: Valid Display/Invalid Display.

Data for table can be loaded by 22.bin file. Refer to DGUS


document for detailed instruction.

Beijing DWIN Technology Co., Ltd. 29 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

Illustration of variable <Table Display>:

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.

Beijing DWIN Technology Co., Ltd. 30 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.13 Basic Graphic Display


Selected Area: select window area, null if over range.
(Limit is only effective for 0x0001 - 0x0005 commands).
Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
VP: variable pointer.

String Format
Address Definition Description
VP CMD Command
VP+1 Data_Pack_Num_Max Data Pack Number
VP+2 DATA_Pack

Data Pack for Basic Graphic


Description of Data Pack Format, by word
CMD Function Relative
Length Definition Description
Address
0x00 2 (x, y) Dot coordinates.
0x0001 Dot
0x02 1 Color Dot color.
0x00 1 Color Line color.
0x01 2 (x, y)0 Vertex 0 coordinates.
0x0002 Line
0x03 2 (x, y)1 Vertex 1 coordinates.
0x01+2*n 2 (x, y)n Vertex n coordinates.
0x00 2 (x, y)s Top-left coordinates.
0x0003 Rectangle 0x02 2 (x, y)e Bottom-right coordinates.
0x04 1 Color Rectangle’s color.
0x00 2 (x, y)s Top-left coordinates.
Rectangle
0x0004 0x02 2 (x, y)e Bottom-right coordinates.
Area Fill
0x04 1 Color Filled color.
0x00 2 (x, y) Circle center coordinates.
0x0005 Circle 0x02 1 Rad Radius of circle.
0x03 1 Color Circle color.
0x00 1 Pic_ID Image ID of cutting area.
0x01 2 (x, y)s Top-left coordinates of the cutting area.
Picture
0x0006 Bottom-right coordinates of the cutting
cut/paste 0x03 2 (x, y)e
area.
0x05 2 (x, y) Paste position on current screen.
0x00 2 (x, y) Top-left coordinates of icon.
Icon Icon ID in icon file, high byte of command
0x**07
Display 0x02 1 ICON_ID specifies address of icon file, display
mode is transparent.
0x00 2 (x, y) Sampling dot coordinates.
0x0008 Area fill
0x02 1 COLOR Filled color.
0x00 1 Color0
0x01 1 X0
0x0009 Vertical line Connect (X0, Y0s) (X0, Y0e) with color 0
0x02 1 Y0s
0x03 1 Y0e
Judging condition:

Beijing DWIN Technology Co., Ltd. 31 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

0xFF: finish operation,


0xFE: skip to next step.

Send command to serial port:


Frame header, Length, Command, Address, Controlling bytes, Data pack, Coordinate, Color
A5 5A 11 82 20 00 00 03 00 01 00 64 00 64 02 8C 01 90 F8 00
To get the rectangle above.

Beijing DWIN Technology Co., Ltd. 32 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.14 Special Industrial Application


Name: name this button for viewing it in .xls file.
SP: stack pointer, default setting is 0xFFFF.
VP: variable pointer.

String Format
Address Definition Description
VP CMD Command
VP+1 Data_Pack_Num_Max Data Pack Number
VP+2 DATA_Pack

Data pack for Special Industrial Application


Description of data pack format, by word
CMD Function
Relative
Length Definition Description
Address
0x00 1 Color0 Color of “Safe Zone”.
Color of normally overlapped area
0x01 1 Color1
(Overlapped once).
Color of High-Risk overlapped area
0x02 1 Color2
(Overlapped twice or more).
0x03 1 Color3 Color of circles.
Overlapped
Area of
0x0001 0x04 1 Color4 Color of evasion.
Multiple
Circles Fill
0x05 4 Disp_Area Display area, null if over range.

0x09+4*n 2 (x, y)n Center coordinates of No. n.


The bigger radius of No. n concentric
0x0B+4*n 1 RADn_1
circles.
The smaller radius of No. n concentric
0x0C+4*n 1 RAD2n_2
circles.

Beijing DWIN Technology Co., Ltd. 33 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.15 Bit Variable Icon


Selected Area: (X, Y) are coordinates of top-left 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.
AP: substitutive variable pointer, reserved 2 words.
Bit Icon ON (1) /OFF (0): define BITs to display.
Disp. Mode: shown as the following table.
Align Mode:
0x00: X++, space unreserved for undesignated bits.
0x01: Y++, space unreserved for undesignated bits.
0x02: X++, space reserved for undesignated bits.
0x03: Y++, space reserved for undesignated bits.
Interval: spacing between icons.
Icon File ID: address of icon file.
ICON0S:
Icon ID for bit0 in non-animation mode, or starting
Icon ID for bit0 in animation mode.
ICON0E: ending icon ID for bit0 in animation mode.
ICON1S:
Icon ID for bit1 in non-animation mode, or starting
Icon ID for bit1 in animation mode.
ICON1E: ending icon ID for bit1 in animation mode.
ICON Mode: Transparent/Opaque.
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.

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.

Beijing DWIN Technology Co., Ltd. 34 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

Illustration of variable <Bit Icon> (on bottom of screen):

Beijing DWIN Technology Co., Ltd. 35 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

2.2.16 Timer Variable


Selected Area: (X, Y) are the top-left coordinates of data.
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.
Color: data color.
Font Lib ID: address of font file, 8bit encoding half-width.
Font Size: font size in X-direction.
Data length (Bytes): byte numbers to be displayed.
ASCII Separators: data string.
Convert: convert ASCII Separators into Hex Separators.

Encoded separators string, used to define the format of Timer.


Every time a Timer data (BCD code) is read, one ASCII char
will be added after as separator.
Some special chars: 0x00: none, Timer data will be
concatenated; 0x0D: new line.

Illustration of variable <Bit Icon> (on top-right of screen):

Beijing DWIN Technology Co., Ltd. 36 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.2 Command Set


Function CMD Data Description
0x80 ADR(0x00-0xFF)+Data_Pack Write data in particular address of register
Access ADR(0x00-0xFF)+
Read data in particular address of register
Register RD_LEN(0x00-0xFF)
0x81
ADR(0x00-0xFF)+RD_LEN+
Response of DWIN LCD module
Data_Pack
ADR_H:(0x0000-0x6FFF)+DATA0… Write data in particular address of
0x82
+DATAn variable SRAM
Access
ADR_H: L(0x0000-0x6FFF)+ Read data in particular address of
Variable
RD_LEN(0x00-0x7F) variable SRAM
SRAM 0x83
ADR_H: L+RD_LEN+DATA0……+
Response of DWIN LCD module
DATAn
Write trend curve buffer.
CH_Mode defines the channels of data :
 Each bit in CH_Mode corresponds
to one channel.
Trend
CH_Mode(Byte)+DATA0(Word)+…+  CH_Mode. 0 corresponds to
Curve 0x84
DATAn channel 0.
Buffer
 Low channel ranges ahead.
 E.g.:
CH Mode=0x83(10000011B),
 data format like "CH7+CH1+CH0"
Register is accessed by every byte, variable SRAM and trend curve buffer is accessed by every
word.

Beijing DWIN Technology Co., Ltd. 37 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

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.

0x02 BZ_TIME 1 Buzzer beeping time, by every 10ms.


Read: read current picture ID.
0x03 PIC_ID 2
Write: switch to specific picture ID.
0x5A: there is update of touching area.
Others= no updating.
0x05 TP_Flag 1
TouchPanel data is no longer updated if user did not clear the flag after
data retrieving.
0x01: first click.
0x03: pressing down.
0x06 TP_Status 1
0x02: uplift pressing.
Others: null.
0x07 TP_Position 4 Coordinate of touching position: X_H:L, Y_H:L.
0x00: disable the touchPanel.
0x0B TPC_Enable 1 Others: enable the touchPanel.
Default setting: 0xFF.
0x0C-0x0F Reserve 4 Undefined.
0x10-0x1A R0-RA 11 Mapping of SD card config. register, read only.
0x5A: RTC data is rewritten through serial port, cleared after RTC auto
0x1F RTC_COM_ADJ 1
updating.
0x20 RTC_NOW 16 YY:MM:DD:WW:HH:MM:SS
Send serial command to modify current time, e.g.: A5 5A 0A 80 1F 5A 12 10 25 0412 00 01. “04” means Thursday, it can be
written as any day you choose.
0x30-0x3F Reserve 16 Undefined.
0x40 En_Lib_OP 1 0x5A: applying writing in font flash memory, clear after operation.
0x50: Transfer data from variable SRAM to font flash memory.
0x41 Lib_OP_Mode 1
0xA0: Transfer data from font flash memory to variable SRAM.
Designate font address for data exchange. Total space are 16MB, font
0x42 Lib_ID 1
space: 0x40-0x7F, maximum space of every font is 128KW.
Designate address in font library for data exchange. Specified the first
0x43 Lib_Address 3
(word) address for data operation in font storage, 0x00:00:00-0x01:FF:FF.
Designate variable SRAM addresses for data exchange. Specified the first
0x46 VP 2
(word) address for data operation in font storage, 0x00:00-0x6F:FF.
0x48 OP_Length 2 Length of exchanged data, by word.
Save 1KW variable data string starting from 0x1000 address into #64 font ID with starting 0x0000 address, send serial
command: A5 5A 0C 80 40 5A 50 40 00 00 00 10 00 02 00.
16-bit software timer, in term of 4ms, auto-decrement to
0x4A Timer0 2
0.
0x4C Timer1 1 8-bit software timer, in term of 4ms, auto-decrement to 0. Maximum
error is
0x4D Timer2 1 8-bit software timer, in term of 4ms, auto-decrement to 0. +/_4ms.

0x4E Timer3 1 8-bit software timer, in term of 4ms, auto-decrement to 0.


Address of key code for 13 touch control config. file, 0x00: null.
0x4F Key_code 1
Clear after operation executed.
0x50-0xFF Reserve 182 Undefined.
Register is accessed by command 0x80/0x81.

Beijing DWIN Technology Co., Ltd. 38 www.dwin.com.cn


Professional, Creditable, Successful DGUS_SDK User Guide V4.9.0

 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.

Beijing DWIN Technology Co., Ltd. 39 www.dwin.com.cn

You might also like