手机网站
网站地图
招生城市
文章
资讯

WinCC实现弹出窗口
时间:2021-10-16 08:56:06 采集:PLC培训,PLC编程培训学校 主题:WinCC实现弹出窗口 浏览:次
用触摸屏搞定窗口的切换,相信对你早就不是个事了。那下一步,我们就通过举例来学习一下如何使用wincc v12专业版实现弹出窗口吧。要求是通过屏幕上的弹出窗口,操作员点击按钮去改变电机、变频器、阀门等的状态。弹出的位置也需要可设可变。
为实现弹出窗口,我们为开始屏幕添加一个屏幕窗口。此时,暂不需要设置属性:
i gave it a visibility animation based on an internal tag (“bshowpopup”). i also gave it direct movement animations based on internal tags (“x_position” and “y_position”).
我给它一个基于内部标签可见性动画(“bshowpopup”)。我也把它直接运动动画基于内部标签(“x_position”和“y_position”)。
i put the actuators in screen windows to take advantage of the tag prefix. the tag prefix is used for the popup and allows for quicker assignment of all of the animations and events associated with the actuator in the screen window.
先制作好执行器的画面,然后把它放置在hmi屏幕窗口中。我把执行器放在屏幕窗口,利用标签前缀。标签前缀用于弹出,可以更快地分配所有的动画和在屏幕窗口执行相关事件。
编写如下的一段c语言脚本,将窗口的属性传递给弹出窗口。
#include "globaldefinitions.h" void onclick(char* screenname, char* objectname, char* propertyname){ activatescreeninscreenwindow ("main", "popup_screen", "motor_popup"); setpropertybyconstant("main", "popup_screen", "tagprefix", getpropchar(getparentscreen(screenname), getparentscreenwindow(screenname), "tagprefix")); settagbyproperty ("@notp::x_position", getparentscreen(screenname), getparentscreenwindow(screenname), "left", hmiwithoutoperatorevent); settagbyproperty ("@notp::y_position", getparentscreen(screenname), getparentscreenwindow(screenname), "top", hmiwithoutoperatorevent); setbit ("@notp::bshowpopup");} 第一个语句取决于正在使用的画面。本句的意思是,弹出窗口已经更新为电机弹出窗口。
the second statement of the script sets the tag prefix of the popup window to use the same tag prefix as the screen window. the function “settagbyproperty” is setting “x_position” without an operator event, with the property “top” (the top edge of the screen window), from the parent screen window in the parent screen.
这个脚本的第二句套弹出式窗口的标记前缀使用相同的标记前缀为纱窗。功能settagbyproperty”设置“x_position”没有运营商的事件,与物业的“顶”(屏幕窗口的顶部边缘),在父母的屏幕窗口的屏幕。
最后一句设置位变量“bshowpopup”,将弹出式窗口可见性设置为真。
如果你使用的是wincc专业版,使用客户机/服务器配置的话,请注意:
确保“bshowpopup”、“x_postion”、和“y_position”这些属性仅在本地触摸屏更新。如果您使用的是客户机/服务器选项,则动画将在所有的触摸屏上起作用,而不仅仅是你在用的那台触摸屏。
WinCC实现弹出窗口