Xiamen Four-Faith Communication Technology Co., Ltd.
Xiamen Four-Faith Communication Technology Co.,Ltd.
Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 11 Communication between F8114 and F8914 Part One Communication between F8114 and F8914(send ModBus command from the Data Service Center(DSC) to read the IO status of F8914). The networking is as follows: Illustration of Terminal Blocks of F8914. IO1: Digital input/output 0---3.3V IO2: Digital input/output 0---3.3V IO3: Analog voltage input 0---5V IO4: Analog current input 4---20mA IO5: Analog current input 4---20mA PC (runs a TCP Server software) GPRS network F8914(ZigBee F8114(GPRS+ZigBee IO1 PIN8 ZigBee network IO2 PIN9 IO3 PIN10 IO4 PIN11 IO5 PIN12 Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 22 When IO port is configured as digital output, the function code is 05. When IO port is configured as digital input, the function code is 02. When IO port is configured as analog input, the function code is 04. F8914 IO Port Address IO5 as analog input, register address:0X40000 IO4 as analog input, register address:0X40001 IO3 as analog input, register adress: 0X40002 IO2 as digital input, register address:0X20003 IO1 as digital input, register address:0X20004 Wiring method of sensor Analog input a. Single-wire: Connect the analog output of the sensor to the analog input(IO3/IO4/IO5) of F8914 directly. b. Double-wire: Connect the positive of analog output of the sensor to the analog input(IO3/IO4/IO5) of F8114, and connect the ground wire to GND(PIN2) of F8914. Digital input a. Low level inputConnect the input of contact switch to GND of F8914, and connect the output of contact switch to the digital output of F8914(IO1/IO2). b. High level inputConnect 3.3V voltage output to IO1/IO2, and connect the ground wire to GND of F8914. Atemperature humidity sensor(double-wire) with analog(current) output is as picture below. Connect to GND(PIN2/PIN3) Temperature(PIN1-IO5 Humidity (PIN1-IO4) Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 33 1. Configurations in F8114 Data Service Center Settings IP Modem setting Use MODBUS function Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 44 Zigbee Setting MODBUS Setting The same as F8914 Crossed configuration with F8914 The same as F8914 Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 55 2. Configurations in F8914 When F8114 is connected to DSC, and F8914 joins in the zigbee network. You can send Modbus command from DSC to read 8914 IO status. Below are the commands and responses. The same as F8114 The same as F8114 Crossed configuration with F8114 The lower baudrate, the longer interval Only used in AT mode Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 66 To read IO4 value(analog input) Request: 01 04 00 F1 00 01 60 39 Responds: 01 04 02 01 73 F9 45 (current input 4mA ) Response: 01 04 02 02 E9 79 DE (current input 8mA) Response: 01 04 02 03 A5 79 BB (current input 10mA) Response: 01 04 02 05 78 BA C2 (current input 15mA) Response: 01 04 02 07 4D 7B 35 (current input 20mA) To read IO5 value(analog input) Request: 01 04 00 F0 00 01 31 F9 Response: 01 04 02 01 74 B8 87 (current input 4mA ) Response: 01 04 02 02 EB F8 1F (current input 8mA) Response: 01 04 02 03 A7 F8 7A(current input 10mA) Response: 01 04 02 05 7B FA43 (current input 15mA) Response: 01 04 02 07 51 7AFC (current input 20mA) To read IO3 value(analog input) Request: 01 04 00 F2 00 01 90 39 Response: 01 04 02 04 72 3B D5 (voltage input 3.06V Notes of the Modbus commands. Take the command 01 04 00 F2 00 01 90 39 for example. F8114 Modbus addr. Function code 8914 node addr. Register addr. Register number CRC16 01 04 00 F 2 00 01 90 39 Response 01 04 02 04 72 3B D5 F8114 Modbus addr. Function code Byte count Acquisition value CRC16 01 04 02 04 72 3B D5 The acquisition value in HEX. You need to convert it to DEC and calculate with the formula below. And then calculate the pratical value according to the measuring range of the sensor. Current type: 3.3/2047 *acquisition value/150 *1000= (mA) Voltage type: 3.3/2047 *acquisition value/12.1*20.16= V (The acquisition value should be converted to DEC first) Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 77 To set IO1 high/low level(digital output) Request: 01 05 00 F4 FF 00 CD C8 (set IO1 high level Response:01 05 00 F4 FF 00 CD C8 Request: 01 05 00 F4 00 00 8C 38 (set IO1 low level Response:01 05 00 F4 00 00 8C 38 To query IO1 status(digital output) Request: 01 01 00 F4 00 01 BC 38 Response: 01 01 01 01 90 48 IO1 high level Response: 01 01 01 00 51 88 IO1 low level To set IO2 high/low level(digital output) Request: 01 05 00 F3 FF 00 7C 09 (set IO2 high level Response:01 05 00 F3 FF 00 7C 09 Request: 01 05 00 F3 00 00 3D F9 (set IO2 low level Response:01 05 00 F0 00 00 CD F9 To query IO2 status(digital output) Request: 01 01 00 F3 00 01 0D F9 Response: 01 01 01 01 90 48 IO2 high level Response: 01 01 01 00 51 88 IO2 low level Notes of the Modbus commands. Take the command 01 05 00 F4 FF 00 CD C8 for example. F8114 Modbus addr. Function code 8914 node addr. Register addr. Set high/level CRC16 01 05 00 F 4 FF 00 CD C8 00 00 8C 38 Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 88 To read IO2 status(digital input) Request01 02 00 F3 00 01 49 F9 Response:01 02 01 01 60 48 (IO2 high level) Response:01 02 01 00 A1 88 (IO2 low level) To read IO1 status(digital input) Request: 01 02 00 F4 00 01 F8 38 Response:01 02 01 01 60 48 (IO1 high level) Response:01 02 01 00 A1 88 (IO1 low level) Notes of the Modbus commands. Take the command 01 02 00 F4 00 01 F8 38 for example. F8114 Modbus addr. Function code 8914 node addr. Register addr. Register number CRC16 01 02 00 F 4 00 01 F8 38 Response 01 02 01 00 A1 88 F8114 Modbus addr. Function code Byte count IO status CRC16 01 02 01 01(high level) 60 48 00(low level) A1 88 Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 99 Part two Transparent transmission between F8114(with data center) and F8914 1. Configurations in F8114 Data Service Center Settings IP Modem Setting Use ZIGBEE function Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 10 10 Zigbee setting MODBUS Setting Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 11 11 2. Configurations in F8914 The debug level can be configure as 1 or 2 when you make the test, and the change to 0 when you put it into use. The same as F8114 The same as F8114 Crossed configuration with F8114 The lower baudrate, the longer interval Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 12 12 Part three Modbus Protocol for GPIO&ADC Acquisition Illustration of Terminal Blocks of F8114. IO1: Digital input/output 0---3.3V IO2: Digital input/output 0---3.3V IO3: Digital input/output 0---3.3V IO4: Analog Current input 4---20mA IO5: Analog Current input 4---20mA Changes can be made in hardware to make IO4/IO5 as voltage input(0-5V). IO Ports configurations in F8114 Configure MODBUS work mode as Network RTU and configure the MODBUS address. Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 13 13 Configure analog and digital quantity work mode. Send Modbus command from the DSC to F8114 to read the IO value. 1. Configure IO1, IO2, IO3 as digital input and IO4, IO5 as analog input. When IO1 is digital input,the register addr is OX20000 . When IO2 is digital input,the register addr is OX20001 . When IO3 is digital input,the register addr is OX20002 . When IO4 is analog input,the register addr is 0X40000 . When IO5 is analog input,the register addr is 0X40001 . The examples are below. Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 14 14 When F8114 is connected to DSC. You can send Modbus command from DSC to read 8914 IO status. The commands and responses are as below. To read IO1 status(digital input) Request: 01 02 00 00 00 01 B9 CA Response:01 02 01 01 60 48 (IO1 is high level) Response:01 02 01 00 A1 88 (IO1 is low level) To read IO2 status(digital input) Request: 01 02 00 01 00 01 E8 0A Response:01 02 01 01 60 48 (IO2 is high level) Response:01 02 01 00 A1 88 (IO2 is low level) To read IO3 status(digital input) Request: 01 02 00 02 00 01 18 0A Response:01 02 01 01 60 48 (IO3 is high level) Response:01 02 01 00 A1 88 (IO3 is low level) Notes of the modbus commands. Take the command 01 02 00 02 00 01 18 0Afor example. F8114 Modbus addr. Function code Register addr. Register number CRC16 01 02 00 02 00 01 18 0A Response 01 02 01 01 60 48 F8114 Modbus addr. Function code bytes Register status CRC16 01 02 01 01(high level) 60 48 01 02 01 00 (low level) A1 88 To read IO4 value(analog input) Request: 01 04 00 00 00 01 31 CA Response:01 04 02 00 B8 B9 42 (current input 4mA) Response:01 04 02 02 B9 79 E2 (current input 15mA) Response:01 04 02 03 A3 F9 B9 (current input 20mA) To read IO5 value(analog input) Request: 01 04 00 01 00 01 60 0A Response:01 04 02 00 B8 B9 42 (current input 4mA Response:01 04 02 02 BD 78 21 (current input 15mA Response:01 04 02 03 A8 B8 7E (current input 20mA Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 15 15 Notes of the modbus commands. Take the command 01 04 00 01 00 01 60 0Afor example. Modbus addr. Function code Register addr. Register number CRC16 01 04 00 01 00 01 60 0A Response 01 04 02 00 B8 B9 42 Modbus addr. Function code Byte count Acquisition value CRC16 01 04 02 04 B8 B9 42 The acquisition value in HEX. You need to convert it to DEC and calculate with the formula below. And then calculate the pratical value according to the measuring range of the sensor. Current type: 3.3/1023 *acquisition value/150 *1000= (mA) Voltage type: 3.3/1023 *acquisition value/12.1*20.16= V (The acquisition value should be converted to DEC first) 2. Configure IO1, IO2, IO3 as digital output. When IO1 is digital output,the register addr is OX50000 . When IO2 is digital output,the register addr is OX50001 . When IO3 is digital output,the register addr is OX50002 . To set IO1 high/low level(digital output) Request: 01 05 00 00 FF 00 8C 3A(to set high level Response:01 05 00 00 FF 00 8C 3A Request: 01 05 00 00 00 00 CD CA (to set low level Response:01 05 00 00 00 00 CD CA Xiamen Four-Faith Communication Technology Co., Ltd. Xiamen Four-Faith Communication Technology Co.,Ltd. Add:J1-J3,3rd Floor,No.44,GuanRi Road,SoftWare Park,XiaMen .361008.China http://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax+86 592-5912735 16 16 To set IO2 high/low level(digital output) Request: 01 05 00 01 FF 00 DD FA(to set high level Response:01 05 00 01 FF 00 DD FA Request: 01 01 00 01 00 01 AC 0A(to set low level) Response:01 01 00 01 00 01 AC 0A To set IO3 high/low level(digital output) Request: 01 05 00 02 FF 00 2D FA(to set high level Response:01 05 00 02 FF 00 2D FA Request: 01 05 00 02 00 00 6C 0A(to set low level Response:01 05 00 02 00 00 6C 0A Notes of the modbus commands. Take the command 01 05 00 00 FF 00 8C 3Afor example. Modbus addr. Function code Register addr. Set high/low level CRC16 01 05 00 00 FF 00 8C 3A 00 00 CD CA 3. Wiring method of sensor Analog input a. Single-wire: Connect the analog output of the sensor to the analog input(IO4/IO5) of F8114 directly. b. Double-wire: Connect the positive of analog output of the sensor to the analog input(IO4/IO5) of F8114, and connect the ground wire to GND(PIN2) of F8114. Digital input a. Low level inputConnect the input of contact switch to GND of F8114, and connect the output of contact switch to the digital output of F8114(IO1/IO2/ 1O3). b. High level inputConnect 3.3V voltage output to IO1/IO2/ IO3, and connect the ground wire to GND of F8114. Macy Skype: tony-hsmshi Email:macy@four-faith.com