CHIYU TECHNOLOGY CO., LTD.
No.28, Renai Rd., Chiayi, 600, Taiwan Tel
:
(886) 5-2835460 Fax
:
(886) 5-2835458
BF-480M User’s Guide
- 32 -
Appendix A: DIO Command Protocol
In this appendix the DIO command protocol is described here to let customer’s remote management software to
access Digital I/O state through Ethernet network by a specific TCP/UDP port(default is 50000) ,RS232 and
RS485.
Command Packet Format:
Length(Bytes)
2
2
32
32
2
1
Start Flag
Command
Data1 Data2 End Flag
CRC
Ethernet
Send command to BF-2300 by one of three ways (TCP Server/TCP Client/UDP Mode)
Serial
Send command to BF-2300 by RS232 and RS485
Return Packet Format:
Length(Bytes)
2
2
32
32
2
1
Start Flag
Command Status Data1 Data2 End Flag
CRC
The BF-2300 returns by Return packet. You can get command status to know the result after sending command
packet and from Data1 and Data2 to know current I/O state.
Note:
Start Flag: 0xF0F0
End Flag: 0xF0F0
Command Status:
the definition of command code is as following
0x0002 – ACK of Read Digital I/O state
0x0004 – ACK of Trigger Digital I/O
0x0006 – ACK of E-mail Alarm Trigger
0x0010 – Report current Digital I/O state (If Auto Report I/O Status is enabled, you will receive this report packet
from BF-2300)
0xFFFC – Flag error, incorrect Start Flag or End Flag received in command packet
0xFFFD – Length error, the length of command packet is invalid
0xFFFE – CRC error, incorrect CRC value
0xFFFF – Command error, no such command
CRC value = 0 – total sum from field of ‘Start Flag” to “End Flag”
The format of each command code is as following:
1. Read Digital I/O state
Length(Bytes)
2
2
32
32
2
1
0xF0F0
0x0001
Xxx
(don’t care)
Xxx
(don’t care)
0xF0F0 CRC