Pelco-D Module
jjames
AMX Sustaining Engineer
Has anyone played with the Pelco-D protocol? I'd assume someone has; is there anything I need to look out for? Anyone willing to share what they have?
Thanks in advance if anyone can help!
Thanks in advance if anyone can help!
Comments
-
This works for me...INTEGER CAM1_COMMANDS[][]=
{
{$FF,$01,$88,$88,$25,$35,$6B} // UP
,{$FF,$01,$88,$90,$25,$35,$73} // DOWN
,{$FF,$01,$88,$84,$35,$25,$67} // LEFT
,{$FF,$01,$88,$82,$35,$25,$65} // RIGHT
,{$FF,$01,$88,$C0,$25,$00,$6E} // TELE Wide
,{$FF,$01,$88,$A0,$25,$00,$4E} // TELE Zoom
,{$FF,$01,$00,$00,$00,$00,$01} // STOP
}
BUTTON_EVENT[dvTP,46] // UP
BUTTON_EVENT[dvTP,47] // DOWN
BUTTON_EVENT[dvTP,48] // LEFT
BUTTON_EVENT[dvTP,49] // RIGHT
BUTTON_EVENT[dvTP,50] // ENTER
BUTTON_EVENT[dvTP,51] // DISPLAY
BUTTON_EVENT[dvTP,52] // GUIDE
BUTTON_EVENT[dvTP,57] // SUBTITLE
{
PUSH:
{
nTP_NUM=GET_LAST(dvTP) // WHICH TP IS THIS?
SWITCH(nSOURCE[nTP_NUM])
{
CASE 271: // Camera
{
IF( BUTTON.INPUT.CHANNEL=50 OR // tele wide and tele zoom need a stop to make press and hold work
BUTTON.INPUT.CHANNEL=51)
{
SEND_STRING dvEquipPelco,"CAM1_COMMANDS[BUTTON.INPUT.CHANNEL-45]"
SEND_STRING dvEquipPelco,"CAM1_COMMANDS[7]"
}
else SEND_STRING dvEquipPelco,"CAM1_COMMANDS[BUTTON.INPUT.CHANNEL-45]"
}
}
}
HOLD[2,REPEAT]:
{
SWITCH(nSOURCE[nTP_NUM])
{
CASE 271:
{
IF( BUTTON.INPUT.CHANNEL=50 OR // tele wide and tele zoom need a stop to make press and hold work
BUTTON.INPUT.CHANNEL=51)
{
SEND_STRING dvEquipPelco,"CAM1_COMMANDS[BUTTON.INPUT.CHANNEL-45]"
SEND_STRING dvEquipPelco,"CAM1_COMMANDS[7]"
}
else SEND_STRING dvEquipPelco,"CAM1_COMMANDS[BUTTON.INPUT.CHANNEL-45]"
}
}
}
RELEASE:
{
SWITCH(nSOURCE[nTP_NUM])
{
CASE 271:
{
SEND_STRING dvEquipPelco,"CAM1_COMMANDS[7]"
}
}
}
}
} -
Gary - thanks!!
Do you need to keep sending a left/right/up/down command in order for it to keep going, or does it only stop when a stop command is issued? Just curious if the HOLD / REPEAT section is needed for it to move continuously. -
From what I remember it will continue to move for a bit, but not forever. Best to continue repeating the command.
I progressively increase the speed the longer the button is held. Makes it nice to get somewhere quick and still have fine control.BUTTON_EVENT[TP2,70] //UP { PUSH: { HOLDTIME=20 PELCO_SEND($00,$08,$00,$14) } HOLD [1,REPEAT]: { HOLDTIME=HOLDTIME+2 IF (HOLDTIME<=63) PELCO_SEND($00,$08,$00,HOLDTIME) ELSE PELCO_SEND($00,$08,$00,$3F) } RELEASE: { PELCO_SEND($00,$00,$00,$00) } }
Kevin D. -
Thanks. Good info before I get started with a module / code block. Gonna be fun, but seems a bit complicated if I wanna do a full module.
-
Parsing was a challenge because there's no set terminator character or delimiter. In order to find the end of the message sent back from the device you'll need to keep track of what command you initially sent to the device. The command string going to the device is formatted as STX, CamAddress, Cmd1, Cmd2, Data1, Data2, Checksum and the length of the response string will vary based on cmd1, cmd2. Besides that, the protocol and the control is very reliable and trouble-free.
--John
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums