0% found this document useful (0 votes)
223 views

Datavideo PTZ VISCA Commands Rev. 1.7 - 20180409 PDF

This document describes the VISCA protocol for controlling PTZ and block cameras. It outlines the VISCA packet structure and communication specifications, including timing charts. It provides details on command/inquiry packets, response packets like ACK, completion and error messages. It also lists the general and inquiry command codes for PTZ and block camera control.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
223 views

Datavideo PTZ VISCA Commands Rev. 1.7 - 20180409 PDF

This document describes the VISCA protocol for controlling PTZ and block cameras. It outlines the VISCA packet structure and communication specifications, including timing charts. It provides details on command/inquiry packets, response packets like ACK, completion and error messages. It also lists the general and inquiry command codes for PTZ and block camera control.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Rev 1.

PTZ and Block Camera Control Protocol

April 9th, 2018

Model: BC-80, BC-80T, BC-200, BC-200T, PTC-150, PTC-


150T, PTC-200, PTC-200T

Datavideo Technologies
PTZ and Block Camera Control Protocols

Datavideo PTZ/Block Camera VISCA Commands


Overview of VISCA ............................................................................................................ 3

VISCA Communication Specifications............................................................................... 4

VISCA Packet Structure ..................................................................................................... 4

Timing Chart ...................................................................................................................... 5

Command and inquiry ...................................................................................................... 5

Responses for commands and inquiries .......................................................................... 6

Socket number .................................................................................................................. 7

VISCA Device Setting Command ....................................................................................... 7

VISCA interface command ................................................................................................ 7

VISCA Command/ACK Protocol ........................................................................................ 7

VISCA Camera-Issued Messages ....................................................................................... 9

ACK/Completion Messages .............................................................................................. 9

Error Messages.................................................................................................................. 9

PTZ and Block Camera Commands ................................................................................. 10

PTZ and Block Camera General Command List .............................................................. 10

PTZ and Block Camera Inquiry Command List ............................................................... 14

Revision History .............................................................................................................. 19

2
PTZ and Block Camera Control Protocols

Overview of VISCA
In VISCA, the side outputting commands, for example, a computer is called the
controller, while the side receiving the commands, such as a Datavideo camera, is
called the peripheral device. The camera serves as a peripheral device in VISCA. In
VISCA, up to seven peripheral devices like the BRC-300/P can be connected to one
controller using communication conforming to the RS-232C/RS-422 standard. The
parameters of the RS-232C/RS-422 interfaces are listed as follows:

 Communication speed: 38400 bps


 Data bits: 8
 Start bit: 1
 Stop bit: 1
 Non parity
Flow control using XON/XOFF and RTS/CTS, etc., is not supported.
The address of the controller is fixed at 0.

The addresses of peripheral devices are as follows.

When the address of the controller is fixed at 0


The addresses of the peripheral devices are 1, 2, 3… in order, starting from the one
nearest the controller. The address of the peripheral device is set by sending address
commands during the initialization of the network.

When the address of the controller is fixed at 1 through 7


The addresses of the peripheral devices will be set on a pre-selected number. Within
a single system, the same number can be used only once. If an address-switch number
other than 0 is to be used, change the camera address switch to a different number
beforehand.

Set the DTR input (the S output of the controller) of VISCA IN to H when controlling
VISCA equipment from the controller.
Fig. 1 VISCA network configuration

3
PTZ and Block Camera Control Protocols

VISCA Communication Specifications


VISCA Packet Structure
The basic unit of VISCA communication is called a packet (Fig. 2). The first byte of the
packet is called the header and comprises the sender’s and receiver’s addresses. For
example, the header of the packet sent to the camera assigned address 1 from the
controller (address 0) is hexadecimal 81H. The packet sent to the camera assigned
address 2 is 82H. In the command list, as the header is 8X, input the address of the
camera at X. The header of the reply packet from the camera assigned address 1 is
90H. The packet from the camera assigned address 2 is A0H.

Some of the commands for setting camera units can be sent to all devices at one time
(broadcast). In the case of broadcast, the header should be hexadecimal 88H.

When the terminator is FFH, it signifies the end of the packet.

Fig. 2 Packet structure

Note

Fig. 2 shows the packet structure, while Fig. 3 shows the actual waveform. Data flow will take place
with the LSB first.

Fig. 3 Actual waveform for 1 byte

4
PTZ and Block Camera Control Protocols

Timing Chart

As VISCA Command processing can only be carried out one time in a Vertical cycle, it
takes the maximum 1V cycle time for an ACK/Completion to be returned. If the
Command ACK/Completion communication time can be cut shorter than the 1V cycle
time, then every 1V cycle can receive a Command.

From this point, if 2 or more commands in a row are to be sent, wait for the first
command (for normal commands, an ACK or an error message, for query commands,
an Inquiry Packet) to be carried out before sending the next one.

Command and inquiry

 Command
Sends operational commands to the camera.

 Inquiry
Used for inquiring about the current state of the camera.

Command Note
Packet
Inquiry 8X QQ RR … QQ1) =
FF Command/Inquiry
RR2) = Category
Code

5
PTZ and Block Camera Control Protocols

1)
QQ = 01 (Command), 09 (Inquiry)
2)
RR = 00 (Interface), 04 (Camera 1), 06
(Pan/Tilter)
X = 1 to 7: Camera address

Responses for commands and inquiries

 ACK message
Returned by the camera when it receives a command. No ACK message is returned
for inquiries.

 Completion message
Returned by the camera when execution of commands or inquiries is completed. In
the case of inquiry commands, it will contain reply data for the inquiry after the 3 rd
byte of the packet. If the ACK message is omitted, the socket number will contain a
0.

Reply Note
Packet
Ack X0 4Y FF Y = socket
number
Completion X0 5Y FF Y = socket
(Commands) number
Completion X0 5Y … FF Y = socket
(Inquiries) number
X = 9 to F: camera address + 8

 Error message
When a command or inquiry command could not be executed or failed, an error
message is returned.

Error Description
Packet
X0 6Y 01 FF Message length error
X0 6Y 02 FF Syntax error
X0 6Y 03 FF Command buffer full
X0 6Y 04 FF Command cancelled
X0 6Y 05 FF No socket (to be cancelled)
X0 6Y 41 FF Command not executable
6
PTZ and Block Camera Control Protocols

X = 9 to F: camera address + 8, Y = socket


number
Socket number = 1 (normal)

Socket number

When command messages are sent to the camera, it is normal to send the next
command message after waiting for the completion message or error message to
return.

As the completion message or error message also has a socket number, it indicates
which command has ended.

The ACK message is not returned for these commands and inquiries, and only the
completion message of socket number 0 is returned.

VISCA Device Setting Command

Before starting control of the camera, be sure to send the Address command and the
IF_Clear command using the broadcast function.

VISCA interface command

 IF_Clear
Clears the command buffers in the camera and cancels the command currently being
executed.

Command Reply Note


Packet Packet
IF_Clear 8X 01 00 01 FF X0 50 FF
IF_Clear 88 01 00 01 FF 88 01 00 01
(broadcast) FF
X = 1 to 7: camera address (For inquiry packet)
X = 9 to F: camera address + 8 (For reply packet)

VISCA Command/ACK Protocol

Command Command Reply Comments


Message Message
General 81 01 04 38 90 41 FF (ACK) Returns ACK
Command 02 FF 90 51 FF when a
(Example) (Completion) command has
7
PTZ and Block Camera Control Protocols

90 42 FF 90 been accepted,
52 FF and Completion
when a
command has
been executed.
81 01 04 38 90 60 02 FF Accepted a
FF (Syntax Error) command which
(Example) is not supported
or a command
lacking
parameters
81 01 04 38 90 60 03 FF There are two
02 FF (Command commands
(Example) Buffer Full) currently being
executed, and
the command
could not be
accepted.
81 01 04 08 90 61 41 FF Could not
02 FF (Command execute the
(Example) Not command in the
Executable) current mode.
90 62 41 FF
Inquiry 81 09 04 38 90 50 02 FF ACK is not
Command FF (Completion) returned for the
(Example) inquiry
command.
81 09 05 38 90 60 02 FF Accepted an
FF (Syntax Error) incompatible
(Example) command.
Address 88 30 01 FF 88 30 02 FF Returned the
Set device address
to +1.*
IF_Clear 88 01 00 01 88 01 00 01 FF Returned the
(Broadcast) FF same command.

8
PTZ and Block Camera Control Protocols

IF_Clear 8x 01 00 01 z0 50 FF ACK is not


(For x) FF (Completion) returned for this
command.
*When the address-switch is fixed at 0, the value x in 88 30 0x FF will be
indeterminate.

Do not transmit the command (except Address Set, IF_Clear, CAM_POWER), when
menu panel shows on the screen. In that case, clear the menu panel first using
CAM_Menu Command, and then proceed.

VISCA Camera-Issued Messages

ACK/Completion Messages

Command Command Comments


Message
ACK z0 4y FF Returned when the
(y: Socket No.) command is accepted
Completion z0 5y FF Returned when the
(y: Socket No.) command has been
executed
z = Device address + 8

Error Messages

Command Command Comments


Messages
Syntax Error z0 60 02 FF Returned when the
command format is
different or when a
command with illegal
command parameters is
accepted.
Command z0 60 03 FF Indicates that two sockets
Buffer Full are already being used
(executing two commands)
and the command could
not be accepted when
received.
9
PTZ and Block Camera Control Protocols

No Socket z0 6y 05 FF Returned when no


(y: Socket No.) command is executed in a
socket specified by the
cancel command, or when
an invalid socket number is
specified.
Command Not z0 6y 41 FF Returned when a
Executable (y: Socket No.) command cannot be
executed due to current
conditions. For example,
when commands
controlling the focus
manually are received
during auto focus.

PTZ and Block Camera Commands

PTZ and Block Camera General Command List

Command Set Command Command Packet Comments


AddressSet Broadcast 88 30 01 FF Address Set
IF_Clear Broadcast 88 01 00 01 FF I/F Clear
CAM_Power On 8x 01 04 00 02 FF Power On/Off
Off 8x 01 04 00 03 FF
CAM_ZOOM Stop 8x 01 04 07 00 FF
Tele (Standard) 8x 01 04 07 02 FF
Wide (Standard) 8x 01 04 07 03 FF
Tele (Variable) 8x 01 04 07 2p FF p (=0: Slow to
7:Fast)
Wide (Variable) 8x 01 04 07 3p FF p (=0: Slow to
7:Fast)
Direct 8x 01 04 47 0p 0q pqrs: Zoom
0r 0s FF Position*
CAM_Focus Stop 8x 01 04 08 00 FF
Far (Standard) 8x 01 04 08 02 FF
Near (Standard) 8x 01 04 08 03 FF
Direct 8x 01 04 48 0p 0q pqrs: Focus
0r 0s FF Position*
10
PTZ and Block Camera Control Protocols

Auto Focus 8x 01 04 38 02 FF AF ON/OFF


Manual Focus 8x 01 04 38 03 FF
One Push 8x 01 04 18 01 FF One Push AF
Trigger Trigger
CAM_WB Auto 8x 01 04 35 00 FF Normal Auto
Indoor 8x 01 04 35 01 FF Indoor Mode
Outdoor 8x 01 04 35 02 FF Outdoor Mode
One Push WB 8x 01 04 35 03 FF One Push WB
Mode
Manual 8x 01 04 35 05 FF Manual Control
Mode
One Push 8x 01 04 10 05 FF One Push WB
Trigger Trigger
CAM_RGain Reset 8x 01 04 03 00 FF Default R Gain
setting
Up 8x 01 04 03 02 FF
Down 8x 01 04 03 03 FF
Direct 8x 01 04 43 00 00 R Gain Direct pq
0p 0q FF (=00 to FF)
CAM_BGain Reset 8x 01 04 04 00 FF Default B Gain
setting
Up 8x 01 04 04 02 FF
Down 8x 01 04 04 03 FF
Direct 8x 01 04 44 00 00 B Gain Direct pq
0p 0q FF (=00 to FF)
CAM_AE Full Auto 8x 01 04 39 00 FF Automatic
exposure mode
Manual 8x 01 04 39 03 FF Manual control
mode
Shutter Priority 8x 01 04 39 0A FF Shutter priority
automatic
exposure mode
Iris Priority 8x 01 04 39 0B FF Iris priority
automatic
exposure mode

11
PTZ and Block Camera Control Protocols

Bright 8x 01 04 39 0D FF Bright mode


(Manual)
CAM_Shutter Reset 8x 01 04 0A 00 FF Default Shutter
setting
Up 8x 01 04 0A 02 FF
Down 8x 01 04 0A 03 FF
CAM_Iris Reset 8x 01 04 0B 00 FF Default Iris
Setting
Up 8x 01 04 0B 02 FF
Down 8x 01 04 0B 03 FF
Direct 8x 01 04 4B 00 00 pq: Iris Position*
0p 0q FF
CAM_Gain Reset 8x 01 04 0C 00 FF Default Gain
setting
Up 8x 01 04 0C 02 FF
Down 8x 01 04 0C 03 FF
Direct 8x 01 04 4C 00 00 pq: Iris Position*
0p 0q FF
CAM_Backlight On 8x 01 04 33 02 FF Back Light
Off 8x 01 04 33 03 FF Compensation
ON/OFF
PTZ_Position Reset 8x 01 04 3F 00 0p Memory Number
FF p (=0 to 50)
Set 8x 01 04 3F 01 0p Memory Number
FF p (=0 to 50)
Recall 8x 01 04 3F 02 0p Memory Number
FF p (=0 to 50)
CAM_Menu On 8x 01 06 06 02 FF Menu ON
Off 8x 01 06 06 03 FF Menu OFF
Pan-tilt Drive Up 8x 01 06 01 VV PanSpeed VV
WW 03 01 FF (=01:Slow to
Down 8x 01 06 01 VV 12h:Fast)
WW 03 02 FF TiltSpeed WW
Left 8x 01 06 01 VV (=01:Slow to
WW 01 03 FF 12h:Fast)

12
PTZ and Block Camera Control Protocols

Right 8x 01 06 01 VV
WW 02 03 FF
UpLeft 8x 01 06 01 VV
WW 01 01 FF
UpRight 8x 01 06 01 VV
WW 02 01 FF
DownLeft 8x 01 06 01 VV
WW 01 02 FF
DownRight 8x 01 06 01 VV
WW 02 02 FF
Stop 8x 01 06 01 VV
WW 03 03 FF
AbsolutePosition 8x 01 06 02 VV 00 Speed VV (=01H:
0p 0q 0r 0s 0t 0a Slow to 12H:Fast)
0b 0c 0d FF pqrst: Pan
Position*
ZZZZ: Tilt
Position*
RelativePosition 8x 01 06 03 VV 00 Speed VV (=01:
0Y 0Y 0Y 0Y 0Y 0Z Slow to 12h:Fast)
0Z 0Z 0Z FF YYYYY: Pan
Position*
ZZZZ: Tilt
Position*
Home 8x 01 06 04 FF
Reset 8x 01 06 05 FF
CAM_ImgFlip On 8x 01 04 66 02 FF
Off 8x 01 04 66 03 FF
Cam_PanReverse On 8x 01 7E 01 06 00
01 FF
Off 8x 01 7E 01 06 00
00 FF
Cam_TiltReverse On 8x 01 7E 01 09 00
01 FF
Off 8x 01 7E 01 09 00
00 FF

13
PTZ and Block Camera Control Protocols

Cam_Tally On 8x 01 7E 01 0A 00 When Power is


02 FF on, return to off.
Off 8x 01 7E 01 0A 00
03 FF
Cam_Dual Tally Red Tally & 8x 01 7E 01 0A 00 a=2= Red Tally on
Green Tally 0a 0b FF a=3=Red Tally off
b=2=Green Tally
on
b=3=Green Tally
off
Cam_PT_M_Speed Preset PT Speed 8x 01 7E 01 0B 0p p: Memory
qr FF number (=0 to
50)
qr: Speed (=01 to
12h:fast)
Cam Video Mode Switch Video 8x 01 04 24 72 xx
Mode FF xx: Resolution
and framerate
01=1080i59.94,
04=1080i50,
06=1080p29.97,
08=1080p25
09=720p59.94,
0Ch=720p50,
13h=1080p59.94,
14h=1080p50
1Dh=2160p29.94,
1Eh=2160p25
*See VISCA Command Setting Values

PTZ and Block Camera Inquiry Command List

Inquiry Command Command Inquiry Comments


Packet Packet
CAM_PowerInq 8x 09 04 y0 50 02 FF On
00 FF y0 50 03 FF Off (Standby)

14
PTZ and Block Camera Control Protocols

CAM_ZoomPosInq 8x 09 04 y0 50 0p 0q pqrs: Zoom Position


47 FF 0r 0s FF
CAM_FocusModeInq 8x 09 04 y0 50 02 FF Auto Focus
38 FF y0 50 03 FF Manual Focus
CAM_FocusPosInq 8x 09 04 y0 50 0p 0q pqrs: Focus Position
48 FF 0r 0s FF
CAM_WBModeInq 8x 09 04 y0 50 00 FF Auto
35 FF y0 50 01 FF Indoor
y0 50 02 FF Outdoor
y0 50 03 FF One Push WB
y0 50 05 FF Manual
CAM_RGainInq 8x 09 04 y0 50 00 00 pq: R Gain
43 FF 0p 0q FF
CAM_BGainInq 8x 09 04 y0 50 00 00 pq: B Gain
44 FF 0p 0q FF
CAM_AEModeInq 8x 09 04 y0 50 00 FF Full Auto
39 FF y0 50 03 FF Manual
y0 50 0A FF Shutter Priority
y0 50 0B FF Iris Priority
y0 50 0D FF Bright
CAM_ShutterPosInq 8x 09 04 y0 50 00 00 pq: Shutter Position
4A FF 0p 0q FF
CAM_IrisPosInq 8x 09 04 y0 50 00 00 pq: Iris Position
4B FF 0p 0q FF
CAM_GainPosInq 8x 09 04 y0 50 00 00 pq: Gain Position
4C FF 0p 0q FF
CAM_BackLightModeInq 8x 09 04 y0 50 02 FF On
33 FF y0 50 03 FF Off
CAM_MemoryInq 8x 09 04 y0 50 pp FF pp: Memory number for
3F FF PTZ last operated*
CAM_MENUInq 8x 09 06 y0 50 02 FF On
06 FF y0 50 03 FF Off
CAM_VersionInq 8x 09 00 y0 50 mn pq mnpq: Model Code
02 FF 3x 3x 3x 3x BC-80: 00 82
3y 3y 3y 3z BC-80T: 00 82
3z 3z 3z FF BC-200: 02 02

15
PTZ and Block Camera Control Protocols

BC-200T: 02 02
PTC-150: 01 50
PTC-150T: 01 50
PTC-200: 02 00
PTC-200T: 02 00
xx.xx = MCPU version,
yyy = FPGA version,
zz.zz = Motor CTL version
CAM_ImgFlipInq 8x 09 04 y0 50 02 FF On
66 FF y0 50 03 FF Off
CAM_PanReverseInq 8x 09 7E y0 50 01 FF On
01 06 FF y0 50 00 FF Off
CAM_TiltReverseInq 8x 09 7E y0 50 01 FF On
01 09 FF y0 50 00 FF Off
PanTilt_Status 8x 09 06 y0 50 pq rs pqrs: PanTilt Status
10 FF FF
PanTilt_Max_Speed 8x 09 06 y0 50 pq rs pq: Pan Max Speed, rs:
11 FF FF Tilt Max Speed
PanTilt_Position 8x 09 06 y0 50 0p 0q pqrst: Pan Position (*)
12 FF 0r 0s 0t 0a abcd: Tilt Position (**)
0b 0c 0d 0z zzzz: Zoom Position (***)
0z 0z 0z FF (*)Pan Position “pqrst”:
(center) 0 degree=
00000H, 90 degree =
06400H, 135 degree =
09600H, -90 degree =
F9C00H,
(**)Tilt Position “abcd”
(center) 0 degree =
0000H, 45 degree =
3200H, 90 degree =
6400H, -15 degree =
EF56h.
(***) Zoom Position
0000H = Zoom ratio1
(wide), 2A1DH = Zoom
ratio 5, 3486H = Zoom
16
PTZ and Block Camera Control Protocols

ratio 10, 3D60H = Zoom


ratio 20, 4000H = Zoom
ratio 30 (tele)
Tally 8x 09 7E y0 50 02 FF On
01 0A FF y0 50 03 FF Off
PanTilt_Memory_Speed 8x 09 7E y0 50 0q FF p: Preset No. 0 - 50, qq:
01 0B 0p Speed 1 - 18 (h)
FF
System Status 8x 09 7E x0 50 aa bb aa:
7E 70 FF cc dd ee ff gg bit0 = 1/0 =power on/off
hh ii jj kk ll bit1 = color-bar on/off,
FF bit2/3 = tally on/off
bit4 =1/0 = setting menu
on/off

bb:
bit5~bit0=video format
(Ref. to command 24)

cc: WB mode
00 = auto,
01 = indoor,
02 = outdoor(5600K),
03 = one push WB,
04 = ATW,
05 = manual ,
08 = lamp

dd: R gain H = bit 0~bit 3


ee: R gain L = bit 0~bit 3
ff: B gain H = bit 0~bit 3
gg: B gain L = bit 0~bit 3

hh: Auto focus mode


2 = auto,
3 = manual mode

17
PTZ and Block Camera Control Protocols

ii: IRIS mode:


0 = auto ,
3 = manual mode

jj: AGC mode:


0 = AGC off (manual
gain) ,
1~ = AGC mode level

kk: Video flip, Pan


Direction & Tilt Direction
bit 0 = Pan Direction
Reverse,
bit 1 = Tilt Direction
Reverse
bit 4 = Video Horizontal
Reverse,
bit 5 = Video Vertical
Reverse

ll: PTZ speed range


3 = FAST,
2 = Middle,
1 = Slow
*See VISCA Command Setting Values

18
PTZ and Block Camera Control Protocols

Supported Camera Mandatory Functions

BC-80 BC-80T BC-200 BC-200T PTC-150 PTC-150T PTC-200 PTC-200T


White Balance Yes Yes Yes Yes Yes Yes Yes Yes
FOCUS Yes Yes Yes Yes Yes Yes Yes Yes
IRIS Yes Yes Yes Yes Yes Yes Yes Yes
Shutter Speed Yes Yes Yes Yes Yes Yes Yes Yes
Pan N/A N/A N/A N/A Yes Yes Yes Yes
Tilt N/A N/A N/A N/A Yes Yes Yes Yes
Zoom Yes Yes Yes Yes Yes Yes Yes Yes
Pan Speed N/A N/A N/A N/A Yes Yes Yes Yes
Tilt Speed N/A N/A N/A N/A Yes Yes Yes Yes
Zoom Speed Yes Yes Yes Yes Yes Yes Yes Yes
Save Preset Yes Yes Yes Yes Yes Yes Yes Yes
Recall Preset Yes Yes Yes Yes Yes Yes Yes Yes

Revision History

V1.6: Added supported models, added supported camera mandatory functions.

V1.7: Revised the absolute positions, PTZ position. Added Dual color tally.

19

You might also like