1、 球机通信接口(EIA/RS-485)
数据传输方式:异步半双工串行通讯
通信波特率 :9600Bps
数据格式 :Start Bit :1 Bit;
Data Bit :8 Bit
Parity Bit:None
Stop Bit :1Bit
信号极性 :Mark=Logic“1” ;Space=Logic“0”
2、 命令格式(一个数据包的代码长度为固定的11字节)
控制器与摄像机的通信顺序:控制器→摄像机(11-Byte)
WORD1 |
STX |
A0H |
WORD2 |
RECEIVER ADDRESS |
00H~1FH |
WORD3 |
SENDER ADDRESS |
00H~1FH |
WORD4 |
COMMAND(1) |
|
WORD5 |
COMMAND(2) |
|
WORD6 |
DATA(1) |
|
WORD7 |
DATA(2) |
|
WORD8 |
DATA(3) |
|
WORD9 |
DATA(4) |
|
WORD10 |
ETX |
AFH |
WORD11 |
Check Sum |
|
Check-Sum (校验和)的计算方法:
l 将WORD2到WORD9的内容相加
l 用FFFFH减去上面所加的和
l 上面减得的结果的后两位就是校验和
l 例如:如果WORD2到WORD9的和为567H或A00H
FFFFH-567H=A98H→Check-Sum=98H
FFFFH-A00H=5FFH→Check-Sum=FFH
3、 命令注解
球机的控制命令分为两大类,即PTZ命令和扩展命令。PTZ命令主要执行
云台的“上”、“下”、“左”、“右”和镜头的“变倍”、“变焦”、“光圈”等
控制;扩展命令则控制云台的预置、巡视等功能
4、PTZ命令(PAN/TILT/ZOOM)
WORD4(Command1)
|
-Bit7(MSB) |
常量 |
0 |
-Bit6 |
Not Used |
0或1 |
-Bit5 |
Not Used |
0或1 |
-Bit4 |
IRIS OPEN |
00:IRIS STOP
01:IRIS CLOSE
10:IRIS OPEN
11:保持光圈当前动作 |
-Bit3 |
IRIS CLOSE |
-Bit2 |
常量 |
0 |
-Bit1 |
FOCUS NEAR |
00:FOCUS STOP
01:FOCUS CLOSE
10:FOCUS OPEN
11:保持变焦当前动作 |
-Bit0(LSB) |
FOCUS FAR |
WORD5(Command2) |
-Bit7(MSB) |
常量 |
0 |
-Bit6 |
ZOOM WIDE |
00:ZOOM STOP
01:ZOOM TELE
10:ZOOM WIDE
11:保持变倍当前动作 |
-Bit5 |
ZOOM TELE |
-Bit4 |
TILT DOWN |
00:TILT STOP
01:TILT UP
10:TILT DOWN
11:保持上下当前动作 |
-Bit3 |
TILT UP |
-Bit2 |
PAN LEFT |
00:PAN STOP
01:PAN RIGHT
10:PAN LEFT
11:保持水平当前动作 |
-Bit1 |
PAN RIGHT |
-Bit0(LSB) |
PTZ命令时为0 |
扩展命令时为1 |
WORD6 DATA(1) |
PAN MOTOR SPEED (01H~40H) |
WORD7 DATA(2) |
TILT MOTOR SPEED (01H~40H) |
WORD8 DATA(3) |
高4位表示FOCUS的速度(01H~08H)
低4位表示ZOOM的速度(01H~08H)
注意:球机的FOCUS、ZOOM速度可能不可控制
此时WORD8=44H |
WORD9 DATA(4) |
FFH |
PTZ命令控制说明:
⒈ 当控制云台水平、上下方向动作或“IRIS”、“FOCUS”、“ZOOM”时
需要使相应的控制位为“1”,不用控制的相应位置为“0”
⒉ 当需要云台PAN/TILT两方向同时动作时,只需将PAN/TILT的相应控制位
置“1”即可,PAN/TILT 的速度控制由WORD6/WORD7决定
⒊ 将WORD4、WORD5的所有位置为“0”可以停止云台的动作
5、扩充命令
(1)、设置预置点
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
03H |
XX |
FFH |
FFH |
FFH |
XX=00H~3FH(PRESET NUMBER)
(2)、调用预置点
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
07H |
XX |
FFH |
FFH |
FFH |
XX=00H~3FH(PRESET NUMBER)
(3)、启动自动扫描方法1
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
11H |
00H |
P1 |
P2 |
FFH |
P1,P2=00H~3FH 线扫起点和止点
(4)、启动自动扫描方法2 (先设置好线扫起点和止点后方可执行该命令)
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
1BH |
00H |
FF |
FF |
FFH |
(5)、设置线扫起点和终点
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
19H |
00H |
P1 |
P2 |
FFH |
P1,P2=00H~3FH 线扫起点和止点
(6)、停止自动扫描
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
1FH |
FFH |
FFH |
FFH |
FFH |
(7)、设置巡视序列(每条巡视序列最多可设16个预置点)
* 设置巡视序列起始码:
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
23H |
GG |
80H |
FFH |
FFH |
* 设置巡视序列结束码:
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
23H |
GG |
40H |
FFH |
FFH |
* 设置巡视序列中间码:
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
23H |
GG |
XX |
SPEED |
TIME |
<GG>:序列号 00H~05H
<XX>:预置点号00H~3FH
SPEED:运行速度01H~08H(1速最快)
TIME: 滞留时间01H~FFH(秒)
(8)、运行巡视序列
WORD4 |
WORD5 |
WORD6 |
WORD7 |
WORD8 |
WORD9 |
00H |
21H |
GG |
00H |
FFH |
FFH |