VISCA control protocol
VISCA是Sony 公司設計用來控制相機的協議,一般通過RS232來通訊。以下先介紹幾個專有名詞定義
- ACK message
The signal from the camera to the controller returns acknowledge command execution, information for inquiry or error message, etc.
即相機傳回的訊號。 - Address
The address assigned automatically by the address set command. The camera will be assigned from 1 to 7. The address of the controller is fixed to 0.
即相機被分配 port COM 0~7。 - Packet
Comprised by Header (1 byte), Message (max. 14 bytes), and Terminator (1 byte; fixed FFH). Fundamental Unit of the communication between controller and cameras.
即相機與控制器之間的通訊基本單元。 - Socket
Command buffer memories prepared by camera to accept more than one commands. The number of the sockets are two.
Communication protocol
Communication from the controller
命令通訊的基本單元稱為包(Packet)。一個包的長度為3到16位元組(bytes),由頭部、訊息體(message) 和結束符(terminator)三部分組成。
命令包的第一個位元組稱為命令頭,高半位元組由1 (最高位,固定為1)和傳送方(控制者)地址(地址一般為0)組成,低半位元組由0和裝置(相機)地址(或稱"編號")組成,從組成格式看,可以外接的相機最多有7臺,如向1號相機發送命令,則命令頭為0x81。
命令包最後一個位元組為終結符號,固定為0xFF。
中間部分位元組稱為訊息體,包含 communication mode (2 bytes), category code (2 bytes) and parameters. The maximum length of the message is 14 bytes.
上述命令可如下:
具體的構造如下:
Commands
從控制器發送命令大部分藏在message。命令包含了control camera (控制命令), to inquire the information (查詢命令) of the camera and the ones for various purposes.
ACK message
ACK message代表從相機回傳的訊息,包含了 camera address (expressed by z and z = address + 8), socket number (y) and terminator.
ACK completion notice, reply, or error reply from the peripheral device to the controller.
以下說明幾個常見發送gneral command 時的 REPLY ACK
- 90 41 FF (ACK) 90 51 FF or 90 42 FF (ACK) 90 52 FF
when a command has been accept or executed - 90 60 02 FF
command syntax error - 90 60 03 FF
command buffer full - 90 61 41 FF or 90 62 41 FF
command not execute
以下是 inquiry command 時的 REPLY ACK
- 90 50 02 FF
complete - 90 60 02 FF
command syntax error
根據以上範例,錯誤ACK可以總結如下
Error messages: