Commit 238e1d9e authored by Ivan Tyagov's avatar Ivan Tyagov

Add MES5 hello world example project (simple integer increment which is

persistently save to MES5).
parent 6544f815
<?xml version='1.0' encoding='utf-8'?>
<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
<TargetType/>
</BeremizRoot>
<?xml version='1.0' encoding='utf-8'?>
<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="1" Name="opcua_0"/>
<?xml version='1.0' encoding='utf-8'?>
<OPCUAClient xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AuthType/>
</OPCUAClient>
input,erp5-variable-integer,2,int,2,Int64,2
output,erp5-variable-integer,2,int,2,Int64,2
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2021-05-14T14:33:11"/>
<contentHeader name="Counter (OSIE)" modificationDateTime="2023-09-09T10:19:33">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
</fbd>
<ld>
<scaling x="0" y="0"/>
</ld>
<sfc>
<scaling x="0" y="0"/>
</sfc>
</coordinateInfo>
</contentHeader>
<types>
<dataTypes/>
<pous>
<pou name="plc_prg" pouType="program">
<interface>
<inputVars>
<variable name="Reset">
<type>
<BOOL/>
</type>
</variable>
</inputVars>
<outputVars>
<variable name="Cnt0">
<type>
<INT/>
</type>
</variable>
<variable name="Cnt1">
<type>
<INT/>
</type>
</variable>
</outputVars>
<localVars>
<variable name="CounterST0">
<type>
<derived name="MES5CounterST"/>
</type>
</variable>
</localVars>
</interface>
<body>
<FBD>
<comment localId="1" height="143" width="201">
<position x="566" y="75"/>
<content>
<xhtml:p><![CDATA[This PLC program will just increment a counter at MES5 sid eover OPC UA.]]></xhtml:p>
</content>
</comment>
<block localId="2" typeName="MES5CounterST" instanceName="CounterST0" executionOrderId="0" height="109" width="114">
<position x="288" y="192"/>
<inputVariables/>
<inOutVariables/>
<outputVariables/>
</block>
<inVariable localId="3" executionOrderId="0" height="25" width="50" negated="false">
<position x="181" y="206"/>
<connectionPointOut>
<relPosition x="50" y="12"/>
</connectionPointOut>
<expression>Reset</expression>
</inVariable>
<outVariable localId="4" executionOrderId="0" height="25" width="42" negated="false">
<position x="433" y="266"/>
<connectionPointIn>
<relPosition x="0" y="12"/>
</connectionPointIn>
<expression>Cnt0</expression>
</outVariable>
<outVariable localId="6" executionOrderId="0" height="25" width="42" negated="false">
<position x="435" y="222"/>
<connectionPointIn>
<relPosition x="0" y="12"/>
</connectionPointIn>
<expression>Cnt1</expression>
</outVariable>
</FBD>
</body>
</pou>
<pou name="MES5CounterST" pouType="functionBlock">
<interface>
<externalVars>
<variable name="mes5_int_in">
<type>
<LINT/>
</type>
<documentation>
<xhtml:p><![CDATA[OPC UA node variable at MES5 (read mode)]]></xhtml:p>
</documentation>
</variable>
<variable name="mes5_int_out">
<type>
<LINT/>
</type>
<documentation>
<xhtml:p><![CDATA[OPC UA node variable at MES5 (write mode)]]></xhtml:p>
</documentation>
</variable>
</externalVars>
</interface>
<body>
<ST>
<xhtml:p><![CDATA[(* read from MES5 counter value so we continue from where we were*)
mes5_int_in := mes5_int_in + 1;
(* set to MES5 the counter value so it is kept permanently *)
mes5_int_out := mes5_int_in;
]]></xhtml:p>
</ST>
</body>
</pou>
</pous>
</types>
<instances>
<configurations>
<configuration name="config">
<resource name="resource1">
<task name="task0" priority="0" interval="T#1s0ms">
<pouInstance name="instance0" typeName="plc_prg"/>
</task>
</resource>
<globalVars>
<variable name="mes5_int_in" address="%IL1.2">
<type>
<LINT/>
</type>
<documentation>
<xhtml:p><![CDATA[MES5 counter (read mode)]]></xhtml:p>
</documentation>
</variable>
<variable name="mes5_int_out" address="%QL1.2">
<type>
<LINT/>
</type>
<documentation>
<xhtml:p><![CDATA[MES5 counter (read mode)]]></xhtml:p>
</documentation>
</variable>
</globalVars>
</configuration>
</configurations>
</instances>
</project>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment