Commit daf4c3f9 authored by Ivan Tyagov's avatar Ivan Tyagov

Various setup adjustments. Use Real Time.

parent fef7c81f
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://"> <BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
<TargetType/> <TargetType>
<Linux RealTime="true"/>
</TargetType>
</BeremizRoot> </BeremizRoot>
<?xml version='1.0' encoding='utf-8'?> <?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"> <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"/> <fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2021-05-14T14:33:11"/>
<contentHeader name="Counter (OSIE)" modificationDateTime="2023-04-10T11:35:47"> <contentHeader name="Counter (OSIE)" modificationDateTime="2023-04-13T09:13:59">
<coordinateInfo> <coordinateInfo>
<fbd> <fbd>
<scaling x="0" y="0"/> <scaling x="0" y="0"/>
...@@ -94,10 +94,6 @@ ...@@ -94,10 +94,6 @@
<position x="433" y="266"/> <position x="433" y="266"/>
<connectionPointIn> <connectionPointIn>
<relPosition x="0" y="12"/> <relPosition x="0" y="12"/>
<connection refLocalId="2" formalParameter="Out0">
<position x="433" y="278"/>
<position x="387" y="278"/>
</connection>
</connectionPointIn> </connectionPointIn>
<expression>Cnt0</expression> <expression>Cnt0</expression>
</outVariable> </outVariable>
...@@ -105,10 +101,6 @@ ...@@ -105,10 +101,6 @@
<position x="435" y="222"/> <position x="435" y="222"/>
<connectionPointIn> <connectionPointIn>
<relPosition x="0" y="12"/> <relPosition x="0" y="12"/>
<connection refLocalId="2" formalParameter="Out1">
<position x="435" y="234"/>
<position x="387" y="234"/>
</connection>
</connectionPointIn> </connectionPointIn>
<expression>Cnt1</expression> <expression>Cnt1</expression>
</outVariable> </outVariable>
...@@ -117,107 +109,46 @@ ...@@ -117,107 +109,46 @@
</pou> </pou>
<pou name="CounterST" pouType="functionBlock"> <pou name="CounterST" pouType="functionBlock">
<interface> <interface>
<inputVars>
<variable name="Reset">
<type>
<BOOL/>
</type>
</variable>
</inputVars>
<outputVars>
<variable name="Out1">
<type>
<INT/>
</type>
</variable>
<variable name="Out0">
<type>
<INT/>
</type>
</variable>
</outputVars>
<localVars> <localVars>
<variable name="Cnt1">
<type>
<INT/>
</type>
</variable>
<variable name="Cnt0"> <variable name="Cnt0">
<type> <type>
<INT/> <INT/>
</type> </type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
</variable> </variable>
</localVars> </localVars>
<externalVars> <externalVars>
<variable name="ResetCounterValue">
<type>
<INT/>
</type>
</variable>
<variable name="Coupler0_Relay0"> <variable name="Coupler0_Relay0">
<type> <type>
<DINT/> <DINT/>
</type> </type>
</variable> </variable>
<variable name="Coupler0_Relay1">
<type>
<DINT/>
</type>
</variable>
<variable name="Coupler0_Relay2">
<type>
<DINT/>
</type>
</variable>
<variable name="Coupler0_Relay3">
<type>
<DINT/>
</type>
</variable>
<variable name="Coupler1_Relay0"> <variable name="Coupler1_Relay0">
<type> <type>
<DINT/> <DINT/>
</type> </type>
</variable> </variable>
<variable name="Coupler1_Relay1">
<type>
<DINT/>
</type>
</variable>
<variable name="Coupler1_Relay2">
<type>
<DINT/>
</type>
</variable>
<variable name="Coupler1_Relay3">
<type>
<DINT/>
</type>
</variable>
</externalVars> </externalVars>
</interface> </interface>
<body> <body>
<ST> <ST>
<xhtml:p><![CDATA[IF Reset THEN <xhtml:p><![CDATA[IF Cnt0 = 500 THEN
Cnt0 := ResetCounterValue; Coupler0_Relay0 := 1;
Cnt1 := ResetCounterValue; Coupler1_Relay0 := 1;
Reset := False;
ELSE
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 = 5 THEN
Coupler0_Relay0 := 1;
Coupler1_Relay0 := 1;
END_IF;
IF Cnt1 = 10 THEN
Coupler0_Relay0 := 0;
Coupler1_Relay0 := 0;
Cnt1 := 0;
END_IF;
END_IF; END_IF;
Out1 := Cnt1;
Out0 := Cnt0;]]></xhtml:p> IF Cnt0 = 1000 THEN
Coupler0_Relay0 := 0;
Coupler1_Relay0 := 0;
Cnt0:= 0;
END_IF;
Cnt0 := Cnt0 + 1;
]]></xhtml:p>
</ST> </ST>
</body> </body>
</pou> </pou>
...@@ -227,7 +158,7 @@ Out0 := Cnt0;]]></xhtml:p> ...@@ -227,7 +158,7 @@ Out0 := Cnt0;]]></xhtml:p>
<configurations> <configurations>
<configuration name="config"> <configuration name="config">
<resource name="resource1"> <resource name="resource1">
<task name="task0" priority="0" interval="T#10ms"> <task name="task0" priority="0" interval="T#150ms">
<pouInstance name="instance0" typeName="plc_prg"/> <pouInstance name="instance0" typeName="plc_prg"/>
</task> </task>
</resource> </resource>
...@@ -240,7 +171,7 @@ Out0 := Cnt0;]]></xhtml:p> ...@@ -240,7 +171,7 @@ Out0 := Cnt0;]]></xhtml:p>
<simpleValue value="0"/> <simpleValue value="0"/>
</initialValue> </initialValue>
</variable> </variable>
<variable name="Coupler0_Relay0" address="%QD1.0"> <variable name="Coupler0_Relay0" address="%QD0.0">
<type> <type>
<DINT/> <DINT/>
</type> </type>
...@@ -251,73 +182,7 @@ Out0 := Cnt0;]]></xhtml:p> ...@@ -251,73 +182,7 @@ Out0 := Cnt0;]]></xhtml:p>
<xhtml:p><![CDATA[OPC-UA relay 0]]></xhtml:p> <xhtml:p><![CDATA[OPC-UA relay 0]]></xhtml:p>
</documentation> </documentation>
</variable> </variable>
<variable name="Coupler0_Relay1" address="%QD1.1"> <variable name="Coupler1_Relay0" address="%QD1.0">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
<documentation>
<xhtml:p><![CDATA[OPC-UA relay 1]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler0_Relay2" address="%QD1.2">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
<documentation>
<xhtml:p><![CDATA[OPC-UA relay 2]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler0_Relay3" address="%QD1.3">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
<documentation>
<xhtml:p><![CDATA[OPC-UA relay 2]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler1_Relay0" address="%QD0.0">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
<documentation>
<xhtml:p><![CDATA[OPC-UA relay 2]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler1_Relay1" address="%QD0.1">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
<documentation>
<xhtml:p><![CDATA[OPC-UA relay 2]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler1_Relay2" address="%QD0.2">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
<documentation>
<xhtml:p><![CDATA[OPC-UA relay 2]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler1_Relay3" address="%QD0.3">
<type> <type>
<DINT/> <DINT/>
</type> </type>
......
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