Date post: | 21-Jul-2016 |
Category: |
Documents |
Upload: | cocofourfaith |
View: | 18 times |
Download: | 6 times |
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.Chinahttp://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.3VIO2: Digital input/output 0---3.3VIO3: Analog voltage input 0---5VIO4: Analog current input 4---20mAIO5: Analog current input 4---20mA
PC (runs a TCP Server software)
GPRS network
F8914(ZigBee) F8114(GPRS+ZigBee)
IO1PIN8
ZigBee network
IO2PIN9
IO3PIN10
IO4PIN11
IO5PIN12
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.Chinahttp://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:0X40000IO4 as analog input, register address:0X40001IO3 as analog input, register adress: 0X40002IO2 as digital input, register address:0X20003IO1 as digital input, register address:0X20004
Wiring method of sensorAnalog inputa. Single-wire: Connect the analog output of the sensor to the analog input(IO3/IO4/IO5) of F8914directly.b. Double-wire: Connect the positive of analog output of the sensor to the analoginput(IO3/IO4/IO5) of F8114, and connect the ground wire to GND(PIN2) of F8914.
Digital inputa. Low level input:Connect the input of contact switch to GND of F8914, and connect the outputof contact switch to the digital output of F8914(IO1/IO2).b. High level input:Connect 3.3V voltage output to IO1/IO2, and connect the ground wire to GNDof F8914.
A temperature 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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
33
1. Configurations in F8114Data Service Center Settings
IP Modem setting
Use MODBUSfunction
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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
44
Zigbee Setting
MODBUS Setting
The same asF8914
Crossed configurationwith F8914
The same asF8914
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.Chinahttp://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 Modbuscommand from DSC to read 8914 IO status. Below are the commands and responses.
The same as F8114
The same as F8114
Crossed configurationwith F8114
The lower baudrate,the longer interval
Only used in ATmode
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.Chinahttp://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 39Responds: 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 F9Response: 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 FA 43 (current input 15mA)Response: 01 04 02 07 51 7A FC (current input 20mA)
To read IO3 value(analog input)Request: 01 04 00 F2 00 01 90 39Response: 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.Functioncode
8914node addr.
Registeraddr.
Registernumber
CRC16
01 04 00 F 2 00 01 90 39
Response 01 04 02 04 72 3B D5F8114
Modbus addr.Functioncode
Bytecount
Acquisitionvalue
CRC16
01 04 02 04 72 3B D5
The acquisition value in HEX. You need to convert it to DEC and calculate with the formulabelow. 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.Chinahttp://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 C8Request: 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 38Response: 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 09Request: 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 F9Response: 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.Functioncode
8914node addr.
Registeraddr.
Sethigh/level
CRC16
01 05 00 F 4FF 00 CD C800 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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
88
To read IO2 status(digital input)Request:01 02 00 F3 00 01 49 F9Response: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 38Response: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.Functioncode
8914node addr.
Registeraddr.
Registernumber
CRC16
01 02 00 F 4 00 01 F8 38
Response 01 02 01 00 A1 88F8114
Modbus addr.Functioncode
Byte count IO status CRC16
01 02 0101(high level) 60 4800(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.Chinahttp://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 F8114Data Service Center Settings
IP Modem Setting
Use ZIGBEEfunction
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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1010
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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1111
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 youput it into use.
The same as F8114
The same as F8114
Crossed configurationwith 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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1212
Part three
Modbus Protocol for GPIO&ADC Acquisition
Illustration of Terminal Blocks of F8114.
IO1: Digital input/output 0---3.3VIO2: Digital input/output 0---3.3VIO3: Digital input/output 0---3.3VIO4: Analog Current input 4---20mAIO5: Analog Current input 4---20mAChanges can be made in hardware to make IO4/IO5 as voltage input(0-5V).
IO Ports configurations in F8114Configure 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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1313
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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1414
When F8114 is connected to DSC. You can send Modbus command from DSC to read 8914 IOstatus. The commands and responses are as below.
To read IO1 status(digital input)Request: 01 02 00 00 00 01 B9 CAResponse: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 0AResponse: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 0AResponse: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 0A for example.F8114
Modbus addr.Functioncode
Register addr. Register number CRC16
01 02 00 02 00 01 18 0AResponse 01 02 01 01 60 48
F8114Modbus addr.
Functioncode
bytes Register status CRC16
01 02 01 01(high level) 60 4801 02 01 00 (low level) A1 88
To read IO4 value(analog input)Request: 01 04 00 00 00 01 31 CAResponse: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 0AResponse: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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1515
Notes of the modbus commands. Take the command 01 04 00 01 00 01 60 0A for example.Modbusaddr.
Functioncode
Register addr. Register number CRC16
01 04 00 01 00 01 60 0A
Response 01 04 02 00 B8 B9 42Modbusaddr.
Functioncode
Bytecount
Acquisitionvalue
CRC16
01 04 02 04 B8 B9 42
The acquisition value in HEX. You need to convert it to DEC and calculate with the formulabelow. 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 3ARequest: 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.Chinahttp://www.fourfaith.com Tel:+86 592-6300326 6300325 6300324 Fax:+86 592-5912735
1616
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 FARequest: 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 FARequest: 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 3A for example.Modbusaddr.
Functioncode
Register addr.Set high/low
levelCRC16
01 05 00 00FF 00 8C 3A00 00 CD CA
3. Wiring method of sensorAnalog inputa. Single-wire: Connect the analog output of the sensor to the analog input(IO4/IO5) of F8114directly.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 inputa. Low level input:Connect the input of contact switch to GND of F8114, and connect the outputof contact switch to the digital output of F8114(IO1/IO2/ 1O3).b. High level input:Connect 3.3V voltage output to IO1/IO2/ IO3, and connect the ground wire toGND of F8114.
MacySkype: tony-hsmshi
Email:[email protected]