0% found this document useful (0 votes)
128 views12 pages

DWIN T5L ModBus

Uploaded by

visakh.p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views12 pages

DWIN T5L ModBus

Uploaded by

visakh.p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

T5L screen ModBus communication

1:The ModBus protocol is executed on the serial port 4 of the T5L screen.

2:The ModBus of T5L screen can be configured as master or slave.

3:The protocol is compatible with Ascii and RTU formats (ascii is not supported yet).

4:The command format is divided into standard format and clock format.

5:When configured as a host, the command has the function of automatic reissue.

6:There are 5 ways to trigger sending when configured as a host.

7:The maximum read and write data length is 64 words (128 bytes).

8:The maximum number of instructions is 255.

9:Support command 0X01,0X02,0X03,0X04,0X05,0X06,0X10.

10: When the host is powered on, it will automatically send the data configured in the 0x10
command (initialize the slave).

11:The 70-word variable address starting from the last instruction of the configured file No.
22 is occupied.

12:Timer T1 is occupied.

13:The seventh page of the register is occupied.

Definition of system variable interface for ModBus communication of DWIN screen


The system variable interface definition occupies 16 bytes starting from 0x0088.

0x0088H: 0x5A = Start a configuration.

0x0088L: 0xA5= enabled (enabled by default) Modbus, Other = Not enabled

0x0089: Edit the start (word) address of the instruction in file No. 22 (default 0xE000).

0x008AH: Edit the number of instructions in file No. 22, each with 8 characters (255 by
default).

0x008AL: 0x00=Configure as host, RTU data format (default 0X00).

0x01=configure as host, ascii data format.

0x02=Configure as a master (RTU), and the response data of the slave includes a
clock.

0x03=Configure as a master (ascii), and the response data of the slave includes a
clock.

0x04=Configure as slave, RTU data format.

0x05=Configure as slave, ascii data format.

0x008BH: When the slave does not respond or responds incorrectly, the number of
reissues of this command (default 5 times).
0x008BL: The delay time from the execution of this instruction to the sending of the
next instruction (default 100ms).

0x008CH: ID when configured as a slave (default 01).

0x008CL: Verify configuration (default 40=serial port 4, 8N1).

0x008D: Baud rate configuration (default 2688, 25804800/9600=2688=0x0A80).

0x008EH: Fault code of the communication process.

0x008EL: When configured as a host, the serial number of the currently executed
command in file No. 22

0x008F: spare

System variable interface configuration example

5A,A5,E000,FF, 00,05,64,01,40,0A80, 00, 00, 00, 00.

0x0088H=0x5A: 0x5A=Enable Modbus configuration, cleared after configuration.

0x0088L=0xA5: 0XA5=Enable Modbus communication

0x0089=0xE000: In file No. 22, the starting (word) address of the first instruction =
0xE000

0x008AH=0xFF: Edited 255 instructions (1-255) in document 22.

0x008AL=0x00: 0X00= configure as host, RTU data format (0-5).

0x008BH=0x05: If the slave does not respond or the response is received incorrectly,
the master reissues the current command, and the upper limit of
reissue is 5 times (0-255).

0x008BL=0x64: Delay time between commands=0x64=100mS(0-255).

0x008CH=0x01: The communication ID assigned when configured as a slave = 0x01


(0x01-0x7F).

0x008CL=0x40: 0x00=8N1,0x01= 8E1, 0X02=8O1,0X03=8N2.

0x008D=0x0A80: 25804800/(0A80)2688=9600 baud rate (T5L).

0x008EH=0x00: Error code during communication (read only).

0x008EL=0x00: When configured as a master, the serial number of the currently


executed command in file No. 22 will be updated only after the slave responds correctly
(read-only).

0x008F: spare .

Example of edit configuration format for directives in document 22

Example: 5A 01 03 06 02 01 00 02 10 00 00 01
D0: 0x5A=execute this instruction, others=do not execute this instruction.

D1: The ID number of the slave to be operated (01H).

D2: Command (03H) (0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x10).

D3: The length of the operation data of this instruction (06H) (03H, 04H, 06H, 10H are
counted by word).

D4: Receive timeout (2mS). (2~255)

D5: The way to trigger the instruction to execute and send (0-4)

0x00= Execute unconditionally.

0x01= Execute under the page specified by D6.D7.

0x02= Execute when the key value specified by D6.D7 is not zero, and the key
value will be cleared after the command is executed.

0X03= In the 0x06 command, when the value of the variable pointed to by D8.D9
is non-zero, it is automatically sent.

After the communication is completed, clear the value of the


specified variable in D8.D9

0x04= In 0x05,0x06;0x10 command, it will be sent automatically when the


specified variable of D8.D9 changes.

D6.D7: When D5=0, no configuration is required.

When D5=1, the configuration is page number (0002).

When D5=2, it is configured as the key address for trigger sending.

When D5=3, no configuration is required.

When D5=4, no configuration is required.

D8.D9: This instruction operates on the source variable address or starting address
(1000H) allocated in the DGUS screen.

D10.D11: The slave address point table (0001H) operated by this instruction.

D12.D13.D14.D15: undefined.

This instruction is for the screen as the master to read the data of 6 consecutive words in
the point table starting from 0x0001 of the slave (id=0x01) to the address 0x1000_0x1005
of the screen for display.

T5L screen bit definition Area 1 (256bit display area)

0x0100

01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 000
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
0x0101

03 03 02 02 02 02 02 02 02 02 02 02 01 01 01 016
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7
0x0102

04 04 04 04 04 04 04 04 03 03 03 03 03 03 03 032
7 6 5 4 3 2 1 0 9 8 7 6 5 4 3
0x0103

06 06 06 06 05 05 05 05 05 05 05 05 05 05 04 048
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9
0x0104

07 07 07 07 07 07 07 07 07 07 06 06 06 06 06 064
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0x0105

09 09 09 09 09 09 08 08 08 08 08 08 08 08 08 080
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
0x0106

11 11 10 10 10 10 10 10 10 10 10 10 09 09 09 096
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7
0x0107

12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11
7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
0x0108

14 14 14 14 13 13 13 13 13 13 13 13 13 13 12 128
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9
0x0109

15 15 15 15 15 15 15 15 15 15 14 14 14 14 14 144
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0x010A

17 17 17 17 17 17 16 16 16 16 16 16 16 16 16 160
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
0x010B

19 19 18 18 18 18 18 18 18 18 18 18 17 17 17 176
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7
0x010C

20 20 20 20 20 20 20 20 19 19 19 19 19 19 19 19
7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
0x010D

22 22 22 22 21 21 21 21 21 21 21 21 21 21 20 208
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9
0x010E

23 23 23 23 23 23 23 23 23 23 22 22 22 22 22 224
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0x010F

25 25 25 25 25 25 24 24 24 24 24 24 24 24 24 240
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
Usually cooperate with DWIN screen display control and bit variable icon control.

T5L screen bit definition Zone 2 (256bit keypad)

0x0110

01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 000
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
0x0111

03 03 02 02 02 02 02 02 02 02 02 02 01 01 01 016
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7
0x0112

04 04 04 04 04 04 04 04 03 03 03 03 03 03 03 032
7 6 5 4 3 2 1 0 9 8 7 6 5 4 3
0x0113

06 06 06 06 05 05 05 05 05 05 05 05 05 05 04 048
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9
0x0114

07 07 07 07 07 07 07 07 07 07 06 06 06 06 06 064
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0x0115

09 09 09 09 09 09 08 08 08 08 08 08 08 08 08 080
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
0x0116

11 11 10 10 10 10 10 10 10 10 10 10 09 09 09 096
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7
0x0117

12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11
7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
0x0118

14 14 14 14 13 13 13 13 13 13 13 13 13 13 12 128
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9
0x0119

15 15 15 15 15 15 15 15 15 15 14 14 14 14 14 144
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0x011A

17 17 17 17 17 17 16 16 16 16 16 16 16 16 16 160
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
0x011B

19 19 18 18 18 18 18 18 18 18 18 18 17 17 17 176
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7
0x011C

20 20 20 20 20 20 20 20 19 19 19 19 19 19 19 19
7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
0x011D

22 22 22 22 21 21 21 21 21 21 21 21 21 21 20 208
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9
0x011E

23 23 23 23 23 23 23 23 23 23 22 22 22 22 22 224
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0x011F

25 25 25 25 25 25 24 24 24 24 24 24 24 24 24 240
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1

Example: The 50# button address configuration of DWIN screen is sent, query the 03bit
of the corresponding variable address 0x0113 through the above table, and cooperate with
the touch control incremental adjustment setting of DWIN screen as shown in the figure
below.

Command description:

1:06H, 10H are standard command formats.


2:03H, 04H command with or without clock, and without clock is the standard format.

3:03H, 04H with a clock will add a 6-byte clock before the check code after the returned
data.

4:The format of the clock attached to 03H and 04H is year, month, day, hour, minute,
second (hex).

5:The read length of 01H and 02H commands is fixed at 16bit.

6:The corresponding relationship between bit variable addresses and variables in 01H,
02H, 05H instructions can be queried according to the above table.

7:Modification of default configuration

Open DWINOS_DWIN_T5L_ModBusV2.bin with UltraEdit-32

Find the first line of data (starting with a non-zero segment) and download after
modifying the mark position.

Note: E000 means to edit the first entry from E000H (word address) 1C000 (byte
address) of No. 22 file

FF00 FF means maximum 255 pieces 0x00=Configure as host, RTU data format

0564 The upper limit of reissuing the current command is 5 times, 64=the delay time
between commands is 100ms.

0140 01 ID 40 when configured as a slave, high 4bit=4 low 4bit=0, enable serial port
4, 8N1.

0A80H=2688 25804800/2688=9600 baud rate.

Mitsubishi PLC as a slave modbus communication example

Add the following ladder line to the PLC to enable MODBUS


Read D100 of plc to 0x1000 display on the screen (0x03 command)

EDIT 22.BIN FILE:

Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X03= Read with command 03。

0x01= read a word of data。

0x30= Communication timeout 48ms

0X01= Instruction trigger mode (current page execution)

0x0000= Execute on page 0


0x1000= show address

0x0064= The address assigned by D100 in the point table(100)

 Read D10-D73 of PLC to 0x1002-1041 display on the screen (0x04


instruction)

EDIT 22.BIN FILE:

Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X04= Read with 04 command.

0x40= Read 64 words of data.

0xA0= The communication timeout is 160ms.

0X01= Instruction trigger mode (current page execution).

0x0001= Execute on 1 page.

0x1002= Show address.

0x000A= The address assigned by D10 in the point table (10).

 Write the 0x1042 address data of the screen into the D1 of the plc (0x06 instruction)

 EDIT 22.BIN FILE:

NOTE: 0x5A= This instruction executes。

0X01= PLC ID。

0X06= Write with 06 command。

0x01=06 instruction is limited to one word data。

0x30= Communication timeout 48ms。

0X04= command trigger mode(If the data of 0x1042 is changed, it will be sent
automatically. This mode has a reissue function to ensure successful sending, and there is
no need to read the write result of the slave.)。

0x0000= no configuration required。

0x1042= Send the address assigned by the data source in the screen。

0x0001= Address assigned by D1 in point table (1)。

Write the 0x1044-0X1046 address data of the screen into the D2-D4 of the plc (0x10
instruction 04 trigger mode)

Edit 22.bin file:

Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X10= Write with 10 instructions。


0x03= Write 3 word data。

0x30= Communication timeout 48ms。

0X04= Instruction trigger mode (the data of 0x1044-0x1046 is changed and


automatically sent, this mode has a reissue function to
ensure successful sending, no need to read the write result
of the slave)。

0x0000= no configuration required。

0x1044= Send the address assigned by the data source in the screen。

0x0002= Address assigned by D2 in point table (2-4)。

Write the 0x1047-0X1049 address data of the screen into the D5-D7 of the plc (0x10
instruction 02 trigger mode)

Edit 22.bin file:

Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X10= Write with 10 instructions。

0x03= Write 3 word data。

0x30= Communication timeout 48ms。

0X02= Instruction trigger mode (automatically send when 0x1050 is non-zero,


this mode has a reissue function to ensure successful sending,

No need to read the write result of the slave)。

0x1050= The address of the button that triggers the sending。

0x1047= Send the address assigned by the data source in the screen。

0x0005= The address assigned by D5 in the point table (5-7)。

Read the Y1 of the PLC to the 0-bit display in the bit display area on the screen (0x01
command)

Note:The screen does not have a bit address, in order to address bit variables, a 256bit
display area is defined starting from 0X0100

Since it is not a real bit variable, there are certain restrictions when using 0X01 and
0X02 instructions. 0x01, 0x02 instructions fixedly read 16bit (one word) data. When setting
the address of the slave machine, round up to 16. For example, when reading Y1 in this
example, the address of Y1 is found to be 301, and the actual address of the slave machine
should be 300. When reading Y0-Y17, fill in 300, which is actually 300. To 315, 16bit will all
be read. The display area address is also rounded up by 16. For example, if it is displayed
at 0 in this example, then bit0 - Y0 BIT1-Y1 of 0x0100 ......... BIT15-Y17. If it is displayed at
16 bits, then bit0 of 0x0101 - Y0 BIT1-Y1.........BIT15-Y17. The display area should be
displayed with bit icons.

EDIT 22.BIN FILE:


Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X01= Read with 01 command。

0x01= read a word of data。

0x30= Communication timeout 48ms

0X01= Instruction trigger mode (current page execution)

0x0005= Execute on page 5

0x0000= display bit address(0x0100.15-0x0100.0)

0x012C= The start bit address assigned by Y1 in the point table(300)

Read the M5 of PLC to the 32-bit display in the bit display area on the screen (command
0x02)

EDIT 22.BIN FILE:

Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X02= Read with 02 command。

0x01= read a word of data。

0x30= Communication timeout 48ms

0X01= Instruction trigger mode (current page execution)

0x0005= Execute on page 5

0x0020= Display bit address (0x0102.15-0x0102.0)

0x0FA0= The starting address of M2 allocated in the point table (4000)

Write the fifth digit of the keypad on the screen into Y2 of the PLC (command 0x05)

Edit 22.bin file:

Note: 0x5A= This instruction executes。

0X01= PLC ID。

0X05= Write with 05 command。

0x01= a bit of data。

0x30= Communication timeout 48ms

0X04= Instruction trigger mode (the address of bit 5 is changed and sent)

0x0000= no configuration required


0x0005= Button bit address (0x0110.5)

0x012E= The start bit address (302) of Y2 allocated in the point table.

You might also like