Commit d71bc41b authored by Ivan Tyagov's avatar Ivan Tyagov

First POC of interation between cherry-picker and Beremiz.

parent 58d6046f
......@@ -234,18 +234,15 @@ void COUNTERST_body__(COUNTERST *data__) {
} else {
__SET_VAR(data__->,CNT0,,(__GET_VAR(data__->CNT0,) + 1));
__SET_VAR(data__->,CNT1,,(__GET_VAR(data__->CNT1,) + 1));
if ((__GET_VAR(data__->CNT1,) > 100)) {
__SET_EXTERNAL(data__->,RELAY0VALUE,,__BOOL_LITERAL(FALSE));
if ((__GET_VAR(data__->CNT1,) > 5)) {
__SET_EXTERNAL(data__->,RELAY0VALUE,,__BOOL_LITERAL(TRUE));
__SET_EXTERNAL(data__->,RELAY1VALUE,,__BOOL_LITERAL(TRUE));
__SET_EXTERNAL(data__->,RELAY2VALUE,,__BOOL_LITERAL(FALSE));
__SET_EXTERNAL(data__->,RELAY3VALUE,,__BOOL_LITERAL(TRUE));
} else {
__SET_EXTERNAL(data__->,RELAY0VALUE,,__BOOL_LITERAL(TRUE));
__SET_EXTERNAL(data__->,RELAY1VALUE,,__BOOL_LITERAL(FALSE));
__SET_EXTERNAL(data__->,RELAY2VALUE,,__BOOL_LITERAL(TRUE));
__SET_EXTERNAL(data__->,RELAY3VALUE,,__BOOL_LITERAL(FALSE));
};
if ((__GET_VAR(data__->CNT1,) > 200)) {
if ((__GET_VAR(data__->CNT1,) > 7)) {
__SET_EXTERNAL(data__->,RELAY1VALUE,,__BOOL_LITERAL(FALSE));
__SET_VAR(data__->,CNT1,,0);
};
};
......
......@@ -25,19 +25,16 @@ FUNCTION_BLOCK CounterST
ELSE
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 > 100 THEN
Relay0Value := False;
IF Cnt1 > 5 THEN
Relay0Value := True;
Relay1Value := True;
Relay2Value := False;
Relay3Value := True;
ELSE
Relay0Value := True;
Relay1Value := False;
Relay2Value := True;
Relay3Value := False;
END_IF;
IF Cnt1>200 THEN
IF Cnt1 > 7 THEN
Relay1Value := False;
Cnt1 :=0;
END_IF;
......
8d1d2897b64bed41c973dabc5b27e597
\ No newline at end of file
6e1af784c3e7b7bca21bc2147e065019
\ No newline at end of file
......@@ -119,19 +119,16 @@ FUNCTION_BLOCK CounterST
ELSE
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 > 100 THEN
Relay0Value := False;
IF Cnt1 > 5 THEN
Relay0Value := True;
Relay1Value := True;
Relay2Value := False;
Relay3Value := True;
ELSE
Relay0Value := True;
Relay1Value := False;
Relay2Value := True;
Relay3Value := False;
END_IF;
IF Cnt1>200 THEN
IF Cnt1 > 7 THEN
Relay1Value := False;
Cnt1 :=0;
END_IF;
......
<?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="2021-06-01T14:05:58">
<contentHeader name="Counter (OSIE)" modificationDateTime="2021-06-03T16:47:18">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
......@@ -185,19 +185,16 @@
ELSE
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 > 100 THEN
Relay0Value := False;
IF Cnt1 > 10 THEN
Relay0Value := True;
Relay1Value := True;
Relay2Value := False;
Relay3Value := True;
ELSE
Relay0Value := True;
Relay1Value := False;
Relay2Value := True;
Relay3Value := False;
END_IF;
IF Cnt1>200 THEN
IF Cnt1 > 15 THEN
Relay1Value := False;
Cnt1 :=0;
END_IF;
......
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