Skip to content

Pelco-D ​

References: Pelco PTZ Protocols, D Protocol, Version 5.0.1 (1 April 2008, cited as D 5.0.1) and the Fujifilm SX400 Pelco-D Protocol Specification v1.10.0 (cited as SX400). The Pelco manual may not be redistributed; ask Pelco for a copy. ptzsim module: ptzsim/pelco.py, option --pelco-d [LINK].

Frame and checksum ​

SectionRequirementptzsim
D 5.0.1 1.4, SX400 3.17 bytes: FF addr cmnd1 cmnd2 data1 data2 cksm, serial 8N1yes; the pseudo terminal ignores the baud rate
D 5.0.1 3.1.3checksum = sum of bytes 2–6 modulo 256yes; frames with a wrong checksum are discarded silently
D 5.0.1 4.2address 1–255yes (--pelco-d-address); frames for other addresses are ignored, as on an RS-485 bus

Responses ​

SectionRequirementptzsim
D 5.0.1 4.2, SX400 3.2.1General Response: 4 bytes FF addr alarms cksm; alarms is bit-coded, cksm = checksum of the command plus the alarms byteyes, alarms is always 00 (no alarm inputs), so cksm equals the command checksum: FF 01 00 02 20 00 23 → FF 01 00 23
D 5.0.1 4.1/5.1Extended Response (7 bytes) FF addr 00 resp2 msb lsb cksm for queries; ack/nak for commands a unit may not executeExtended Response for the position queries; ack/nak missing
D 5.0.1 5.1older units send a General Response for any well-formed command, even one they do not understanddeviation: unsupported commands get no reply, so a client sees that ptzsim did not execute them

Standard commands (motion) ​

SectionRequirementptzsim
D 5.0.1 3.1.1cmnd2 bits: 1 right, 2 left, 3 up, 4 down, 5 tele, 6 wide, 7 focus far, bit 0 always 0yes
D 5.0.1 3.1.1cmnd1 bits: 0 focus near, 1 iris open, 2 iris close; bits 3–7 (camera on/off, scan, sense) are not used by newer unitsfocus near yes; iris is acknowledged but not simulated; bits 3–7 are not supported (no reply)
D 5.0.1 3.1.1a set bit starts a function, a cleared bit stops ityes: a drive frame describes the whole motion state
D 5.0.1 3.1.2, SX400 5.1.1opposite directions in one frame (e.g. up + down) are an erroryes: the frame is rejected without a reply
D 5.0.1 3.1.2pan speed 00–3F, turbo 40; tilt speed 00–3F, no turbo; 00 is very slow, not a stopyes: 00 is the slowest speed; every value above 3F (including 40 and FF) is the maximum, for tilt too
D 5.0.1 3.1.1, SX400 4runaway protection: motion stops after about 15 s without a new motion commandyes, 15 s; the timer only stops motion the Pelco drive started

Extended commands ​

SectionCommandptzsim
D 5.0.1 5.2Set Preset 00 03 00 idyes, presets 0–99 shared with VISCA/ONVIF
D 5.0.1 5.3Clear Preset 00 05 00 idyes
D 5.0.1 5.4Go To Preset 00 07 00 id; an invalid preset is ignored, a motion command aborts the moveyes; an unset preset gets no reply
D 5.0.1 5.19, SX400 5.2.1Set Zoom Speed 00 25 00 0..3 (0 slowest, 3 fastest)yes; zoom drives use this speed (default 3)
D 5.0.1 5.20, SX400 5.2.2Set Focus Speed 00 27 00 0..3yes (default 2)
D 5.0.1 5.38–5.40Set Pan/Tilt/Zoom Position 00 4B / 4D / 4F: pan/tilt 0–35999 hundredths of a degree (tilt 0 = horizon, 9000 = down), zoom = magnification / zoom limit × 65535yes; values ≥ 36000 get no reply, positions beyond the end stops are clipped; zoom limit is 20×
D 5.0.1 5.41–5.47Query Pan/Tilt/Zoom Position 00 51 / 53 / 55, responses 59 / 5B / 5D in the same unitsyes

A PTZ camera simulator for testing camera integrations. Released under the MIT License.