tests/svghmi/py_ext_0@py_ext/pyfile.xml
author Edouard Tisserant
Thu, 18 Jun 2020 14:15:43 +0200
branchsvghmi
changeset 2983 43198edb6ac0
child 2994 b6a9ef7f7e43
permissions -rw-r--r--
SVGHMI: Add use of Python PLC Globals it test
<?xml version='1.0' encoding='utf-8'?>
<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <variables>
    <variable name="SomePLCglobal" type="HMI_STRING" onchange="MyOnChangeFunc"/>
  </variables>
  <globals>
    <xhtml:p><![CDATA[

def MyOnChangeFunc(changed_var_name):
    print changed_var_name + ": " + getattr(PLCGlobals, changed_var_name)

]]></xhtml:p>
  </globals>
  <init>
    <xhtml:p><![CDATA[
]]></xhtml:p>
  </init>
  <cleanup>
    <xhtml:p><![CDATA[
]]></xhtml:p>
  </cleanup>
  <start>
    <xhtml:p><![CDATA[
]]></xhtml:p>
  </start>
  <stop>
    <xhtml:p><![CDATA[
]]></xhtml:p>
  </stop>
</PyFile>