发布于 2010-06-18 15:13:12
6楼
用下列脚本可以使属性StartTime和EndTime动态化。将该脚本复制到“编辑动作”对话框的编辑域中,并单击“确定”。
//设置Trend1的索引
SetPropWord("NewPdl0.Pdl","Control1","Index",0); //返回类型:BOOL SetPropBOOL("NewPdl0.PDL","Control1","Online",FALSE); SetPropBOOL("NewPdl0.PDL","Control1","TimeRange",FALSE);
SetPropBOOL("NewPdl0.PDL","Control1","Activate",FALSE);
//设置BeginTime参数:dd.mm.yyyy hh:mm:ss
SetPropChar("NewPdl0.PDL","Control1","BeginTime",GetTagChar("strVar_1"));
//设置EndTime参数:dd.mm.yyyy hh:mm:ss
SetPropChar("NewPdl0.PDL","Control1","EndTime",GetTagChar("strVar_2"));
//设置Trend2的索引
SetPropWord("NewPdl0.Pdl","Control1","Index",1); //返回类型:BOOL
SetPropBOOL("NewPdl0.PDL","Control1","Online",FALSE);
SetPropBOOL("NewPdl0.PDL","Control1","TimeRange",FALSE);
SetPropBOOL("NewPdl0.PDL","Control1","Activate",FALSE);
//设置BeginTime参数:dd.mm.yyyy hh:mm:ss
SetPropChar("NewPdl0.PDL","Control1","BeginTime",GetTagChar("strVar_1"));
//设置EndTime参数:dd.mm.yyyy hh:mm:ss
SetPropChar("NewPdl0.PDL","Control1","EndTime",GetTagChar("strVar_2"));
//激活图表控件处的BeginTime和EndTime
SetPropBOOL("NewPdl0.PDL","Control1","Activate",TRUE);
起飞!