现有很多趋势,并设置了脚本按钮,按下按钮使一条曲线可以转为按钮关联的趋势曲线。
在同一控件中想再添加一条曲线,也可以由按钮控制曲线转化成想要的趋势。目的是为了在诸多趋势中取两条趋势作对比。请问可以实现吗?
参考了 GOGO90学长的提问及脚本
SetPropWord(lpszPictureName,"Control1","TrendIndex",0);
SetPropChar(lpszPictureName,"Control1","TrendTagName","TestArchive\\testvar2");
最佳答案
SetPropWord(lpszPictureName,"Control1","TrendIndex",0); //把这里的0该成其他的数值,
SetPropChar(lpszPictureName,"Control1","TrendTagName","TestArchive\\testvar2");//这里的记录改成其他的记录,就行了:
SetPropWord(lpszPictureName,"Control1","TrendIndex",0);
SetPropChar(lpszPictureName,"Control1","TrendTagName","TestArchive\\testvar2");
SetPropWord(lpszPictureName,"Control1","TrendIndex",1);
SetPropChar(lpszPictureName,"Control1","TrendTagName","TestArchive\\testvar3");
SetPropWord(lpszPictureName,"Control1","TrendIndex",2);
SetPropChar(lpszPictureName,"Control1","TrendTagName","TestArchive\\testvar1");
SetPropWord(lpszPictureName,"Control1","TrendIndex",3);
SetPropChar(lpszPictureName,"Control1","TrendTagName","TestArchive\\testvar4");
这样就显示了4条曲线了。
提问者对于答案的评价:
谢谢!
原创文章,作者:ximenziask,如若转载,请注明出处:https://www.zhaoplc.com/plc359505.html