|
|
|
我现在在写pelco P 协议云台的控制程序,主要是232转成485,手头有一份pelco p的协议,但是发过去后云台没有动,我看了一下觉得是它的校验的地方说的有问题,他自己给的例子就和他说的校验对不上Examples:To SET PRESET 32 in the receiver with address 1, the command string (in Hexidecimal) would be: A0 01 00 03 00 20 AF 17 (the last byte is the XOR sum of bytes 2 through 6)To drive receiver with address 2 LEFT at half speed: A0 02 00 04 00 1F AF 19我写过其他很多的云台控制的,都没问题,包括pelco D的协议的也正常。手头上测试的解码器支持pelco d ,p。pelco - D的协议下运行正常,p小就不行,客户使用也这样,所以基本排除硬件错误,我现在就怀疑是不是我拿到的pelco p的协议有问题?有写过的能给看看吗?void CPelcoP9600::PanLeft(int nSpeed){ command[0.gif> = 0xA0; command[1.gif> = m_address; command[2.gif> = 0x00; command[3.gif> = 0x04; if(nSpeed>0x40) nSpeed=0x40; command[4.gif> = nSpeed; command[5.gif> = 0; command[6.gif> = 0xAF; command[7.gif> = command[1.gif>^command[2.gif>^command[3.gif>^command[4.gif>^command[5.gif>; WriteComm(command, 8);} |
|