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'?>
<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
<TargetType/>
<TargetType>
<Linux RealTime="true"/>
</TargetType>
</BeremizRoot>
<?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-04-10T11:35:47">
<contentHeader name="Counter (OSIE)" modificationDateTime="2023-04-13T09:13:59">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
......@@ -94,10 +94,6 @@
<position x="433" y="266"/>
<connectionPointIn>
<relPosition x="0" y="12"/>
<connection refLocalId="2" formalParameter="Out0">
<position x="433" y="278"/>
<position x="387" y="278"/>
</connection>
</connectionPointIn>
<expression>Cnt0</expression>
</outVariable>
......@@ -105,10 +101,6 @@
<position x="435" y="222"/>
<connectionPointIn>
<relPosition x="0" y="12"/>
<connection refLocalId="2" formalParameter="Out1">
<position x="435" y="234"/>
<position x="387" y="234"/>
</connection>
</connectionPointIn>
<expression>Cnt1</expression>
</outVariable>
......@@ -117,107 +109,46 @@
</pou>
<pou name="CounterST" pouType="functionBlock">
<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>
<variable name="Cnt1">
<type>
<INT/>
</type>
</variable>
<variable name="Cnt0">
<type>
<INT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
</variable>
</localVars>
<externalVars>
<variable name="ResetCounterValue">
<type>
<INT/>
</type>
</variable>
<variable name="Coupler0_Relay0">
<type>
<DINT/>
</type>
</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">
<type>
<DINT/>
</type>
</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>
</interface>
<body>
<ST>
<xhtml:p><![CDATA[IF Reset THEN
Cnt0 := ResetCounterValue;
Cnt1 := ResetCounterValue;
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;
<xhtml:p><![CDATA[IF Cnt0 = 500 THEN
Coupler0_Relay0 := 1;
Coupler1_Relay0 := 1;
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>
</body>
</pou>
......@@ -227,7 +158,7 @@ Out0 := Cnt0;]]></xhtml:p>
<configurations>
<configuration name="config">
<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"/>
</task>
</resource>
......@@ -240,7 +171,7 @@ Out0 := Cnt0;]]></xhtml:p>
<simpleValue value="0"/>
</initialValue>
</variable>
<variable name="Coupler0_Relay0" address="%QD1.0">
<variable name="Coupler0_Relay0" address="%QD0.0">
<type>
<DINT/>
</type>
......@@ -251,73 +182,7 @@ Out0 := Cnt0;]]></xhtml:p>
<xhtml:p><![CDATA[OPC-UA relay 0]]></xhtml:p>
</documentation>
</variable>
<variable name="Coupler0_Relay1" address="%QD1.1">
<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">
<variable name="Coupler1_Relay0" address="%QD1.0">
<type>
<DINT/>
</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