--- a/tests/wxHMI/HMI@wxglade_hmi/hmi.wxg Tue Jun 06 13:12:10 2017 +0300
+++ b/tests/wxHMI/HMI@wxglade_hmi/hmi.wxg Tue Jun 06 13:13:57 2017 +0300
@@ -1,9 +1,9 @@
-<!-- generated by wxGlade 0.6.8 on Thu Jun 18 15:19:02 2015 -->
+<!-- generated by wxGlade 0.7.2 on Tue Jun 6 12:26:48 2017 --> -<application path="" name="" class="" option="0" language="python" top_window="wxglade_hmi" encoding="UTF-8" use_gettext="1" overwrite="0" use_new_namespace="1" for_version="2.8" is_template="0" indent_amount="4" indent_symbol="space" source_extension=".cpp" header_extension=".h">
+<application class="" encoding="UTF-8" for_version="2.8" header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" language="python" name="" option="0" overwrite="0" path="..py.py" source_extension=".cpp" top_window="wxglade_hmi" use_gettext="1" use_new_namespace="1"> <object class="Class_wxglade_hmi" name="wxglade_hmi" base="EditFrame">
- <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style>
+ <style>wxDEFAULT_FRAME_STYLE|wxMAXIMIZE</style> <object class="wxFlexGridSizer" name="grid_sizer_1" base="EditFlexGridSizer">
@@ -13,7 +13,7 @@
<object class="sizeritem">
- <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+ <flag>wxALIGN_CENTER</flag> <object class="ThreeDee" name="window_1" base="CustomWidget">
@@ -53,7 +53,7 @@
<object class="wxGridSizer" name="sizer_3" base="EditGridSizer">
<object class="sizerslot" />
@@ -64,6 +64,8 @@
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
+ <object class="sizerslot" /> + <object class="sizerslot" /> @@ -72,26 +74,20 @@
<object class="wxToggleButton" name="DrawTestBt" base="EditToggleButton">
- <label>Please Draw !</label>
+ <label>Please Draw!</label> - <handler event="EVT_TOGGLEBUTTON">SetPLCGlobalVar</handler>
+ <handler event="EVT_TOGGLEBUTTON">SetPLCTestBtnGlobalVar</handler>
- <property name="Name">"DrawTest"</property>
<object class="sizeritem">
- <object class="wxToggleButton" name="DrawTestBt_copy" base="EditToggleButton">
- <label>Please Draw copy !</label>
+ <object class="wxToggleButton" name="DrawTestBt2" base="EditToggleButton"> + <label>Please Draw copy!</label> - <handler event="EVT_TOGGLEBUTTON">SetPLCGlobalVar</handler>
+ <handler event="EVT_TOGGLEBUTTON">SetPLCTestBtn2GlobalVar</handler>
- <property name="Name">"DrawEscher"</property>
--- a/tests/wxHMI/HMI@wxglade_hmi/pyfile.xml Tue Jun 06 13:12:10 2017 +0300
+++ b/tests/wxHMI/HMI@wxglade_hmi/pyfile.xml Tue Jun 06 13:13:57 2017 +0300
@@ -1,134 +1,140 @@
-<?xml version='1.0' encoding='utf-8'?>
-<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
- <variable name="Power_ON" type="BOOL"/>
- <variable name="Power_OFF" type="BOOL"/>
- <variable name="DrawTest" type="BOOL"/>
- <variable name="DrawLogo" type="BOOL"/>
- <variable name="DrawEscher" type="BOOL"/>
- <variable name="Detect_Circle" type="BOOL"/>
- <variable name="XaxisPos" type="INT"/>
- <variable name="YaxisPos" type="INT"/>
- <variable name="ZaxisPos" type="INT"/>
- <variable name="TaxisPos" type="INT"/>
- <variable name="XaxisMinus" type="BOOL"/>
- <variable name="YaxisMinus" type="BOOL"/>
- <variable name="ZaxisMinus" type="BOOL"/>
- <variable name="TaxisMinus" type="BOOL"/>
- <variable name="XaxisPlus" type="BOOL"/>
- <variable name="YaxisPlus" type="BOOL"/>
- <variable name="ZaxisPlus" type="BOOL"/>
- <variable name="TaxisPlus" type="BOOL"/>
-AxisList = ["X","Y","Z","T"]
-PwrButtons = ['Power_ON',
-ActionButtons = ['Detect_Circle',
-class ThreeDee(wx.StaticText):
- def __init__(self, *args, **kwargs):
- self.initialized = False
- kwargs["style"] = wx.ALIGN_CENTRE_HORIZONTAL
- super(ThreeDee, self).__init__(*args, **kwargs)
- self.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD))
- self.positions = [0.]*4
- def UpdatePositions(self, positions):
- self.positions = positions
- ((self.Message +'\n\n') if self.Message else '' )+
- " ".join(["%s %+.2f"%(axis,self.positions[i])
- for i,axis in enumerate(AxisList)]))
-def MakeButtonFunc(window, sizer, btname):
- setattr(PLCGlobals,btname,1)
- setattr(PLCGlobals,btname,0)
- obj = wx.BitmapButton(window, -1, wx.Bitmap('%s.png'%btname))
- sizer.Add(obj, 2, wx.EXPAND, 0)
- obj.Bind(wx.EVT_LEFT_DOWN, ButtonDown)
- obj.Bind(wx.EVT_LEFT_UP, ButtonUp)
- positions = [getattr(PLCGlobals,axname+"axisPos") for axname in AxisList]
- self.window_1.UpdatePositions(positions)
-Class_wxglade_hmi.UpdPos = UpdPos
-#def UpdatePositions(self, event):
-# positions = [getattr(PLCGlobals,axname+"axisPos") for axname in AxisList]
-# self.window_1.UpdatePositions(positions)
-#Class_wxglade_hmi.UpdatePositions = UpdatePositions
-initorig = Class_wxglade_hmi.__init__
-def Init(self,*args,**kargs):
- initorig(self,*args,**kargs)
- sizer = self.GetSizer().GetItem(1).GetSizer().GetItem(0).GetSizer()
- self.main_buttons = map(
- lambda btname: MakeButtonFunc(self, sizer, btname), PwrButtons)
- sizer = self.GetSizer().GetItem(1).GetSizer().GetItem(1).GetSizer()
- self.main_buttons = map(
- lambda btname: MakeButtonFunc(self, sizer, btname), ActionButtons)
- self.axis_buttons = map(
- lambda axis:( MakeButtonFunc(self, sizer, axis+"axisMinus"),
- MakeButtonFunc(self, sizer, axis+"axisPlus")),
- # self.timer = wx.Timer(self, -1)
- # self.Bind(wx.EVT_TIMER, self.UpdatePositions, self.timer)
- # self.ShowFullScreen(True,wx.FULLSCREEN_ALL)
- # wx.CallAfter(self.timer.Start,200)
-Class_wxglade_hmi.__init__ = Init
-def SetPLCGlobalVar(self, evt):
- tglbtname = evt.GetEventObject().GetName()
- setattr(PLCGlobals, tglbtname, evt.GetEventObject().GetValue())
+<?xml version='1.0' encoding='utf-8'?> +<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml"> + <variable name="Power_ON" type="BOOL"/> + <variable name="Power_OFF" type="BOOL"/> + <variable name="DrawTest" type="BOOL"/> + <variable name="DrawLogo" type="BOOL"/> + <variable name="DrawEscher" type="BOOL"/> + <variable name="Detect_Circle" type="BOOL"/> + <variable name="XaxisPos" type="INT"/> + <variable name="YaxisPos" type="INT"/> + <variable name="ZaxisPos" type="INT"/> + <variable name="TaxisPos" type="INT"/> + <variable name="XaxisMinus" type="BOOL"/> + <variable name="YaxisMinus" type="BOOL"/> + <variable name="ZaxisMinus" type="BOOL"/> + <variable name="TaxisMinus" type="BOOL"/> + <variable name="XaxisPlus" type="BOOL"/> + <variable name="YaxisPlus" type="BOOL"/> + <variable name="ZaxisPlus" type="BOOL"/> + <variable name="TaxisPlus" type="BOOL"/> + <variable name="DrawTestBtn" type="BOOL"/> + <variable name="DrawTestBtn2" type="BOOL"/> +AxisList = ["X","Y","Z","T"] +PwrButtons = ['Power_ON', +ActionButtons = ['Detect_Circle', +class ThreeDee(wx.StaticText): + def __init__(self, *args, **kwargs): + self.initialized = False + kwargs["style"] = wx.ALIGN_CENTRE_HORIZONTAL + super(ThreeDee, self).__init__(*args, **kwargs) + self.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD)) + self.positions = [0.]*4 + def UpdatePositions(self, positions): + self.positions = positions + ((self.Message +'\n\n') if self.Message else '' )+ + " ".join(["%s %+.2f"%(axis,self.positions[i]) + for i,axis in enumerate(AxisList)])) +def MakeButtonFunc(window, sizer, btname): + setattr(PLCGlobals,btname,1) + setattr(PLCGlobals,btname,0) + obj = wx.BitmapButton(window, -1, wx.Bitmap('%s.png'%btname)) + sizer.Add(obj, 2, wx.EXPAND, 0) + obj.Bind(wx.EVT_LEFT_DOWN, ButtonDown) + obj.Bind(wx.EVT_LEFT_UP, ButtonUp) + positions = [getattr(PLCGlobals,axname+"axisPos") for axname in AxisList] + self.window_1.UpdatePositions(positions) +Class_wxglade_hmi.UpdPos = UpdPos +#def UpdatePositions(self, event): +# positions = [getattr(PLCGlobals,axname+"axisPos") for axname in AxisList] +# self.window_1.UpdatePositions(positions) +#Class_wxglade_hmi.UpdatePositions = UpdatePositions +initorig = Class_wxglade_hmi.__init__ +def Init(self,*args,**kargs): + initorig(self,*args,**kargs) + sizer = self.GetSizer().GetItem(1).GetSizer().GetItem(0).GetSizer() + self.main_buttons = map( + lambda btname: MakeButtonFunc(self, sizer, btname), PwrButtons) + sizer = self.GetSizer().GetItem(1).GetSizer().GetItem(1).GetSizer() + self.main_buttons = map( + lambda btname: MakeButtonFunc(self, sizer, btname), ActionButtons) + self.axis_buttons = map( + lambda axis:( MakeButtonFunc(self, sizer, axis+"axisMinus"), + MakeButtonFunc(self, sizer, axis+"axisPlus")), + # self.timer = wx.Timer(self, -1) + # self.Bind(wx.EVT_TIMER, self.UpdatePositions, self.timer) + # self.ShowFullScreen(True,wx.FULLSCREEN_ALL) + # wx.CallAfter(self.timer.Start,200) +Class_wxglade_hmi.__init__ = Init +def SetPLCTestBtnGlobalVar(self, evt): + setattr(PLCGlobals, "DrawTestBtn", evt.GetEventObject().GetValue()) +def SetPLCTestBtn2GlobalVar(self, evt): + setattr(PLCGlobals, "DrawTestBtn2", evt.GetEventObject().GetValue()) --- a/tests/wxHMI/plc.xml Tue Jun 06 13:12:10 2017 +0300
+++ b/tests/wxHMI/plc.xml Tue Jun 06 13:13:57 2017 +0300
@@ -1,592 +1,1641 @@
-<?xml version='1.0' encoding='utf-8'?>
-<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
- <fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2012-09-12T23:30:19"/>
- <contentHeader name="Unnamed" modificationDateTime="2015-07-01T22:17:12">
- <pageSize x="1050" y="1485"/>
- <pou name="main" pouType="program">
- <variable name="Power_ON">
- <variable name="Power_OFF">
- <variable name="power">
- <variable name="DrawTest">
- <variable name="DrawLogo">
- <variable name="DrawEscher">
- <variable name="Detect_Circle">
- <variable name="ZaxisPos">
- <inVariable localId="286" executionOrderId="0" height="25" width="65" negated="false">
- <position x="230" y="205"/>
- <relPosition x="65" y="10"/>
- <expression>Power_ON</expression>
- <block localId="287" typeName="RS" instanceName="RS0" executionOrderId="0" height="65" width="45">
- <position x="395" y="190"/>
- <variable formalParameter="S">
- <relPosition x="0" y="30"/>
- <connection refLocalId="286">
- <position x="395" y="220"/>
- <position x="315" y="220"/>
- <position x="315" y="215"/>
- <position x="295" y="215"/>
- <variable formalParameter="R1">
- <relPosition x="0" y="55"/>
- <connection refLocalId="288">
- <position x="395" y="245"/>
- <position x="320" y="245"/>
- <position x="320" y="260"/>
- <position x="310" y="260"/>
- <variable formalParameter="Q1">
- <relPosition x="45" y="30"/>
- <inVariable localId="288" executionOrderId="0" height="25" width="70" negated="false">
- <position x="240" y="250"/>
- <relPosition x="70" y="10"/>
- <expression>Power_OFF</expression>
- <outVariable localId="289" executionOrderId="0" height="25" width="45" negated="false">
- <position x="510" y="220"/>
- <relPosition x="0" y="10"/>
- <connection refLocalId="287" formalParameter="Q1">
- <position x="510" y="230"/>
- <position x="475" y="230"/>
- <position x="475" y="220"/>
- <position x="440" y="220"/>
- <expression>power</expression>
- <inVariable localId="290" executionOrderId="0" height="25" width="60" negated="false">
- <position x="75" y="55"/>
- <relPosition x="60" y="10"/>
- <expression>DrawTest</expression>
- <block localId="292" typeName="ADD" executionOrderId="0" height="65" width="60">
- <position x="350" y="50"/>
- <variable formalParameter="IN1">
- <relPosition x="0" y="30"/>
- <connection refLocalId="291">
- <position x="350" y="80"/>
- <position x="340" y="80"/>
- <position x="340" y="25"/>
- <position x="530" y="25"/>
- <position x="530" y="45"/>
- <position x="520" y="45"/>
- <variable formalParameter="IN2">
- <relPosition x="0" y="55"/>
- <connection refLocalId="293" formalParameter="OUT">
- <position x="350" y="105"/>
- <position x="287" y="105"/>
- <position x="287" y="65"/>
- <position x="225" y="65"/>
- <variable formalParameter="OUT">
- <relPosition x="60" y="30"/>
- <inOutVariable localId="291" executionOrderId="0" height="25" width="55" negatedOut="false" negatedIn="false">
- <position x="465" y="35"/>
- <relPosition x="0" y="10"/>
- <connection refLocalId="292" formalParameter="OUT">
- <position x="465" y="45"/>
- <position x="437" y="45"/>
- <position x="437" y="80"/>
- <position x="410" y="80"/>
- <relPosition x="55" y="10"/>
- <expression>ZaxisPos</expression>
- <block localId="293" typeName="SEL" executionOrderId="0" height="85" width="60">
- <position x="165" y="35"/>
- <variable formalParameter="G">
- <relPosition x="0" y="30"/>
- <connection refLocalId="290">
- <position x="165" y="65"/>
- <position x="135" y="65"/>
- <variable formalParameter="IN0">
- <relPosition x="0" y="50"/>
- <connection refLocalId="295">
- <position x="165" y="85"/>
- <position x="135" y="85"/>
- <position x="135" y="90"/>
- <position x="105" y="90"/>
- <variable formalParameter="IN1">
- <relPosition x="0" y="70"/>
- <connection refLocalId="294">
- <position x="165" y="105"/>
- <position x="135" y="105"/>
- <position x="135" y="115"/>
- <position x="105" y="115"/>
- <variable formalParameter="OUT">
- <relPosition x="60" y="30"/>
- <inVariable localId="294" executionOrderId="0" height="25" width="20" negated="false">
- <position x="85" y="105"/>
- <relPosition x="20" y="10"/>
- <expression>1</expression>
- <inVariable localId="295" executionOrderId="0" height="25" width="20" negated="false">
- <position x="85" y="80"/>
- <relPosition x="20" y="10"/>
- <expression>0</expression>
- <xhtml:p><![CDATA[]]></xhtml:p>
- <pou name="ReadGUIdata" pouType="program">
- <variable name="power">
- <variable name="XaxisPos">
- <variable name="YaxisPos">
- <variable name="ZaxisPos">
- <variable name="TaxisPos">
- <variable name="python_poll0">
- <derived name="python_poll"/>
- <outVariable localId="211" executionOrderId="0" height="25" width="60" negated="false">
- <position x="565" y="195"/>
- <relPosition x="0" y="10"/>
- <connection refLocalId="215">
- <position x="565" y="205"/>
- <position x="370" y="205"/>
- <position x="370" y="195"/>
- <position x="330" y="195"/>
- <expression>XaxisPos</expression>
- <block localId="213" typeName="ADD" executionOrderId="0" height="65" width="60">
- <position x="220" y="295"/>
- <variable formalParameter="IN1">
- <relPosition x="0" y="30"/>
- <connection refLocalId="212">
- <position x="220" y="325"/>
- <position x="210" y="325"/>
- <position x="210" y="270"/>
- <position x="380" y="270"/>
- <position x="380" y="325"/>
- <position x="365" y="325"/>
- <variable formalParameter="IN2">
- <relPosition x="0" y="55"/>
- <connection refLocalId="217" formalParameter="OUT">
- <position x="220" y="350"/>
- <position x="180" y="350"/>
- <variable formalParameter="OUT">
- <relPosition x="60" y="30"/>
- <inOutVariable localId="212" executionOrderId="0" height="25" width="30" negatedOut="false" negatedIn="false">
- <position x="335" y="315"/>
- <relPosition x="0" y="10"/>
- <connection refLocalId="213" formalParameter="OUT">
- <position x="335" y="325"/>
- <position x="280" y="325"/>
- <relPosition x="30" y="10"/>
- <expression>tmp</expression>
- <inVariable localId="214" executionOrderId="0" height="25" width="20" negated="false">
- <position x="65" y="385"/>
- <relPosition x="20" y="10"/>
- <expression>1</expression>
- <inVariable localId="215" executionOrderId="0" height="25" width="30" negated="false">
- <position x="300" y="185"/>
- <relPosition x="30" y="10"/>
- <expression>tmp</expression>
- <outVariable localId="216" executionOrderId="0" height="25" width="60" negated="false">
- <position x="540" y="310"/>
- <relPosition x="0" y="10"/>
- <connection refLocalId="215">
- <position x="540" y="320"/>
- <position x="435" y="320"/>
- <position x="435" y="195"/>
- <position x="330" y="195"/>
- <expression>YaxisPos</expression>
- <block localId="217" typeName="SEL" executionOrderId="0" height="85" width="60">
- <position x="120" y="320"/>
- <variable formalParameter="G">
- <relPosition x="0" y="30"/>
- <connection refLocalId="219">
- <position x="120" y="350"/>
- <position x="97" y="350"/>
- <position x="97" y="345"/>
- <position x="85" y="345"/>
- <variable formalParameter="IN0">
- <relPosition x="0" y="50"/>
- <connection refLocalId="218">
- <position x="120" y="370"/>
- <position x="85" y="370"/>
- <variable formalParameter="IN1">
- <relPosition x="0" y="70"/>
- <connection refLocalId="214">
- <position x="120" y="390"/>
- <position x="102" y="390"/>
- <position x="102" y="395"/>
- <position x="85" y="395"/>
- <variable formalParameter="OUT">
- <relPosition x="60" y="30"/>
- <inVariable localId="218" executionOrderId="0" height="25" width="20" negated="false">
- <position x="65" y="360"/>
- <relPosition x="20" y="10"/>
- <expression>0</expression>
- <inVariable localId="219" executionOrderId="0" height="25" width="45" negated="false">
- <position x="40" y="335"/>
- <relPosition x="45" y="10"/>
- <expression>power</expression>
- <block localId="220" typeName="python_poll" instanceName="python_poll0" executionOrderId="0" height="65" width="85">
- <position x="640" y="370"/>
- <variable formalParameter="TRIG">
- <relPosition x="0" y="30"/>
- <connection refLocalId="221">
- <position x="640" y="400"/>
- <position x="595" y="400"/>
- <variable formalParameter="CODE">
- <relPosition x="0" y="55"/>
- <connection refLocalId="222">
- <position x="640" y="425"/>
- <position x="590" y="425"/>
- <variable formalParameter="ACK">
- <relPosition x="85" y="30"/>
- <variable formalParameter="RESULT">
- <relPosition x="85" y="55"/>
- <inVariable localId="221" executionOrderId="0" height="25" width="75" negated="false">
- <position x="520" y="390"/>
- <relPosition x="75" y="10"/>
- <expression>BOOL#TRUE</expression>
- <inVariable localId="222" executionOrderId="0" height="25" width="135" negated="false">
- <position x="455" y="415"/>
- <relPosition x="135" y="10"/>
- <expression>'wxglade_hmi.UpdPos()'</expression>
- <xhtml:p><![CDATA[]]></xhtml:p>
- <pou name="Declarations" pouType="program">
- <variable name="LocalVar0">
- <variable name="LocalVar1">
- <inVariable localId="127" executionOrderId="0" height="25" width="60" negated="false">
- <position x="235" y="205"/>
- <relPosition x="60" y="10"/>
- <expression>LocalVar0</expression>
- <outVariable localId="128" executionOrderId="0" height="25" width="60" negated="false">
- <position x="450" y="190"/>
- <relPosition x="0" y="10"/>
- <connection refLocalId="127">
- <position x="450" y="200"/>
- <position x="372" y="200"/>
- <position x="372" y="215"/>
- <position x="295" y="215"/>
- <expression>LocalVar1</expression>
- <xhtml:p><![CDATA[]]></xhtml:p>
- <configuration name="config">
- <resource name="resource1">
- <task name="InitOneShot" priority="0" single="Initialize">
- <pouInstance name="Initializer" typeName="Declarations"/>
- <task name="ControlTask" priority="0" interval="T#2ms">
- <pouInstance name="MainInstance" typeName="main"/>
- <task name="GUIupdate" priority="0" interval="T#200ms">
- <pouInstance name="PosReader" typeName="ReadGUIdata"/>
- <variable name="Initialize">
- <simpleValue value="TRUE"/>
- <variable name="power">
- <simpleValue value="TRUE"/>
+<?xml version='1.0' encoding='utf-8'?> +<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201"> + <fileHeader companyName="Unknown" productName="Beremiz" productVersion="1" creationDateTime="2012-09-12T23:30:19"/> + <contentHeader name="extended wxHMI example" modificationDateTime="2017-06-06T13:13:18"> + <pageSize x="1050" y="1485"/> + <pou name="main" pouType="program"> + <variable name="Power_ON"> + <variable name="Power_OFF"> + <variable name="power"> + <variable name="DrawTest"> + <variable name="DrawTestBtn"> + <variable name="DrawLogo"> + <variable name="XaxisPos"> + <variable name="YaxisPos"> + <variable name="ZaxisPos"> + <variable name="TaxisPos"> + <variable name="PowerCtrl"> + <variable name="Xaxis"> + <variable name="XAxisMinus"> + <variable name="XAxisPlus"> + <variable name="YAxisPlus"> + <variable name="YAxisMinus"> + <variable name="ZAxisPlus"> + <variable name="ZAxisMinus"> + <variable name="TAxisPlus"> + <variable name="TAxisMinus"> + <variable name="Yaxis"> + <variable name="Taxis"> + <variable name="Zaxis"> + <variable name="DrawTestDo"> + <variable name="DrawLogoDo"> + <comment localId="296" height="330" width="655"> + <position x="390" y="10"/> + <xhtml:p><![CDATA[Example shows +- how to use wxGlade extension to create user interface and dynamically extend it using Python, +- how to respond to user actions in PLC program and +- how to use several PLC tasks to handle process of different speeds. +1. Slow task that communicates with user interface created in wxGlade and updates axes state. +2. Main task that drives virtual axes. +When power is on, user can control axes. +"Draw Logo" buttons starts X, Y, Z axes. "Draw Test" buttons starts Z and T axes. +User can adjust position of axes using manual keys. +Happy hacking!]]></xhtml:p> + <inVariable localId="288" executionOrderId="0" height="30" width="85" negated="false"> + <position x="35" y="190"/> + <relPosition x="85" y="15"/> + <expression>Power_OFF</expression> + <inVariable localId="286" executionOrderId="0" height="30" width="85" negated="false"> + <position x="35" y="155"/> + <relPosition x="85" y="15"/> + <expression>Power_ON</expression> + <block localId="287" typeName="RS" instanceName="PowerCtrl" executionOrderId="0" height="95" width="55"> + <position x="190" y="130"/> + <variable formalParameter="S"> + <relPosition x="0" y="40"/> + <connection refLocalId="286"> + <position x="190" y="170"/> + <position x="120" y="170"/> + <variable formalParameter="R1"> + <relPosition x="0" y="75"/> + <connection refLocalId="288"> + <position x="190" y="205"/> + <position x="120" y="205"/> + <variable formalParameter="Q1"> + <relPosition x="55" y="40"/> + <outVariable localId="289" executionOrderId="0" height="30" width="50" negated="false"> + <position x="290" y="155"/> + <relPosition x="0" y="15"/> + <connection refLocalId="287" formalParameter="Q1"> + <position x="290" y="170"/> + <position x="241" y="170"/> + <expression>power</expression> + <block localId="297" typeName="axis" instanceName="Xaxis" executionOrderId="0" height="160" width="100"> + <position x="300" y="770"/> + <variable formalParameter="Power"> + <relPosition x="0" y="45"/> + <connection refLocalId="1"> + <position x="300" y="815"/> + <position x="265" y="815"/> + <position x="265" y="755"/> + <position x="255" y="755"/> + <variable formalParameter="Up"> + <relPosition x="0" y="90"/> + <connection refLocalId="301" formalParameter="OUT"> + <position x="300" y="860"/> + <position x="277" y="860"/> + <position x="277" y="835"/> + <position x="255" y="835"/> + <variable formalParameter="Down"> + <relPosition x="0" y="135"/> + <connection refLocalId="299"> + <position x="300" y="905"/> + <position x="110" y="905"/> + <variable formalParameter="Out"> + <relPosition x="100" y="45"/> + <outVariable localId="298" executionOrderId="0" height="35" width="70" negated="false"> + <position x="435" y="800"/> + <relPosition x="0" y="15"/> + <connection refLocalId="297" formalParameter="Out"> + <position x="435" y="815"/> + <position x="375" y="815"/> + <position x="375" y="815"/> + <position x="400" y="815"/> + <expression>XaxisPos</expression> + <inVariable localId="1" executionOrderId="0" height="30" width="50" negated="false"> + <position x="205" y="740"/> + <relPosition x="50" y="15"/> + <expression>power</expression> + <inVariable localId="299" executionOrderId="0" height="35" width="85" negated="false"> + <position x="25" y="890"/> + <relPosition x="85" y="15"/> + <expression>XAxisMinus</expression> + <inVariable localId="300" executionOrderId="0" height="35" width="85" negated="false"> + <position x="25" y="845"/> + <relPosition x="85" y="15"/> + <expression>XAxisPlus</expression> + <block localId="301" typeName="OR" executionOrderId="0" height="65" width="70"> + <position x="185" y="805"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="2"> + <position x="185" y="835"/> + <position x="162" y="835"/> + <position x="162" y="805"/> + <position x="140" y="805"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="55"/> + <connection refLocalId="300"> + <position x="185" y="860"/> + <position x="110" y="860"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="30"/> + <inVariable localId="2" executionOrderId="0" height="35" width="115" negated="false"> + <position x="25" y="790"/> + <relPosition x="115" y="15"/> + <expression>DrawTestDo.Q1</expression> + <inVariable localId="3" executionOrderId="0" height="35" width="115" negated="false"> + <position x="560" y="785"/> + <relPosition x="115" y="15"/> + <expression>DrawTestDo.Q1</expression> + <inVariable localId="4" executionOrderId="0" height="30" width="50" negated="false"> + <position x="735" y="735"/> + <relPosition x="50" y="15"/> + <expression>power</expression> + <block localId="5" typeName="axis" instanceName="Yaxis" executionOrderId="0" height="160" width="100"> + <position x="830" y="765"/> + <variable formalParameter="Power"> + <relPosition x="0" y="45"/> + <connection refLocalId="4"> + <position x="830" y="810"/> + <position x="815" y="810"/> + <position x="815" y="750"/> + <position x="785" y="750"/> + <variable formalParameter="Up"> + <relPosition x="0" y="90"/> + <connection refLocalId="9" formalParameter="OUT"> + <position x="830" y="855"/> + <position x="807" y="855"/> + <position x="807" y="830"/> + <position x="785" y="830"/> + <variable formalParameter="Down"> + <relPosition x="0" y="135"/> + <connection refLocalId="7"> + <position x="830" y="900"/> + <position x="645" y="900"/> + <variable formalParameter="Out"> + <relPosition x="100" y="45"/> + <outVariable localId="6" executionOrderId="0" height="35" width="70" negated="false"> + <position x="955" y="795"/> + <relPosition x="0" y="15"/> + <connection refLocalId="5" formalParameter="Out"> + <position x="955" y="810"/> + <position x="930" y="810"/> + <expression>YaxisPos</expression> + <inVariable localId="7" executionOrderId="0" height="35" width="85" negated="false"> + <position x="560" y="885"/> + <relPosition x="85" y="15"/> + <expression>YAxisMinus</expression> + <inVariable localId="8" executionOrderId="0" height="35" width="85" negated="false"> + <position x="560" y="840"/> + <relPosition x="85" y="15"/> + <expression>YAxisPlus</expression> + <block localId="9" typeName="OR" executionOrderId="0" height="65" width="70"> + <position x="715" y="800"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="3"> + <position x="715" y="830"/> + <position x="657" y="830"/> + <position x="657" y="800"/> + <position x="645" y="800"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="55"/> + <connection refLocalId="8"> + <position x="715" y="855"/> + <position x="645" y="855"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="30"/> + <inVariable localId="10" executionOrderId="0" height="35" width="115" negated="false"> + <position x="25" y="1045"/> + <relPosition x="115" y="15"/> + <expression>DrawTestDo.Q1</expression> + <inVariable localId="11" executionOrderId="0" height="35" width="115" negated="false"> + <position x="560" y="1025"/> + <relPosition x="115" y="15"/> + <expression>DrawLogoDo.Q1</expression> + <inVariable localId="12" executionOrderId="0" height="30" width="50" negated="false"> + <position x="740" y="975"/> + <relPosition x="50" y="15"/> + <expression>power</expression> + <block localId="13" typeName="axis" instanceName="Taxis" executionOrderId="0" height="160" width="100"> + <position x="835" y="1005"/> + <variable formalParameter="Power"> + <relPosition x="0" y="45"/> + <connection refLocalId="12"> + <position x="835" y="1050"/> + <position x="820" y="1050"/> + <position x="820" y="990"/> + <position x="790" y="990"/> + <variable formalParameter="Up"> + <relPosition x="0" y="90"/> + <connection refLocalId="22" formalParameter="OUT"> + <position x="835" y="1095"/> + <position x="812" y="1095"/> + <position x="812" y="1070"/> + <position x="790" y="1070"/> + <variable formalParameter="Down"> + <relPosition x="0" y="135"/> + <connection refLocalId="23"> + <position x="835" y="1140"/> + <position x="645" y="1140"/> + <variable formalParameter="Out"> + <relPosition x="100" y="45"/> + <outVariable localId="14" executionOrderId="0" height="35" width="70" negated="false"> + <position x="960" y="1035"/> + <relPosition x="0" y="15"/> + <connection refLocalId="13" formalParameter="Out"> + <position x="960" y="1050"/> + <position x="935" y="1050"/> + <expression>TaxisPos</expression> + <inVariable localId="15" executionOrderId="0" height="30" width="50" negated="false"> + <position x="200" y="980"/> + <relPosition x="50" y="15"/> + <expression>power</expression> + <inVariable localId="16" executionOrderId="0" height="35" width="85" negated="false"> + <position x="560" y="1080"/> + <relPosition x="85" y="15"/> + <expression>TAxisPlus</expression> + <block localId="17" typeName="axis" instanceName="Zaxis" executionOrderId="0" height="160" width="100"> + <position x="300" y="1010"/> + <variable formalParameter="Power"> + <relPosition x="0" y="45"/> + <connection refLocalId="15"> + <position x="300" y="1055"/> + <position x="285" y="1055"/> + <position x="285" y="995"/> + <position x="250" y="995"/> + <variable formalParameter="Up"> + <relPosition x="0" y="90"/> + <connection refLocalId="21" formalParameter="OUT"> + <position x="300" y="1100"/> + <position x="280" y="1100"/> + <position x="280" y="1055"/> + <position x="270" y="1055"/> + <variable formalParameter="Down"> + <relPosition x="0" y="135"/> + <connection refLocalId="19"> + <position x="300" y="1145"/> + <position x="110" y="1145"/> + <variable formalParameter="Out"> + <relPosition x="100" y="45"/> + <outVariable localId="18" executionOrderId="0" height="35" width="70" negated="false"> + <position x="435" y="1040"/> + <relPosition x="0" y="15"/> + <connection refLocalId="17" formalParameter="Out"> + <position x="435" y="1055"/> + <position x="400" y="1055"/> + <expression>ZaxisPos</expression> + <inVariable localId="19" executionOrderId="0" height="35" width="85" negated="false"> + <position x="25" y="1130"/> + <relPosition x="85" y="15"/> + <expression>ZAxisMinus</expression> + <inVariable localId="20" executionOrderId="0" height="35" width="85" negated="false"> + <position x="25" y="1090"/> + <relPosition x="85" y="15"/> + <expression>ZAxisPlus</expression> + <block localId="21" typeName="OR" executionOrderId="0" height="100" width="70"> + <position x="200" y="1020"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="24"> + <position x="200" y="1055"/> + <position x="170" y="1055"/> + <position x="170" y="1015"/> + <position x="140" y="1015"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="60"/> + <connection refLocalId="10"> + <position x="200" y="1080"/> + <position x="150" y="1080"/> + <position x="150" y="1060"/> + <position x="140" y="1060"/> + <variable formalParameter="IN3"> + <relPosition x="0" y="85"/> + <connection refLocalId="20"> + <position x="200" y="1105"/> + <position x="110" y="1105"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="35"/> + <block localId="22" typeName="OR" executionOrderId="0" height="65" width="70"> + <position x="720" y="1040"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="11"> + <position x="720" y="1070"/> + <position x="657" y="1070"/> + <position x="657" y="1040"/> + <position x="645" y="1040"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="55"/> + <connection refLocalId="16"> + <position x="720" y="1095"/> + <position x="645" y="1095"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="30"/> + <inVariable localId="23" executionOrderId="0" height="35" width="85" negated="false"> + <position x="560" y="1125"/> + <relPosition x="85" y="15"/> + <expression>TAxisMinus</expression> + <inVariable localId="24" executionOrderId="0" height="35" width="115" negated="false"> + <position x="25" y="1000"/> + <relPosition x="115" y="15"/> + <expression>DrawLogoDo.Q1</expression> + <inVariable localId="25" executionOrderId="0" height="30" width="85" negated="false"> + <position x="40" y="450"/> + <relPosition x="85" y="15"/> + <expression>DrawTest</expression> + <block localId="26" typeName="RS" instanceName="DrawTestDo" executionOrderId="0" height="115" width="55"> + <position x="280" y="445"/> + <variable formalParameter="S"> + <relPosition x="0" y="45"/> + <connection refLocalId="28" formalParameter="OUT"> + <position x="280" y="490"/> + <position x="255" y="490"/> + <position x="255" y="465"/> + <position x="230" y="465"/> + <variable formalParameter="R1"> + <relPosition x="0" y="90"/> + <connection refLocalId="33" formalParameter="OUT"> + <position x="280" y="535"/> + <position x="255" y="535"/> + <position x="255" y="560"/> + <position x="230" y="560"/> + <variable formalParameter="Q1"> + <relPosition x="55" y="45"/> + <inVariable localId="27" executionOrderId="0" height="30" width="85" negated="false"> + <position x="40" y="545"/> + <relPosition x="85" y="15"/> + <expression>Power_OFF</expression> + <block localId="28" typeName="OR" executionOrderId="0" height="85" width="70"> + <position x="160" y="430"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="25"> + <position x="160" y="465"/> + <position x="125" y="465"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="70"/> + <connection refLocalId="29"> + <position x="160" y="500"/> + <position x="135" y="500"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="35"/> + <inVariable localId="29" executionOrderId="0" height="30" width="95" negated="false"> + <position x="40" y="485"/> + <relPosition x="95" y="15"/> + <expression>DrawTestBtn</expression> + <block localId="33" typeName="OR" executionOrderId="0" height="85" width="70"> + <position x="160" y="525"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="27"> + <position x="160" y="560"/> + <position x="125" y="560"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="70"/> + <connection refLocalId="35"> + <position x="160" y="595"/> + <position x="125" y="595"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="35"/> + <inVariable localId="35" executionOrderId="0" height="30" width="85" negated="false"> + <position x="40" y="580"/> + <relPosition x="85" y="15"/> + <expression>DrawLogo</expression> + <comment localId="36" height="45" width="215"> + <position x="20" y="670"/> + <xhtml:p><![CDATA[Control virtual axes.]]></xhtml:p> + <inVariable localId="30" executionOrderId="0" height="30" width="85" negated="false"> + <position x="510" y="475"/> + <relPosition x="85" y="15"/> + <expression>DrawLogo</expression> + <block localId="31" typeName="RS" instanceName="DrawLogoDo" executionOrderId="0" height="115" width="55"> + <position x="740" y="445"/> + <variable formalParameter="S"> + <relPosition x="0" y="45"/> + <connection refLocalId="30"> + <position x="740" y="490"/> + <position x="595" y="490"/> + <variable formalParameter="R1"> + <relPosition x="0" y="90"/> + <connection refLocalId="39" formalParameter="OUT"> + <position x="740" y="535"/> + <position x="715" y="535"/> + <position x="715" y="560"/> + <position x="690" y="560"/> + <variable formalParameter="Q1"> + <relPosition x="55" y="45"/> + <inVariable localId="32" executionOrderId="0" height="30" width="85" negated="false"> + <position x="500" y="545"/> + <relPosition x="85" y="15"/> + <expression>Power_OFF</expression> + <inVariable localId="38" executionOrderId="0" height="30" width="85" negated="false"> + <position x="500" y="580"/> + <relPosition x="85" y="15"/> + <expression>DrawTest</expression> + <block localId="39" typeName="OR" executionOrderId="0" height="85" width="70"> + <position x="620" y="525"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="32"> + <position x="620" y="560"/> + <position x="585" y="560"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="70"/> + <connection refLocalId="38"> + <position x="620" y="595"/> + <position x="585" y="595"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="35"/> + <comment localId="34" height="45" width="365"> + <position x="15" y="55"/> + <xhtml:p><![CDATA[Turn on/off power, Power on enables axes control.]]></xhtml:p> + <comment localId="37" height="45" width="550"> + <position x="35" y="360"/> + <xhtml:p><![CDATA[Only one mode can be selected at any time ("Draw Logo" or "Draw Test").]]></xhtml:p> + <xhtml:p><![CDATA[]]></xhtml:p> + <pou name="ReadGUIdata" pouType="program"> + <variable name="python_poll0"> + <derived name="python_poll"/> + <block localId="220" typeName="python_poll" instanceName="python_poll0" executionOrderId="0" height="85" width="104"> + <position x="295" y="130"/> + <variable formalParameter="TRIG"> + <relPosition x="0" y="35"/> + <connection refLocalId="221"> + <position x="295" y="165"/> + <position x="268" y="165"/> + <variable formalParameter="CODE"> + <relPosition x="0" y="70"/> + <connection refLocalId="222"> + <position x="295" y="200"/> + <position x="271" y="200"/> + <variable formalParameter="ACK"> + <relPosition x="104" y="35"/> + <variable formalParameter="RESULT"> + <relPosition x="104" y="70"/> + <inVariable localId="221" executionOrderId="0" height="30" width="93" negated="false"> + <position x="175" y="150"/> + <relPosition x="93" y="15"/> + <expression>BOOL#TRUE</expression> + <inVariable localId="222" executionOrderId="0" height="30" width="161" negated="false"> + <position x="110" y="185"/> + <relPosition x="161" y="15"/> + <expression>'wxglade_hmi.UpdPos()'</expression> + <comment localId="296" height="55" width="445"> + <position x="35" y="25"/> + <xhtml:p><![CDATA[This is slow PLC task. It just updates state of axes on HMI.]]></xhtml:p> + <xhtml:p><![CDATA[]]></xhtml:p> + <pou name="Declarations" pouType="program"> + <variable name="InitValue"> + <simpleValue value="17"/> + <variable name="NotInitializedVariable"> + <variable name="counter"> + <inVariable localId="127" executionOrderId="0" height="30" width="72" negated="false"> + <position x="60" y="180"/> + <relPosition x="72" y="15"/> + <expression>InitValue</expression> + <outVariable localId="128" executionOrderId="0" height="30" width="145" negated="false"> + <position x="180" y="180"/> + <relPosition x="0" y="15"/> + <connection refLocalId="127"> + <position x="180" y="195"/> + <position x="132" y="195"/> + <expression>NotInitializedVariable</expression> + <comment localId="129" height="90" width="360"> + <position x="65" y="40"/> + <xhtml:p><![CDATA[This program called only once at start. +See task configuration in config.resource1.]]></xhtml:p> + <block localId="131" typeName="ADD" executionOrderId="0" height="95" width="70"> + <position x="135" y="340"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="40"/> + <connection refLocalId="130"> + <position x="135" y="380"/> + <position x="125" y="380"/> + <position x="125" y="325"/> + <position x="350" y="325"/> + <position x="350" y="380"/> + <position x="335" y="380"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="75"/> + <connection refLocalId="1"> + <position x="135" y="415"/> + <position x="130" y="415"/> + <position x="130" y="415"/> + <position x="120" y="415"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="40"/> + <inVariable localId="1" executionOrderId="0" height="35" width="60" negated="false"> + <position x="60" y="400"/> + <relPosition x="60" y="15"/> + <expression>1</expression> + <inOutVariable localId="130" executionOrderId="0" height="35" width="60" negatedOut="false" negatedIn="false"> + <position x="275" y="365"/> + <relPosition x="0" y="15"/> + <connection refLocalId="131" formalParameter="OUT"> + <position x="275" y="380"/> + <position x="205" y="380"/> + <relPosition x="60" y="15"/> + <expression>counter</expression> + <comment localId="2" height="75" width="355"> + <position x="70" y="240"/> + <xhtml:p><![CDATA[Counts how many times the program is called. +Check counter value in debugger.]]></xhtml:p> + <xhtml:p><![CDATA[]]></xhtml:p> + <pou name="clock" pouType="functionBlock"> + <variable name="TimerOn"> + <variable name="Period"> + <simpleValue value="T#3s"/> + <variable name="TimerOff"> + <block localId="14" typeName="TON" instanceName="TimerOn" executionOrderId="0" height="100" width="50"> + <position x="260" y="70"/> + <variable formalParameter="IN"> + <relPosition x="0" y="40"/> + <connection refLocalId="2" formalParameter="Q"> + <position x="260" y="110"/> + <position x="245" y="110"/> + <position x="245" y="10"/> + <position x="520" y="10"/> + <position x="520" y="110"/> + <position x="510" y="110"/> + <variable formalParameter="PT"> + <relPosition x="0" y="80"/> + <connection refLocalId="16" formalParameter="OUT"> + <position x="260" y="150"/> + <position x="225" y="150"/> + <position x="225" y="250"/> + <position x="190" y="250"/> + <variable formalParameter="Q"> + <relPosition x="50" y="40"/> + <variable formalParameter="ET"> + <relPosition x="50" y="80"/> + <block localId="2" typeName="TON" instanceName="TimerOff" executionOrderId="0" height="100" width="50"> + <position x="460" y="70"/> + <variable formalParameter="IN"> + <relPosition x="0" y="40"/> + <connection refLocalId="14" formalParameter="Q"> + <position x="460" y="110"/> + <position x="310" y="110"/> + <variable formalParameter="PT"> + <relPosition x="0" y="80"/> + <connection refLocalId="16" formalParameter="OUT"> + <position x="460" y="150"/> + <position x="350" y="150"/> + <position x="350" y="250"/> + <position x="190" y="250"/> + <variable formalParameter="Q" negated="true"> + <relPosition x="50" y="40"/> + <variable formalParameter="ET"> + <relPosition x="50" y="80"/> + <outVariable localId="15" executionOrderId="0" height="35" width="35" negated="false"> + <position x="365" y="25"/> + <relPosition x="0" y="15"/> + <connection refLocalId="14" formalParameter="Q"> + <position x="365" y="40"/> + <position x="340" y="40"/> + <position x="340" y="110"/> + <position x="310" y="110"/> + <expression>Out</expression> + <block localId="16" typeName="DIV" executionOrderId="0" height="80" width="70"> + <position x="120" y="215"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="1"> + <position x="120" y="250"/> + <position x="75" y="250"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="65"/> + <connection refLocalId="4"> + <position x="120" y="280"/> + <position x="75" y="280"/> + <variable formalParameter="OUT"> + <relPosition x="70" y="35"/> + <inVariable localId="1" executionOrderId="0" height="30" width="55" negated="false"> + <position x="20" y="235"/> + <relPosition x="55" y="15"/> + <expression>Period</expression> + <inVariable localId="4" executionOrderId="0" height="30" width="55" negated="false"> + <position x="20" y="265"/> + <relPosition x="55" y="15"/> + <expression>2</expression> + <pou name="axis" pouType="functionBlock"> + <variable name="Power"> + <variable name="axis_conuter"> + <variable name="clock0"> + <derived name="clock"/> + <block localId="297" typeName="CTUD" instanceName="axis_conuter" executionOrderId="0" height="310" width="70"> + <position x="645" y="30"/> + <variable formalParameter="CU" edge="rising"> + <relPosition x="0" y="50"/> + <connection refLocalId="303" formalParameter="OUT"> + <position x="645" y="80"/> + <position x="580" y="80"/> + <variable formalParameter="CD" edge="rising"> + <relPosition x="0" y="105"/> + <connection refLocalId="2" formalParameter="OUT"> + <position x="645" y="135"/> + <position x="612" y="135"/> + <position x="612" y="150"/> + <position x="580" y="150"/> + <variable formalParameter="R"> + <relPosition x="0" y="165"/> + <variable formalParameter="LD"> + <relPosition x="0" y="225"/> + <variable formalParameter="PV"> + <relPosition x="0" y="280"/> + <connection refLocalId="3"> + <position x="645" y="310"/> + <position x="610" y="310"/> + <variable formalParameter="QU"> + <relPosition x="70" y="50"/> + <variable formalParameter="QD"> + <relPosition x="70" y="105"/> + <variable formalParameter="CV"> + <relPosition x="70" y="165"/> + <variable formalParameter="CD_T"> + <relPosition x="70" y="225"/> + <variable formalParameter="CU_T"> + <relPosition x="70" y="280"/> + <outVariable localId="298" executionOrderId="0" height="35" width="35" negated="false"> + <position x="750" y="180"/> + <relPosition x="0" y="15"/> + <connection refLocalId="297" formalParameter="CV"> + <position x="750" y="195"/> + <position x="715" y="195"/> + <expression>Out</expression> + <block localId="299" typeName="clock" instanceName="clock0" executionOrderId="0" height="70" width="85"> + <position x="165" y="270"/> + <variable formalParameter="Period"> + <relPosition x="0" y="45"/> + <connection refLocalId="1"> + <position x="165" y="315"/> + <position x="110" y="315"/> + <variable formalParameter="Out"> + <relPosition x="85" y="45"/> + <inVariable localId="300" executionOrderId="0" height="35" width="55" negated="false"> + <position x="35" y="205"/> + <relPosition x="55" y="15"/> + <expression>Power</expression> + <inVariable localId="1" executionOrderId="0" height="35" width="75" negated="false"> + <position x="35" y="300"/> + <relPosition x="75" y="15"/> + <expression>T#100ms</expression> + <inVariable localId="301" executionOrderId="0" height="35" width="55" negated="false"> + <position x="340" y="85"/> + <relPosition x="55" y="15"/> + <expression>Up</expression> + <inVariable localId="302" executionOrderId="0" height="35" width="50" negated="false"> + <position x="340" y="155"/> + <relPosition x="50" y="15"/> + <expression>Down</expression> + <block localId="303" typeName="AND" executionOrderId="0" height="60" width="110"> + <position x="470" y="50"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="4" formalParameter="OUT"> + <position x="470" y="80"/> + <position x="432" y="80"/> + <position x="432" y="275"/> + <position x="395" y="275"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="50"/> + <connection refLocalId="301"> + <position x="470" y="100"/> + <position x="395" y="100"/> + <variable formalParameter="OUT"> + <relPosition x="110" y="30"/> + <block localId="2" typeName="AND" executionOrderId="0" height="60" width="110"> + <position x="470" y="120"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="4" formalParameter="OUT"> + <position x="470" y="150"/> + <position x="432" y="150"/> + <position x="432" y="275"/> + <position x="395" y="275"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="50"/> + <connection refLocalId="302"> + <position x="470" y="170"/> + <position x="390" y="170"/> + <variable formalParameter="OUT"> + <relPosition x="110" y="30"/> + <inVariable localId="3" executionOrderId="0" height="35" width="85" negated="false"> + <position x="525" y="295"/> + <relPosition x="85" y="15"/> + <expression>INT#32767</expression> + <block localId="4" typeName="AND" executionOrderId="0" height="100" width="110"> + <position x="285" y="235"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="40"/> + <connection refLocalId="300"> + <position x="285" y="275"/> + <position x="265" y="275"/> + <position x="265" y="220"/> + <position x="90" y="220"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="80"/> + <connection refLocalId="299" formalParameter="Out"> + <position x="285" y="315"/> + <position x="250" y="315"/> + <variable formalParameter="OUT"> + <relPosition x="110" y="40"/> + <configuration name="config"> + <resource name="resource1"> + <task name="InitOneShot" priority="0" single="Initialize"> + <pouInstance name="Initializer" typeName="Declarations"/> + <task name="ControlTask" priority="1" interval="T#2ms"> + <pouInstance name="MainInstance" typeName="main"/> + <task name="GUIupdate" priority="0" interval="T#200ms"> + <pouInstance name="PosReader" typeName="ReadGUIdata"/> + <variable name="Initialize"> + <simpleValue value="TRUE"/>