Modbus DIO User Manual

Modbus DIO User Manual

Share on Social Networks

Share Link

Use permanent link to share in social media

Share with a friend

Please login to send this document by email!

Embed in your website

Select page to start with

46. Modbus DIO Note: It is recommanded that soft INIT timeout value is reset to 0 onc e any changes to the Baud Rate and checksum setting have been completed. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 46 of 47

22. Modbus DIO Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 22 of 47

47. Modbus DIO 4. Hardware information and DCON Protocol The “7000 DIO manual” can be downloaded from http://w ww.icpdas.com/downl oad/7000/manua l/7000dio.pdf Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 47 of 47

7. Modbus DIO M-7051/M-7051D: 0x0020~0x002F for DI val u e 0x0040~0x004F for DI Latch high val u e Valid starting channel 0x0060~0x006F for DI Latch low val u e Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 7 of 47

43. Modbus DIO Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Note: The ~AATnn command shoul d be sent prior to Using this command, s ee Section 2.6 of the “7000 DIO Manual” for details. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 43 of 47

35. Modbus DIO Examples: Command: $01P Response: !0110 Reads the communication protocol of module 01 and returns a response of 10 m eaning that it supports both the DCON and Modbus RTU protocols and the protocol that will be used at the next power-on reset is DCON. Related Commands: Section 3.2 $AA P N Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 35 of 47

39. Modbus DIO Examples: Command: ~01D Response: !0100 Reads the communication protocol of module 01 and returns a response of 00. Pleas e refer to Table 2 on page 23 for mor e details regar ding DI/O active status values. Related Commands: Section 3.2 ~AADVV Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 39 of 47

1. Modbus DIO Modbus DIO User’s Manual Warranty All products manufactured by ICP DAS are under warranty regarding defective materials for a period of one year from the date of delivery to the original purchaser. Warning ICP DAS assumes no liability for damages resulting from the use of this product. ICP DAS reserves the right to change this manual at any time without notification. The information furnished by ICP DAS is believed to be accurate and reliable. However, no responsibility is assumed by ICP DAS for its use, or for any infringements of patents or other rights of third parties resulting from its use. Copyright Copyright 1999 - 2004 ICP DAS. All rights reserved. Trademark The names are used for identification only may be registered trademarks of their respective companies. Date: 2005/7/1 Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 1 of 47

3. Modbus DIO 1. Introduction The I-7000 series is a family of network data acquisition and control modules, providing analog-to-digital, digital-to-analog, digital input/output, timer/counter and other functions. The modules can be remotely controlled using a set of commands, which we call the DCON protocol. Communication between the module and the host is in ASCII format via an RS-485 bi-directional serial bus standard. Baud Rates are software programmable and transmission speeds of up to 115.2K baud can be selected. The functionality of the M-7000 series is the same as the I-7000 series, with the exception that the M-7000 series offers extended support for the Modbus RTU protocol. 1.1 More I n formation Refer to chapter 1 of the “I-7000 Bus Converter User’s Manual” as shown below, or visit the ICP DAS website http://w ww.icpdas.com for more information regarding the I-7000 series. 1.1 The I-7000 Seri es Overvi e w 1.2 Related Documentatio n for the I-7000 Series 1.3 Common Features of the I-7000 Series 1.4 The I-7000 Seri es System Network Configuration 1.5 I-7000 Dimensions Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 3 of 47

41. Modbus DIO Examples: Command: ~01D00 Response: !01 Sets the DI/O active va lue of module 01 as 00 and returns a valid r e sponse. Related Commands: Section 3.3 ~AAD Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Note: After using this command, the DIO active status will immediately change and will clear the DI count and latch values simultaneously. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 41 of 47

37. Modbus DIO Examples: Command: $01P1 Response: ?01 Set s the communication protocol of module 01 to Modbus R T U and returns an invalid response because the module is not in INIT mode. Command: $01P1 Response: !01 Set s the communication protocol of module 01 to Modbus R T U and returns a valid response. Related Commands: Section 3.1 $AA P Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 37 of 47

9. Modbus DIO M-7052/M-7052D: Valid starting channel 0x0000~0x0007 for DI val u e M-7053/M-7053D: Valid starting channel 0x0000~0x000F for DI val u e M-7041/M-7041D: Valid starting channel 0x0000~0x000D for DI val u e M-7051/M-7051D: Valid starting channel 0x0000~0x000F for DI val u e Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 9 of 47

24. Modbus DIO Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported module M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 24 of 47

13. Modbus DIO M-7055/M-7055D: Valid starting channel 0x0000~0x 0007 for DI count val ue M-7052/M-7052D: Valid starting channel 0x0000~0x 0007 for DI count val ue M-7053/M-7053D: Valid starting channel 0x0000~0x000F for DI val u e M-7041/M-7041D: Valid starting channel 0x0000~0x000D for DI val u e M-7051/M-7051D: Valid starting channel 0x0000~0x000F for DI val u e Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 13 of 47

31. Modbus DIO Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus st andard for more det a ils. Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Note: After using the command, the DI O active status will immediately change and will simultaneously clear the DI count and latch values. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 31 of 47

11. Modbus DIO M-7055/M-7055D: Valid starting channel 0x0000~0x 0007 for DI count val ue M-7052/M-7052D: Valid starting channel 0x0000~0x 0007 for DI count val ue M-7053/M-7053D: Valid starting channel 0x0000~0x000F for DI val u e M-7041/M-7041D: Valid starting channel 0x0000~0x000D for DI val u e M-7051/M-7051D: Valid starting channel 0x0000~0x000F for DI val u e Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 1 1 of 47

36. Modbus DIO 3.2 $AAPN Description: Sets the communication protocol. Syntax: $AAPN[CHKSUM](CR) $ Delimiter character AA Address of the module to be read (00 to FF) P Command to read the c o mmunication pr otocol N 0: DCON protocol 1: Modbus RTU protocols Before using this command, the rear slide switch must be in the IN IT positi on. The new protocol is saved in the EEPROM and will be effective after the next power-on reset. Response: Valid Response: !AASC[CHKSUM](CR) Invalid Response: ?AA[CHKSUM](CR) ! Delimiter character for a valid response ? Delimiter character for an invalid response AA Address of the r e sponding module (00 to FF) There will be no r e sponse if the command synt a x is incorrect, there is a communication error , or there is no module with the specified address. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 36 of 47

45. Modbus DIO Examples: Command: ~01I Response: !01 Sets the soft INIT of module 01 and returns a valid response. Command: %0101400700 Response: ?01 Attempts to change the Baud Rate of module 01 to 19200 without fir s t adjusting the INIT * pin. The module returns an invalid response because the soft INIT timeout value is 0. Command: ~01T10 Response: !01 Sets the soft INIT time out value of module 01 to 16 seconds and returns a valid response. Command: ~01I Response: !01 Sets the soft INIT of module 01 and returns a valid response. Command: %0101400700 Response: !01 Attempts to change the Baud Rate of module 01 to 19200 without fir s t adjusting the INIT * pin. The module returns an invalid response because the soft INIT time out value is 0. Related Commands: Section 3.5 of the “7000 DIO Manual” ~A AI, Section 2.1 of the “7000 DIO Manual” %AANNTTCCFF Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 45 of 47

38. Modbus DIO 3.3 ~AAD Description: Reads the DI/O active status. Syntax: ~AAD[CHKSUM](CR) ~ Delimiter character AA Address of the module to be read (00 to FF) D Command to read the D I/O active status Response: Valid Response: !AAFL[CHKSUM](CR) Invalid Response: ?AA[CHKSUM](CR) ! Delimiter character for a valid response ? Delimiter character for an invalid response AA Address of the r e sponding module (00 to FF) VV A two-digit hexadecimal value indicating the DI/O active status. Please refer to T able 2 on pag e 26 for more details about of DI/O active status values. There will be no r e sponse if the command synt a x is incorrect, there is a communication error , or there is no module with the specified address. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 38 of 47

40. Modbus DIO 3.4 ~AADVV Description: Sets the DI/O active status. Syntax: ~AADVV[CHKSUM](CR) ~ Delimiter character AA Address of the module to be read (00 to FF) D Command to set the DI/O active status. VV A two-digit hexadecimal value indicating the DI/O active status. Please refer to Table 2 on page 26 for more details regarding DI/O active status values. Response: Valid Response: !AA[CHKSUM](CR) Invalid Response: ?AA[CHKSUM](CR) ! Delimiter character for a valid response ? Delimiter character for an invalid response AA Address of the r e sponding module (00 to FF) There will be no r e sponse if the command synt a x is incorrect, there is a communication error , or there is no module with the specified address. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 40 of 47

44. Modbus DIO 3.6 ~AA Tnn Description: Sets the soft INIT timeout value. Syntax: ~AATnn[CHKSUM](CR) ~ Delimiter character T Command to set the soft INIT timeout value nn Two hexadecimal digits representing the time out value in seconds. The maximum timeout value is 60 seconds. When changi ng the Baud Rate or checksum settings without adjusting the INIT* pin, the ~AAI and %AANNTTCCFF commands should be sent consecutively and the time interval between the two commands should be less than the soft INIT timeout. If the soft INIT timeout is 0, then the Baud R a te and checksum settings cannot be changed using software only. The pow er-on reset value of the soft INIT timeout is 0. Response: Valid Response: !AA[CHKSUM](CR) Invalid Response: ?AA[CHKSUM](CR) ! Delimiter character for a valid response ? Delimiter character for an invalid response AA Address of the r e sponding module (00 to FF) There will be no r e sponse if the command synt a x is incorrect, there is a communication error , or there is no module with the specified address. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 44 of 47

34. Modbus DIO 3.1 $AAP Description: Reads the communication protocol infor m ation. Syntax: $AAP[CHKSUM](CR) $ Delimiter character AA Address of the module to be read (00 to FF) P Command to read the c o mmunication pr otocol Response: Valid Response: !AASC[CHKSUM](CR) Invalid Response: ?AA[CHKSUM](CR) ! Delimiter character for a valid response ? Delimiter character for an invalid response AA Address of the r e sponding module (00 to FF) S The protocols supported by the module 0: only DCON protocol is supported 1: both the DCON and Modbus RTU protocols are supported C The c urrent protocol that is save d in the EEPROM that will be used at the next power-on reset 0: the protocol set in the EEPROM is DCON 1: the protocol set in the EEPROM is Modbus RTU There will be no r e sponse if the command synt a x is incorrect, there is a communication error , or there is no module with the specified address. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 34 of 47

33. Modbus DIO 3. Recently-added DCON commands General command set C o m m a n d R e s p o n s e Descripti o n Section $AAP !AA(Data) Reads the communicati on protocol informati on 3.1 $AAPN ~AA Sets the communication protocol 3.2 ~AAD !AA(Data) Reads the DI/O active status of the module 3.3 ~AADVV !AA Sets the DI/O active status of the module 3.4 ~ A A I ! A A S o f t I N I T 3 . 5 ~AATnn !AA Sets the Soft INIT Timeout 3.6 Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 33 of 47

17. Modbus DIO Supported modules M-7060/M-7060D: 0x0000~0x0003 for DO output Valid starting channel 0x0200~0x0203 to clear the DI count value M-7067/M-7067D: Valid starting channel 0x0000~0x0006 for DO output M-7055/M-7055D: 0x0000~0x0007 for DO output Valid starting channel 0x0200~0x0207 to clear the DI count value M-7052/M-7052D: Valid starting channel 0x0200~0x0207 to clear the DI count value M-7053/M-7053D: Valid starting channel 0x0200~0x020F to clear the DI count value M-7041/M-7041D: Valid starting channel 0x0200~0x020D to clear the DI count value M-7051/M-7051D: Valid starting channel 0x0200~0x020F to clear the DI count value Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 17 of 47

42. Modbus DIO 3.5 ~AAI Description: The Soft INIT command is used to enable modific a tion of the Baud Rate and checksum settings using software only. Syntax: ~AAI[CHKSUM](CR) ~ Delimiter character AA Address of the module to be read (00 to FF) I Command to set the Soft INIT Response: Valid Response: !AA[CHKSUM](CR) Invalid Response: ?AA[CHKSUM](CR) ! Delimiter character for a valid response ? Delimiter character for an invalid response AA Address of the r e sponding module (00 to FF) There will be no r e sponse if the command synt a x is incorrect, there is a communication error , or there is no module with the specified address. Examples: Command: ~01I Response: !01 Sets the soft INIT of module 01 and returns a valid response. Related Commands: Section 3.6 of the “7000 DIO Manual” ~A ATnn, Section 2.1 of the “7000 DIO Manual” %AANNTTCCFF Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 42 of 47

15. Modbus DIO Supported modules M-7060/M-7060D: 0x0000~0x0003 for DO output Valid output channel 0x0100 to clear the DIO latch val u e. If setti ng this channel to ON, the latch value will become 0. 0x0200~0x0203 to clear the DI count value M-7067/M-7067D: 0x0000~0x 0006 for DO output Valid starting channel 0x0100 to clear the DO latc h value. If setting this channel to ON, the latch value will become 0. M-7055/M-7055D: 0x0000~0x 0007 for DO output Valid output channel 0x0100 to clear the DIO latch val u e. If setti ng this channel to ON, the latch value will become 0. 0x0200~0x0207 to clear the DI count value M-7052/M-7052D: Valid output channel 0x0100 to cl ear the DI l a tc h value. If setting this channel to ON, the latch value will become 0. 0x0200~0x0207 to clear the DI count value M-7053/M-7053D: Valid output channel 0x0100 to cl ear the DI l a tc h value. If setting this channel to ON, the latch value will become 0. 0x0200~0x020F to clear the DI count value M-7041/M-7041D: Valid output channel 0x0100 to cl ear the DI l a tc h value. If setting this channel to ON, the latch value will become 0. 0x0200~0x020D to clear the DI count value M-7051/M-7051D: Valid output channel 0x0100 to cl ear the DI l a tc h value. If setting this channel to ON, the latch value will become 0. 0x0200~0x020F to clear the DI count value Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 15 of 47

6. Modbus DIO Supported modules M-7060/M-7060D: 0x0000~0x 0003 for DO readback value 0x0020~0x0023 for DI val u e 0x0040~0x0043 for DI Latch high val ue 0x0044~0x0047 for DO Latch high value Valid starting channel 0x0060~0x0063 for DI Latch low val ue 0x0064~0x0067 for DO Lat ch low value M-7067/M-7067D: 0x0000~0x 0006 for DO readback value 0x0040~0x0046 for DO Latch high value Valid starting channel 0x0060~0x0066 for DO Latch low value M-7055/M-7055D: 0x0000~0x 0007 for DO readback value 0x0020~0x0027 for DI val u e 0x0040~0x0047 for DI Latch high val ue 0x0048~0x004F for DO Latch high value Valid starting channel 0x0060~0x0067 for DI Latch low val ue 0x0068~0x006F for DO Latch low value M-7052/M-7052D: 0x0020~0x0027 for DI val u e 0x0040~0x0047 for DI Latch high val uee Valid starting channel 0x0060~0x0067 for DI Latch low val u e M-7053/M-7053D: 0x0020~0x002F for DI val u e 0x0040~0x004F for DI Latch high val u e Valid starting channel 0x0060~0x006F for DI Latch low val u e M-7041/M-7041D: 0x0020~0x002D for DI val u e 0x0040~0x004D for DI Latch high val u e Valid starting channel 0x0060~0x006D for DI Latch low val u e Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 6 of 47

4. Modbus DIO 2. Modbus RTU Protocol The Modbus protocol was orig inally developed for Modicon controllers by Modicon Inc. De tailed infor m ation can be found at http://www.mo dicon.com/techpubs/toc7.html . Visit http://w ww.modbus.org to find more valuable information. M-7000 series modules support the Modbus RTU protocol. The communication Baud Rates range from 1200bps to 115200bps. The parity, data bits and stop bits are fixed as no parity, 8 data bits and 1 stop bit. T he following Modbus functions are supported. Function code Description Section 0 x 0 1 R e a d c o i l s 2 . 1 0x02 Read discrete input s 2.2 0x03 Read multiple registers 2.3 0x04 Read multiple input regis t ers 2.4 0x05 W r ite single coils 2.5 0x0F W r ite multiple coils 2.6 0x46 Read/write module settings 2.7 If the function specified in t he message is not supported, then the module responds as follows. Error Response 00 Address 1 B y t e 1 ~ 2 4 7 01 Function c o d e 1 Byte Function code + 0x80 02 Exception c o d e 1 B y t e 01 If a CRC mismatch occurs, the module will not res pond. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 4 of 47

19. Modbus DIO 2.6.1 Sub-function 00 (0x00) Read Module Name This sub-function c ode is used to read the name of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x00 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x00 03 ~ 06 Module name 4 Bytes 0x00 0x70 0x60 0x00 for M-7060/M-7060D modules 0x00 0x70 0x67 0x00 for M-7067/M-7060D modules Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 2/M-7052D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 19 of 47

27. Modbus DIO 2.6.7 Sub-function 34 (0x22) Read Digit a l Input Count Edge This sub-function code is used to read the digital input count edge value of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x22 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x22 03 Edge setting value 1 Byte *0x00~0x0F *1 = rising edge, 0 = falling edge. For example 0x03 denotes that channels 0~1 are set as risi ng edge and channels 2~3 are set as falling edge. Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7055/M-7055D /M-7051/M-7051D/M-705 2/M-7052D/M-7053/M-7053D/M-7041/M-7041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 27 of 47

29. Modbus DIO 2.6.9 Sub-function 40 (0x28) Read Power-on V a lue This sub-function code is used to read the power-on value of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x28 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x28 03 Power-on value 1 Byte *0x00~0xFF *0x00~0x0F for M-7060/M-7060D 0x00~0x7F for M-7067/M-7067D Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Refer to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7067/M-706 7D/M-7055/M-7055D/ Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 29 of 47

32. Modbus DIO 2.6.11 Sub-function 42 (0x2A ) Read DI/O active st at us This sub-function code is used to read the DI/O active status of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x2A Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x2A 03 DI/O active status 1 Byte *0x00~0x03 *0x00~0x03 for M-7060/M-7060D 0x00 and 0x02 for M-7067/M-7067D Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 32 of 47

14. Modbus DIO 2.5 05 (0x05) W r ite single coils This function code i s used to writ e the digital output value of the M-7000 DIO module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x05 02 ~ 03 Output channel numbers 2 Bytes 0x0000 ~ 0x001F 0x0100 to clear the latch value 0x0200~0x0220 to clear the DI count val u e 04 ~ 05 Output value 2 Bytes A value of 0xFF00 sets the output to ON. A value of 0x0000 sets it to OFF. All other val ues are ill egal and will not affect the coil. Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x05 02 ~ 03 Output channel numbers 2 Bytes The value is the same as byte 02 and 03 of the Request 04 ~ 05 Output value 2 Bytes The value is the same as byte 04 and 05 of the Request Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x 8 5 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 14 of 47

18. Modbus DIO 2.7 70 (0x46) Read/W rite Module Settings This function code is used to read the s e ttings of the module or change the s e ttings of the module. T h e following sub-function codes are supported. Sub-function Code Description Section 00 (0x00) Read the module name 2.6.1 04 (0x04) Set the module address 2.6.2 05 (0x05) Read the communication settings 2.6.3 06 (0x06) Set the communication settings 2.6.4 32 (0x20) Read the firmware version 2.6.5 33 (0x21) Set the DI count edge 2.6.6 34 (0x22) Read the DI count edge setting value 2.6.7 39 (0x27) Set the DO power-on value 2.6.8 40 (0x28) Read the DO power-on value 2.6.9 41 (0x29) Set the DI/O active status 2.6.10 42 (0x2A) Read the DI/O active status 2.6.11 If the module does not s upport the sub- function code specified in the message, t hen it responds as follows: Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 18 of 47

26. Modbus DIO 2.6.6 Sub-function 33 (0x21) Set Digit a l Input Count Edge This sub-function code is used to set the digital input count edge value of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x21 0 3 E d g e s e t t i n g value 1 Byte *0x00~0x0F *1 = rising edge, 0 = falling edge. For example 0x03 denotes that channels 0~1 are set as risi ng edge and channels 2~3 are set as falling edge. Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x21 03 Edge setting value 1 Byte 0: OK others: error Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7055/M-7055D /M-7051/M-7051D/M-705 2/M-7052D/M-7053/M-7053D/M-7041/M-7041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 26 of 47

5. Modbus DIO 2.1 01 (0x01) Read coils This function code i s used to read the current di gita l output readback value of the M-7000 DIO module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x01 02 ~ 03 Starting channel numbers 2 Bytes 0x0000~0x001F for DO readback value 0x0020~0x003F for DI val u e 0x0040~0x005F for DIO Latch high value 0x0060~0x007F for DIO Latch low value 04 ~ 05 Output channel number 2 Bytes 0x0001 ~ 0x001F Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x01 02 Byte c o u n t 1 B y t e 1 03 Output c h a n n e l readback value 1 Byte Refer to page 6 for the details of the value Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x 8 1 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 5 of 47

10. Modbus DIO 2.3 03 (0x03) Read multiple registers This function code i s used to read t he current di gital i nput count val ue of the M-7000 DIO module . Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x03 02 ~ 03 Starting channel numbers 2 Bytes 0x0000 ~ 0x001F 04 ~ 05 Input channel number 2 Bytes 0x0001 ~ 0x0020 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x03 02 Byte c o u n t 1 B y t e 1 03~ Input c h a n n e l count val ue *N x 2 Bytes Each channel can record a maximum count val ue up to 65535 (0xFFFF). *N = Number of input channels Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x 8 3 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D: Valid starting channel 0x0000~0x 0003 for DI count val ue Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 10 of 47

12. Modbus DIO 2.4 04 (0x04) Read multiple input registers This function code i s used to read t he current di gital i nput count val ue of the M-7000 DIO module . Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x04 02 ~ 03 Starting channel numbers 2 Bytes 0x0000 ~ 0x001F 04 ~ 05 Input channel number 2 Bytes 0x0001 ~ 0x0020 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x04 02 Byte c o u n t 1 B y t e 1 03~ Input c h a n n e l count val ue *N x 2 Bytes Each channel can record the maximum count val ue up to 65535 (0xFFFF). *N = Number of input channels Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x 8 4 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D: Valid starting channel 0x0000~0x 0003 for DI count val ue Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 12 of 47

25. Modbus DIO 2.6.5 Sub-function 32 (0x20) Read Firmware V e rsion This sub-function code is used to read the firmware version information of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x20 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x20 03 Major version 1 Byte 0x00~0xFF 04 Minor version 1 Byte 0x00~0xFF 05 Build version 1 Byte 0x00~0xFF Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 25 of 47

16. Modbus DIO 2.6 15 (0x0F) W r ite multiple coils This function code i s used to writ e the digital output value of the M-7000 DIO module. Request 00 Address 1 B y t e 1 ~ 247 01 Function c o d e 1 B y t e 0x0F 02 ~ 03 Starting channel numbers 2 Bytes 0x0000 ~ 0x001F for DO output 0x0200~0x0220 to clear the DI count val u e 04 ~ 05 Output channel number 2 Bytes 0x0001 ~ 0x0020 06 Byte count 1 Byte 1 07 Output value 1 Byte A bi t corresponds to a channel. When the bit is 1 it denotes that the value of the channel that was set is ON. If the bi t is 0 it denotes that the value of the channel that was set i s OFF. Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x0F 02 ~ 03 Starting channel numbers 2 Bytes The value is the same as byte 02 and 03 of the Request 04 ~ 05 Input channel number 2 Bytes The value is the same as byte 04 and 05 of the Request Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x 8 F 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 16 of 47

28. Modbus DIO 2.6.8 Sub-function 39 (0x27) Set Power-on V a lue This sub-function code is used to set the power-on value of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x27 03 Power-on Value 1 Byte *0x00~0xFF *0x00~0x0F for M-7060/M-7060D 0x00~0x7F for M-7067/M-7067D Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x28 03 Power-on value 1 Byte 0: OK, others: error Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7067/M-706 7D/M-7055/M-7055D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 28 of 47

8. Modbus DIO 2.2 02 (0x02) Read discrete input s This function code i s used to read the current di gital i nput value of the M-7000 DIO module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x02 02 ~ 03 Starting channel 2 Bytes 0x0000 ~ 0x001F 04 ~ 05 Input channel number 2 Bytes 0x0001 ~ 0x0020 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x02 02 Byte c o u n t 1 B y t e 1 03 Input c h a n n e l data 1 Byte Refer to the page 8 for details of the value. Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x82 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Supported modules M-7060/M-7060D: Valid starting channel 0x0000~0x 0003 for DI val u e M-7055/M-7055D: Valid starting channel 0x0000~0x 0007 for DI val u e Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 8 of 47

20. Modbus DIO 2.6.2 Sub-function 04 (0x04) Set Module Address This sub-function code is us ed to set the address of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x04 03 Address 1 Byte 1 ~ 247 04~ 06 Reserved 3 Bytes 0x00 0x00 0x00 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x04 03 Set address result 1 Byte 0: OK Others: error 04~ 06 Reserved 3 Bytes 0x00 0x00 0x00 Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Refer to the Modbus standard for more details. Supported modules M-7060/M-7060D/M-7067/M-7067D /M-7055/M-7055D/M-705 1/M-7051D/M-7052/M-7052D/M -7053/M-7053D/M-7041/M- 7 041D Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 20 of 47

30. Modbus DIO 2.6.10 Sub-function 41 (0x29) Set DI/O active st atus This sub-function code is used to set the DI/O active status of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x29 03 DI/O active status 1 Byte *0x00~0x03 Refer to T able 2. *0x00~0x03 for M-7060/M-7060D 0x00 and 0x02 for M-7067/M-7067D DI/O active st atus: 7 6 5 4 3 2 1 0 R e s e r v e d O A S I A S Key D e s c r i p t i o n OAS DO active st atus 0: output value 1 for relay active output val ue 0 for relay i nactive 1: output value 0 for relay active output val ue 1 for relay i nactive I A S D I active st a t u s 0: input value 1 for non-signal or the l o w volt age; input value 0 for high volt age 1: input value 0 for non-signal or the l o w volt age; input value 1 for high volt age Table 2. Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x29 03 Power-on value 1 Byte 0: OK others: error Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 30 of 47

23. Modbus DIO 2.6.4 Sub-function 06 (0x06) Set Communication Settings This sub-function code is used to set the communication protocol of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x06 03 Reserved 1 B y t e 0 x 0 0 04 Baud Rate 1 Byte Refer to Table 1. on page 17 05~ 07 Reserved 3 Bytes 0x00 0x00 0x00 08 Mode 1 Byte 0: DCON protocol 1: Modbus RTU protocol 09~10 Reserved 2 Bytes 0x00 0x00 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x06 03 Reserved 1 B y t e 0 x 0 0 04 Baud Rate 1 Byte 0: OK, others: error 05~ 07 Reserved 3 Bytes 0x00 0x00 0x00 08 Mode 1 Byte 0: OK, others: error 09~10 Reserved 2 Bytes 0x00 0x00 Note : The new Baud Rate and protocol will be effective after the next power-on reset. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 23 of 47

21. Modbus DIO 2.6.3 Sub-function 05 (0x05) Read Communication Settings This sub-function code is used to read the communication protocol settings of a module. Request 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x05 0 3 R e s e r v e d 1 B y t e 0 x 0 0 Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0x46 02 Sub-function c o d e 1 B y t e 0x05 03 Reserved 1 B y t e 0 x 0 0 04 Baud Rate 1 Byte Refer to Table 1. below 05~ 07 Reserved 3 Bytes 0x00 0x00 0x00 08 Mode 1 Byte 0: DCON protocol 1: Modbus RTU protocol 09~10 Reserved 2 Bytes 0x00 0x00 Note : This information is the data saved in the EEPROM and will be used for the next power-on reset. It is not the currently used settings. Baud Rate setti ngs: Va l u e 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 A Baud Rate 1 2 0 0 2 4 0 0 4 8 0 0 9 6 0 0 19200 38400 5 7 6 0 0 1 15200 Table 1. Error Response 00 Address 1 Byte 1 ~ 247 01 Function c o d e 1 B y t e 0 x C 6 02 Exception code 1 Byte Ref er to the Modbus standard for more details. Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 21 of 47

2. Modbus DIO Table of Contents 1. Introduction ......................................................................................................... 3 1.1 More Inform ation ........................................................................................ 3 2. Modbus R T U Protocol ........................................................................................ 4 2.1 01 (0x01) Read coils ................................................................................... 5 2.2 02 (0x02) Read discrete inputs ................................................................... 8 2.3 03 (0x03) Read m u ltiple regis t ers ............................................................. 10 2.4 04 (0x04) Read m u ltiple input regis t ers .................................................... 12 2.5 05 (0x05) W r ite single coils ...................................................................... 14 2.6 15 (0x0F) W r ite m u ltiple coils .................................................................. 16 2.7 70 (0x46) Read/W rite Module Settings .................................................... 18 2.6.1 Sub-function 00 (0x00) Read Module Na m e .................................... 19 2.6.2 Sub-function 04 (0x04) Set Module Address .................................... 20 2.6.3 Sub-functio n 05 (0x05) R ead Communication Settings ................... 21 2.6.4 Sub-function 06 (0x06) Se t Comm unication Settings ...................... 23 2.6.5 Sub-function 32 (0x20) Read Firm ware V e rsion .............................. 25 2.6.6 Sub-function 33 (0x21) Set Digital Input Count Edge ..................... 26 2.6.7 Sub-function 34 (0x22) Read Digital Input Count Edge .................. 27 2.6.8 Sub-function 39 (0x27) Set Power - on V a lue .................................... 28 2.6.9 Sub-function 40 (0x28) Read Power - on V a lue ................................. 29 2.6.10 Sub-function 41 (0x29) Se t DI/O active status ................................. 30 2.6.1 1 Sub-function 42 (0x2A) R ead DI/O active status ............................. 32 3. Recently -ad d ed DCON commands ................................................................... 33 3.1 $AAP ................................................................................................. 34 3.2 $AAP N .............................................................................................. 36 3.3 ~AAD ................................................................................................ 38 3.4 ~AADVV .......................................................................................... 40 3.5 ~AAI ................................................................................................. 42 3.6 ~AA T nn ............................................................................................. 44 4. Hardware infor m ation and DCON Protocol ..................................................... 47 Modbus DIO User ’ s Manual , Rev: 3.22 7MS-016-B30 2 of 47

Views

  • 1001 Total Views
  • 740 Website Views
  • 261 Embeded Views

Actions

  • 0 Social Shares
  • 0 Likes
  • 0 Dislikes
  • 0 Comments

Share count

  • 0 Facebook
  • 0 Twitter
  • 0 LinkedIn
  • 0 Google+