Dgusv5 10
Dgusv5 10
Dgusv5 10
Contents
1. DGUS_SDK Instruction........................................................................................................................................................ 4
1.1 Operation of DGUS_SDK.......................................................................................................................................... 4
1.2 Main Interface of DGUS_SDK_V5.1........................................................................................................................5
2. Basic Steps for DGUS_SDK Operation.............................................................................................................................7
2.1 Create a new project.................................................................................................................................................. 7
2.1.1 Start a new project...........................................................................................................................................7
2.1.2 Select corresponding resolution and save the path.................................................................................. 8
2.1.3 Add images....................................................................................................................................................... 8
2.1.4 Create a CONFIG.TXT file for setting system parameters.......................................................................9
2.2 Configure touch functions........................................................................................................................................ 11
2.3 Configure variable display....................................................................................................................................... 12
2.4 Create configuration files.........................................................................................................................................13
2.5 Download....................................................................................................................................................................14
3. Main Functions of DGUS_SDK.........................................................................................................................................15
3.1 Touch Config..............................................................................................................................................................16
3.1.1 Popup Window...............................................................................................................................................16
3.1.2 Variable Data Input....................................................................................................................................... 17
3.1.3 Incremental Adjustment................................................................................................................................18
3.1.4 Slider Adjustment...........................................................................................................................................19
3.1.5 RTC..................................................................................................................................................................20
3.1.6 Basic Touch Control...................................................................................................................................... 21
3.1.7 Return Key Code........................................................................................................................................... 22
3.1.8 ASCII Input......................................................................................................................................................23
3.1.9 Firmware Parameter Settings......................................................................................................................24
3.1.10 Status sync-returned...................................................................................................................................26
3.2 Variable Config..........................................................................................................................................................28
3.2.1 Variable Icon...................................................................................................................................................28
3.2.2 Animation Icon................................................................................................................................................29
3.2.3 Slider................................................................................................................................................................30
3.2.4 WordArt........................................................................................................................................................... 31
3.2.5 Image Animation............................................................................................................................................ 32
3.2.6 Icon Rotation.................................................................................................................................................. 33
3.2.7 Data Variable..................................................................................................................................................34
3.2.8 Text Display.................................................................................................................................................... 35
3.2.9 Digital RTC Display....................................................................................................................................... 36
3.2.10 Analog Clock Display..................................................................................................................................37
3.2.11 Dynamic Trend Curve................................................................................................................................. 38
3.2.12 Table Display................................................................................................................................................39
3.2.13 Basic Graphic Display................................................................................................................................ 40
3.2.14 Special Industrial Application.................................................................................................................... 42
3.2.15 Bit Variable Icon...........................................................................................................................................43
3.2.16 Timer Variable..............................................................................................................................................45
3.2.17 RollText......................................................................................................................................................... 46
4. Commands........................................................................................................................................................................... 47
4.1 Data Frame................................................................................................................................................................ 47
Beijing DWIN Technology Co., Ltd. 2 www.dwin.com.cn
Professional, Creditable, Successful DGUS_SDK User Guide V5.1
4.2 Command Set............................................................................................................................................................47
4.3 Register...................................................................................................................................................................... 47
4.4 VP & SP......................................................................................................................................................................49
4.4.1 VP (Variable Pointer).................................................................................................................................... 49
4.4.2 SP (Stack Pointer).........................................................................................................................................51
4.5 Examples....................................................................................................................................................................53
4.5.1 Access Register of DGUS............................................................................................................................54
4.5.1.1 Write Data into Register..................................................................................................................54
4.5.1.2 Read Data from Register................................................................................................................ 54
4.5.1.3 Response from the DGUS module............................................................................................... 54
4.5.2 Access Variable SRAM.................................................................................................................................55
4.5.2.1 Write Data into variable SRAM...................................................................................................... 55
4.5.2.2 Read Data from variable SRAM.................................................................................................... 55
4.5.2.3 Response from the DGUS module............................................................................................... 55
4.5.3 Dynamic Trend Curve Display.....................................................................................................................55
4.5.4 Basic Graphic Display...................................................................................................................................56
1. DGUS_SDK Instruction
or
B. Drag the button/variable with mouse.
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.
Variables Preview Preview buttons & variables
Resolution Modify resolution of project.
Generating Modify system configuration and save the settings in config.txt. Refer to illustration
Configuration file below.
Import Config. Import existing config. files to the current project.
Export Variables Generate <TouchConfig.xls> and <DisplayConfig.xls> for quick view of buttons &
variables.
System Properties Modify system properties and save the settings in config.txt. Refer to illustration
below
DGUS Configuration File Download <13Touch_Control_Config.bin>, <14Variable_Config.bin>, and the image;
Download debug commands via serial port.
Help Help documents.
Align Left Align the selected buttons and variables to left.
Tool Bar:
Switching between "Touch Config" & "Variable Config" & Edit Tools using Navigation bar, or shortcut key F2, F3,F4.
Images indicating here are what to be displayed as background with “.bmp” format required.
Image naming rules: ID + Name. bmp (name as optional)
For example, “0_Data Input.bmp” or “0.bmp”
For the value and functions of each parameters, please refer to the chapter 1.2 of the DGUS Dev. Guide_V5.1—CONFIG. TXT
If the frame header is set as R3=5A RA=A5, please use the software “Serial debugging assistant sscom32 " sending command
below for verifying all images works fine.
5A A5 04 80 03 00 01( 00 01 signify images switching to No1.)
Later, check if images No1 switched successfully. (format must be .bmp naming started from”00”).
There are config.txt failed or com port out of work in the event of images switch failure. Please affirm parameter for config.txt
again including frame header, baud rate etc.
Copy the DWIN_SET folder into the SD card root directory ------> Powered on DGUS LCM------> Insert SD card into the slot of
LCM, the configuration files will be downloaded automatically.
Note: During downloading, don’t turn off the LCM, the screen will blink to blue then back to the first image after completion
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_V51. 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_V51.
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.
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.
Hold the button over 0.5 second and slide the slider to modify number in the right, the value will also be changed.
3.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.
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: Set same VP address for <Slider> button and <Slider display> variable to combine them.
<Slider display> is also used as progress bar.
3.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.
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
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:
0xFF: finish operation,
0xFE: skip to next step.
String Format
Address Definition Description
VP CMD Command
VP+1 Data_Pack_Num_Max Data Pack Number
VP+2 DATA_Pack
4. Commands
4.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.
The communication between DGUS LCMs and host is oriented by variables that you may read or write in corresponding
address. Reading &Writing of initial address and variable length could be changed via Command 0x82&0X83 if known in advance.
VP of variable 1
Length of variable 1
0x1001
2 words
VP 00
Length
64
Supposing that reading & writing to the same one, touch and input parameters of VP should be the same accordingly.
SP shares the same SRAM with VP from 0x0000 to 0x6FFF. It is only used for variable display but overlap exception.
SP
0x5000 VP
X, Y
Color
Lib_ID
Font_X_Dots
Aligment Mode
。
。
。
SP=0x5000
Frame header (2 Bytes)+Data length (1 Byte)+Command (1 Byte)+Data (N Byte: ADR+data/LEN)+CRC (2 Bytes, optional)
Send:5A A5 05 82 50 03 F8 00
Description: 5003: the address of color
F800: the value of red color
4.5 Examples
Configure frame header and baud rate in CONFIG.TXT via DGUS SDK as below:
R1=07
R3=5A
RA=A5
Send: 5A A5 04 80 03 00 03
Description: 03: Register for Picture ID
00 03: Appoint picture ID
Send: 5A A5 03 81 00 01
Description: 00: Register for DGUS Version
01: Read data by a byte
Send: 5A A5 05 82 00 10 00 64
Description: 0010: Variable pointer
0064:Data 100 in hexadecimal format
Display the trend curve in the same area Display the trend curve in the different area simultaneously
1) Add a basic graphic display via DGUS SDK software and set vp to 0x00A0 as below:
Send: 5A A5 11 82 00 A0 00 05 00 01 01 64 00 EF 00 64 F8 00 FF 00
Hex Description
5A A5 Frame header
11 Data length
82 Command
00 A0 VP
00 05 Circle command
00 01 One circle
00 64 Radius of circle:100
F8 00 Color: red
FF 00 Drawing operation finished