Rev 1.8 PTZ and Block Camera Control Protocol JAN 15 th, 2019 Model: BC-80, BC-80T, BC-200, BC-200T, PTC-150, PTC-150T, PTC-200, PTC-200T Datavideo Technologies
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
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/XO 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
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 H, 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
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. Inquiry Command Packet 8X QQ RR Note QQ 1) = Command/Inquiry RR 2) = Category Code 5
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 Y = socket number Completion (Commands) X0 5Y Y = socket number Completion (Inquiries) X0 5Y Y = socket 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 Packet X0 6Y 01 X0 6Y 02 X0 6Y 03 X0 6Y 04 X0 6Y 05 X0 6Y 41 Description Message length error Syntax error Command buffer full Command cancelled No socket (to be cancelled) Command not executable 6
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 Packet Reply Packet IF_Clear 8X 01 00 01 X0 50 IF_Clear 88 01 00 01 88 01 00 01 (broadcast) X = 1 to 7: camera address (For inquiry packet) X = 9 to F: camera address + 8 (For reply packet) Note VISCA Command/ACK Protocol Command Command Reply Comments Message Message General 81 01 04 38 90 41 (ACK) Returns ACK Command 02 90 51 when a (Example) (Completion) command has been accepted, 7
Inquiry Command Address Set IF_Clear (Broadcast) IF_Clear (For x) 90 42 90 and Completion 52 when a command has been executed. 81 01 04 38 (Example) 90 60 02 (Syntax Error) Accepted a command which is not supported or a command lacking parameters 81 01 04 38 02 (Example) 90 60 03 (Command Buffer Full) There are two commands currently being executed, and the command could not be accepted. 81 01 04 08 02 (Example) 90 61 41 (Command Not Executable) 90 62 41 Could not execute the command in the current mode. 81 09 04 38 90 50 02 ACK is not (Completion) returned for the (Example) inquiry command. 81 09 05 38 90 60 02 Accepted an (Syntax Error) incompatible (Example) command. 88 30 01 88 30 02 Returned the device address to +1.* 88 01 00 01 88 01 00 01 Returned the same command. 8x 01 00 01 z0 50 ACK is not (Completion) returned for this command. 8
*When the address-switch is fixed at 0, the value x in 88 30 0x 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 Message ACK z0 4y (y: Socket No.) Completion z0 5y (y: Socket No.) z = Device address + 8 Comments Returned when the command is accepted Returned when the command has been executed Error Messages Command Command Comments Messages Syntax Error z0 60 02 Returned when the command format is different or when a command with illegal command parameters is accepted. Command Buffer Full z0 60 03 Indicates that two sockets are already being used (executing two commands) and the command could not be accepted when received. No Socket z0 6y 05 (y: Socket No.) Returned when no command is executed in a socket specified by the cancel command, or when 9
Command Not Executable z0 6y 41 (y: Socket No.) an invalid socket number is specified. Returned when a 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 Address Set IF_Clear Broadcast 88 01 00 01 I/F Clear CAM_Power On 8x 01 04 00 02 Power On/Off Off 8x 01 04 00 03 CAM_ZOOM Stop 8x 01 04 07 00 Tele (Standard) 8x 01 04 07 02 Wide (Standard) 8x 01 04 07 03 Tele (Variable) 8x 01 04 07 2p p (=0: Slow to 7:Fast) Wide (Variable) 8x 01 04 07 3p p (=0: Slow to 7:Fast) Direct 8x 01 04 47 0p 0q 0r 0s pqrs: Zoom Position* CAM_Focus Stop 8x 01 04 08 00 Far (Standard) 8x 01 04 08 02 Near (Standard) 8x 01 04 08 03 Direct 8x 01 04 48 0p 0q 0r 0s pqrs: Focus Position* Auto Focus 8x 01 04 38 02 AF ON/O Manual Focus 8x 01 04 38 03 One Push Trigger 8x 01 04 18 01 One Push AF Trigger 10
CAM_WB Auto 8x 01 04 35 00 Normal Auto Indoor 8x 01 04 35 01 Indoor Mode Outdoor 8x 01 04 35 02 Outdoor Mode One Push WB 8x 01 04 35 03 One Push WB Mode Manual 8x 01 04 35 05 Manual Control Mode One Push Trigger 8x 01 04 10 05 One Push WB Trigger CAM_RGain Reset 8x 01 04 03 00 Default R Gain setting Up 8x 01 04 03 02 Down 8x 01 04 03 03 Direct 8x 01 04 43 00 00 0p 0q R Gain Direct pq (=00 to ) CAM_BGain Reset 8x 01 04 04 00 Default B Gain setting Up 8x 01 04 04 02 Down 8x 01 04 04 03 Direct 8x 01 04 44 00 00 0p 0q B Gain Direct pq (=00 to ) CAM_AE Full Auto 8x 01 04 39 00 Automatic exposure mode Manual 8x 01 04 39 03 Manual control mode Shutter Priority 8x 01 04 39 0A Shutter priority automatic exposure mode Iris Priority 8x 01 04 39 0B Iris priority automatic exposure mode Bright 8x 01 04 39 0D Bright mode (Manual) CAM_Shutter Reset 8x 01 04 0A 00 Default Shutter setting Up 8x 01 04 0A 02 11
Down 8x 01 04 0A 03 Direct 8x 01 04 4A 00 00 0p 0q pq: Shutter Position CAM_Iris Reset 8x 01 04 0B 00 Default Iris Setting Up 8x 01 04 0B 02 Down 8x 01 04 0B 03 Direct 8x 01 04 4B 00 00 pq: Iris Position* 0p 0q CAM_Gain Reset 8x 01 04 0C 00 Default Gain setting Up 8x 01 04 0C 02 Down 8x 01 04 0C 03 Direct 8x 01 04 4C 00 00 pq: Iris Position* 0p 0q CAM_Backlight On 8x 01 04 33 02 Bacsysk Light Off 8x 01 04 33 03 Compensation ON/O PTZ_Position Reset 8x 01 04 3F 00 0p Memory Number p (=0 to 50) Set 8x 01 04 3F 01 0p Memory Number p (=0 to 50) Recall 8x 01 04 3F 02 0p Memory Number p (=0 to 50) CAM_Menu On 8x 01 06 06 02 Menu ON Off 8x 01 06 06 03 Menu O Pan-tilt Drive Up Down 8x 01 06 01 VV WW 03 01 8x 01 06 01 VV WW 03 02 PanSpeed VV (=01:Slow to 12h:Fast) TiltSpeed WW Left 8x 01 06 01 VV WW 01 03 (=01:Slow to 12h:Fast) Right 8x 01 06 01 VV WW 02 03 UpLeft 8x 01 06 01 VV WW 01 01 12
UpRight 8x 01 06 01 VV WW 02 01 DownLeft 8x 01 06 01 VV WW 01 02 DownRight 8x 01 06 01 VV WW 02 02 Stop 8x 01 06 01 VV WW 03 03 AbsolutePosition 8x 01 06 02 VV 00 0p 0q 0r 0s 0t 0a 0b 0c 0d RelativePosition 8x 01 06 03 VV 00 0X 0X 0X 0X 0X 0Y 0Y 0Y 0Y Home 8x 01 06 04 Reset 8x 01 06 05 CAM_ImgFlip On 8x 01 04 66 02 Off 8x 01 04 66 03 Cam_PanReverse On 8x 01 7E 01 06 00 01 Off 8x 01 7E 01 06 00 00 Cam_TiltReverse On 8x 01 7E 01 09 00 01 Off 8x 01 7E 01 09 00 00 Cam_Tally On 8x 01 7E 01 0A 00 02 Off 8x 01 7E 01 0A 00 03 Speed VV (=01H: Slow to 12H:Fast) pqrst: Pan Position* abcd: Tilt Position* Speed VV (=01: Slow to 12h:Fast) XXXXX: Pan Position* YYYY: Tilt Position* When Power is on, return to off. 13
Cam_PT_M_Speed Preset PT Speed 8x 01 7E 01 0B 0p qr Cam_PT_MAX_Speed P/T MAX speed 8x 01 7E 01 0B 7D limitation qr Cam_PT_SPD_Range P/T speed range 8x 01 7E 01 0B 7E 0p Cam Video Mode Switch Video 8x 01 04 24 72 xx Mode *See VISCA Command Setting Values p: Memory number (=0 to 50) qr: Speed (=01 to 12h:fast) qr: Speed (=01 to 12h:fast) p:speed range 1=slow 2=middle 3=fast 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 PTZ and Block Camera Inquiry Command List Inquiry Command Command Packet CAM_PowerInq 8x 09 04 00 CAM_ZoomPosInq 8x 09 04 47 CAM_FocusModeInq 8x 09 04 38 Inquiry Packet y0 50 02 y0 50 03 y0 50 0p 0q 0r 0s y0 50 02 y0 50 03 Comments On Off (Standby) pqrs: Zoom Position Auto Focus Manual Focus 14
CAM_FocusPosInq 8x 09 04 48 CAM_WBModeInq 8x 09 04 35 CAM_RGainInq 8x 09 04 43 CAM_BGainInq 8x 09 04 44 CAM_AEModeInq 8x 09 04 39 CAM_ShutterPosInq 8x 09 04 4A CAM_IrisPosInq 8x 09 04 4B CAM_GainPosInq 8x 09 04 4C CAM_BackLightModeInq 8x 09 04 33 CAM_MemoryInq 8x 09 04 3F CAM_MENUInq 8x 09 06 06 CAM_VersionInq 8x 09 00 02 y0 50 0p 0q 0r 0s y0 50 00 y0 50 01 y0 50 02 y0 50 03 y0 50 05 y0 50 00 00 0p 0q y0 50 00 00 0p 0q y0 50 00 y0 50 03 y0 50 0A y0 50 0B y0 50 0D y0 50 00 00 0p 0q y0 50 00 00 0p 0q y0 50 00 00 0p 0q y0 50 02 y0 50 03 y0 50 pp y0 50 02 y0 50 03 y0 50 mn pq 3x 3x 3x 3x 3y 3y 3y 3z 3z 3z 3z pqrs: Focus Position Auto Indoor Outdoor One Push WB Manual pq: R Gain pq: B Gain Full Auto Manual Shutter Priority Iris Priority Bright pq: Shutter Position pq: Iris Position pq: Gain Position On Off pp: Memory number for PTZ last operated* On Off mnpq: Model Code BC-80: 00 82 BC-80T: 00 82 BC-200: 02 02 BC-200T: 02 02 PTC-140 : 01 40 PTC-140T :01 41 PTC-150: 01 50 15
PTC-150T: 01 50 PTC-200: 02 00 PTC-200T: 02 00 xx.xx = MCPU version, yyy = FPGA version, zz.zz = Motor CTL version x.x.x.0 = MCPU version, y.y.y = CAMERA version, z.z.z.0 = AF version CAM_ImgFlipInq 8x 09 04 y0 50 02 On 66 y0 50 03 Off CAM_PanReverseInq 8x 09 7E y0 50 01 On 01 06 y0 50 00 Off CAM_TiltReverseInq 8x 09 7E y0 50 01 On 01 09 y0 50 00 Off PanTilt_Status 8x 09 06 y0 50 pq rs pqrs: PanTilt Status 10 PanTilt_Max_Speed 8x 09 06 y0 50 pq rs pq: Pan Max Speed, rs: 11 Tilt Max Speed PanTilt_Position 8x 09 06 y0 50 0p 0q pqrst: Pan Position (*) 12 0r 0s 0t 0a 0b abcd: Tilt Position (**) 0c 0d 0z 0z 0z zzzz: Zoom Position (***) 0z (*)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 16
ratio 5, 3486H = Zoom ratio 10, 3D60H = Zoom ratio 20, 4000H = Zoom ratio 30 (tele) Tally 8x 09 7E y0 50 02 On 01 0A y0 50 03 Off PanTilt_Memory_Speed 8x 09 7E y0 50 0q p: Preset No. 0-50, qq: 01 0B 0p Speed 1-18 (h) System Status 8x 09 7E x0 50 aa bb aa: 7E 70 cc dd ee ff gg bit0 = 1/0 =power on/off hh ii jj kk ll bit1 = color-bar on/off, 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
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 *See VISCA Command Setting Values ll: PTZ speed range 3 = FAST, 2 = Middle, 1 = Slow 18
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. V1.8: Added shutter direct, Cam_PT_MAX_Speed, and Cam_PT_SPD_Range. Revised Relative positions and PanTilt_Position 19