--- a/tests/logging/plc.xml Tue Jan 29 23:41:00 2013 +0100
+++ b/tests/logging/plc.xml Wed Jan 30 18:54:12 2013 +1100
@@ -8,7 +8,7 @@
productVersion="1"
creationDateTime="2013-01-29T14:01:00"/>
<contentHeader name="Unnamed"
- modificationDateTime="2013-01-29T21:30:36">
+ modificationDateTime="2013-01-30T18:24:53">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
@@ -22,7 +22,23 @@
</coordinateInfo>
</contentHeader>
<types>
- <dataTypes/>
+ <dataTypes>
+ <dataType name="LOGLEVEL">
+ <baseType>
+ <enum>
+ <values>
+ <value name="CRITICAL"/>
+ <value name="WARNING"/>
+ <value name="INFO"/>
+ <value name="DEBUG"/>
+ </values>
+ </enum>
+ </baseType>
+ <initialValue>
+ <simpleValue value="INFO"/>
+ </initialValue>
+ </dataType>
+ </dataTypes>
<pous>
<pou name="LOGGER" pouType="functionBlock">
<interface>
@@ -37,6 +53,14 @@
<string/>
</type>
</variable>
+ <variable name="LEVEL">
+ <type>
+ <derived name="LOGLEVEL"/>
+ </type>
+ <initialValue>
+ <simpleValue value="INFO"/>
+ </initialValue>
+ </variable>
</inputVars>
<localVars>
<variable name="TRIG0">
@@ -50,7 +74,7 @@
<ST>
<![CDATA[IF TRIG AND NOT TRIG0 THEN
{{
- LogMessage(GetFbVar(MSG, .body),GetFbVar(MSG, .len));
+ LogMessage(GetFbVar(LEVEL),GetFbVar(MSG, .body),GetFbVar(MSG, .len));
}}
END_IF;
TRIG0:=TRIG;
@@ -61,54 +85,25 @@
<pou name="program0" pouType="program">
<interface>
<localVars>
+ <variable name="beat">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ <variable name="count">
+ <type>
+ <INT/>
+ </type>
+ </variable>
<variable name="LOGGER0">
<type>
<derived name="LOGGER"/>
</type>
</variable>
- <variable name="beat">
- <type>
- <BOOL/>
- </type>
- </variable>
- <variable name="count">
- <type>
- <INT/>
- </type>
- </variable>
</localVars>
</interface>
<body>
<FBD>
- <block localId="1" width="65" height="71" typeName="LOGGER" instanceName="LOGGER0">
- <position x="1008" y="64"/>
- <inputVariables>
- <variable formalParameter="TRIG">
- <connectionPointIn>
- <relPosition x="0" y="32"/>
- <connection refLocalId="3" formalParameter="OUT">
- <position x="1008" y="96"/>
- <position x="640" y="96"/>
- <position x="640" y="94"/>
- <position x="272" y="94"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="MSG">
- <connectionPointIn>
- <relPosition x="0" y="57"/>
- <connection refLocalId="8" formalParameter="OUT">
- <position x="1008" y="121"/>
- <position x="970" y="121"/>
- <position x="970" y="204"/>
- <position x="935" y="204"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables/>
- </block>
<inVariable localId="2" height="27" width="85">
<position x="732" y="188"/>
<connectionPointOut>
@@ -292,6 +287,38 @@
</variable>
</outputVariables>
</block>
+ <block localId="11" width="65" height="80" typeName="LOGGER" instanceName="LOGGER0">
+ <position x="1183" y="64"/>
+ <inputVariables>
+ <variable formalParameter="TRIG">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="3" formalParameter="OUT">
+ <position x="1183" y="94"/>
+ <position x="272" y="94"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="MSG">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="8" formalParameter="OUT">
+ <position x="1183" y="114"/>
+ <position x="979" y="114"/>
+ <position x="979" y="204"/>
+ <position x="935" y="204"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="LEVEL">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables/>
+ </block>
</FBD>
</body>
</pou>