我开始用WinCC 6.2 SP2亚洲版做了运行报表的按自定义输入时间段查询历史数据,一切OK,但因客户方采用的是6.2 SP3版的WinCC,安装SP3版打开并运行之后,发现不能查询报表历史记录了,按钮脚本代码都没有改动,
另外,趋势图跟报警记录按自定义输入时间段查询都是好的,就报表不能查询,
相关的脚本如下:
SetPropWord("Report.PDL","控件1","Index",0);
SetPropBOOL("Report.PDL","控件1","Online",FALSE);
SetPropBOOL("Report.PDL","控件1","TimeRange",FALSE);
SetPropBOOL("Report.PDL","控件1","Activate",FALSE);
SetPropChar("Report.PDL","控件1","BeginTime",GetTagChar("Local_Report_Select_start"));
SetPropChar("Report.PDL","控件1","EndTime",GetTagChar("Local_Report_Select_stop"));
SetPropWord("Report.PDL","控件1","Index",1);
SetPropBOOL("Report.PDL","控件1","Online",FALSE);
SetPropBOOL("Report.PDL","控件1","TimeRange",FALSE);
SetPropBOOL("Report.PDL","控件1","Activate",FALSE);
SetPropChar("Report.PDL","控件1","BeginTime",GetTagChar("Local_Report_Select_start"));
SetPropChar("Report.PDL","控件1","EndTime",GetTagChar("Local_Report_Select_stop"));
SetPropWord("Report.PDL","控件1","Index",2); //返回类型:BOOL
SetPropBOOL("Report.PDL","控件1","Online",FALSE);
SetPropBOOL("Report.PDL","控件1","TimeRange",FALSE);
SetPropBOOL("Report.PDL","控件1","Activate",FALSE);
SetPropChar("Report.PDL","控件1","BeginTime",GetTagChar("Local_Report_Select_start"));
SetPropChar("Report.PDL","控件1","EndTime",GetTagChar("Local_Report_Select_stop"));
SetPropWord("Report.PDL","控件1","Index",3); //返回类型:BOOL
SetPropBOOL("Report.PDL","控件1","Online",FALSE);
SetPropBOOL("Report.PDL","控件1","TimeRange",FALSE);
SetPropBOOL("Report.PDL","控件1","Activate",FALSE);
SetPropChar("Report.PDL","控件1","BeginTime",GetTagChar("Local_Report_Select_start"));
SetPropChar("Report.PDL","控件1","EndTime",GetTagChar("Local_Report_Select_stop"));
//激活趋势控件处的 BeginTime 和 EndTime
SetPropBOOL("Report.PDL","控件1","Activate",TRUE);
请专家予以诊断,谢谢!
问题补充:
完成项目移植之后,问题依然存在,
甚至,我在WinCC 6.2 SP3下新建一个项目,唯独报表控件还是不能自定义查询,
SP3的软件我之前已经从两个不同地方拷贝来安装文件分别安装,都有这个问题
最佳答案
项目到高版本wincc后,首先需要做项目移植,如果不做项目移植,可能会导致wincc控件不能正常工作,现移植一下看看,确定控件工作正常,如果还是不行再检查脚本
提问者对于答案的评价:
关于按自定义时间查询的问题已解决,在6.2 SP3版的WinCC中,报表控件的查询要操作控件的Command属性,在设置完其他属性之后,将Command属性设置为"Reload"即可,"Activate"属性可以不管,
但在SP2版不需要操作这个Command属性就能完成查询,
不过又发现一个新问题:执行查询出来的历史数据,除了第一列正常,其后2、3、4、列的数字都带一根横线,似乎是数据无效的意思,还不知道是什么原因引起的这个现象,继续奋斗吧,
多谢专家提醒我检查脚本……
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc263879.html