| [概述] 这个演示项目展示了如何使用宏来编写Pelco-D协议,
 以及如何使用自由协议驱动程序来控制速度半球摄像机。
 注此功能仅适用于支持视频输入对象的X系列HMI。
 
 维纶通触摸屏相机监控应用实例   
 附件为cmp压缩格式,请用编程软件解压缩后使用。
 
 [操作]
 屏幕上的按钮用于上下左右移动摄像机镜头。
 或者放大/缩小。
 
 维纶通触摸屏相机监控应用实例   
 触摸图像显示区也可以移动透镜。
 
 维纶通触摸屏相机监控应用实例   按区域A,镜头将移到左上角。
 按区域B,镜头将向上移动。
 按区域C,镜头将移到右上角。
 按区域D,镜头将向左移动。
 按区域E,镜头将向右移动。
 按区域F,镜头将移到左下方。
 按区域G,镜头将向下移动。
 按区域H,镜头将移到右下方。
 
 2。设置屏幕
 在项目文件中设置此功能,如下所示。
 2-1在编辑区,点击“系统参数”。
 
 维纶通触摸屏相机监控应用实例   
 2-2单击[设置],出现“设备属性”对话框。
 在PLC类型中选择【自由协议】驱动程序,在PLC I/F中选择【RS485 2W】。
 
 维纶通触摸屏相机监控应用实例   
 2-3单击[设置],出现“COM端口设置”对话框。
 设置参数,然后单击[确定]退出。
 
 维纶通触摸屏相机监控应用实例   
 2-4为Pelco-D协议编写宏以控制摄像机。
 
 维纶通触摸屏相机监控应用实例   
 ID:001 JOG RIGHT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x02,0x06,0x00,0x09}
 unsigned char stop[7]={0xFF,0x01,0x00,0x00,0x00,0x00,0x01}
 
 OUTPORT(send[0], "Free Protocol", 7)
 DELAY(20)
 OUTPORT(stop[0], "Free Protocol", 7)
 
 end macro_command
 
 ID:002 MOVE RIGHT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x02,0x0A,0x00,0x0D}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:003 STOP
 macro_command main()
 unsigned char stop[7]={0xFF,0x01,0x00,0x00,0x00,0x00,0x01}
 OUTPORT(stop[0], "Free Protocol", 7)
 end macro_command
 
 ID:004 MOVE LEFT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x04,0x0A,0x00,0x0F}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:005 JOG LEFT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x04,0x06,0x00,0x0B}
 unsigned char stop[7]={0xFF,0x01,0x00,0x00,0x00,0x00,0x01}
 
 OUTPORT(send[0], "Free Protocol", 7)
 DELAY(20)
 OUTPORT(stop[0], "Free Protocol", 7)
 
 end macro_command
 
 ID:006 JOG UP
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x08,0x00,0x0A,0x13}
 unsigned char stop[7]={0xFF,0x01,0x00,0x00,0x00,0x00,0x01}
 
 OUTPORT(send[0], "Free Protocol", 7)
 DELAY(20)
 OUTPORT(stop[0], "Free Protocol", 7)
 
 end macro_command
 ID:007 JOG DOWN
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x10,0x00,0x0A,0x1B}
 unsigned char stop[7]={0xFF,0x01,0x00,0x00,0x00,0x00,0x01}
 
 OUTPORT(send[0], "Free Protocol", 7)
 DELAY(20)
 OUTPORT(stop[0], "Free Protocol", 7)
 
 end macro_command
 
 MOVE UP
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x08,0x00,0x0A,0x13}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:009 MOVE DOWN
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x10,0x00,0x0A,0x1B}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:010 MOVE UP LEFT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x0C,0x0A,0x0A,0x21}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:011 MOVE UP RIGHT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x0A,0x0A,0x0A,0x1F}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:012 ZOOM IN
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x20,0x00,0x00,0x21}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:013 ZOOM OUT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x40,0x00,0x00,0x41}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:014 MOVE DOWN RIGHT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x12,0x0A,0x0A,0x27}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:015 MOVE DOWN LEFT
 macro_command main()
 unsigned char send[7]={0xFF,0x01,0x00,0x14,0x0A,0x0A,0x29}
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:016 SET PRESET
 macro_command main()
 short area, checksum
 unsigned char send[7]={0xFF,0x01,0x00,0x03,0x00,0x01,0x05}
 GetData(area, "Local HMI", LW, 20, 1)
 send[5]=area
 ADDSUM(send[1], send[6], 5)
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 ID:017 GOTO PRESET
 macro_command main()
 short area, checksum
 unsigned char send[7]={0xFF,0x01,0x00,0x07,0x00,0x01,0x09}
 GetData(area, "Local HMI", LW, 20, 1)
 send[5]=area
 ADDSUM(send[1], send[6], 5)
 OUTPORT(send[0], "Free Protocol", 7)
 end macro_command
 
 2-5设置用于触发宏的PLC控制对象。
 
 维纶通触摸屏相机监控应用实例   
 2-6在对象中创建视频。
 在[输入通道]中设置“1”
 编码格式:NTSC
 在[使用捕获功能]中设置“lb 0”
 [记录时间]中设置前进后退“1”秒。
 
 维纶通触摸屏相机监控应用实例   
 2-7设置4个功能键对象执行宏id:001、id:005、id:006,
 ID:007
 [FK_0]第一个功能键,选择[执行宏ID:001]然后转到[形状]选项卡选择图片,
 如下所示。
 
 维纶通触摸屏相机监控应用实例   
 更多操作过程,请下载附件实例学习。
 
 
 |