Commit a671c0ee authored by Ivan Tyagov's avatar Ivan Tyagov

Adjust variable names.

parent 5754c472
......@@ -209,10 +209,10 @@ void COUNTERST_init__(COUNTERST *data__, BOOL retain) {
__INIT_VAR(data__->CNT1,0,retain)
__INIT_VAR(data__->CNT0,0,retain)
__INIT_EXTERNAL(INT,RESETCOUNTERVALUE,data__->RESETCOUNTERVALUE,retain)
__INIT_EXTERNAL(DINT,RELAY3VALUE0,data__->RELAY3VALUE0,retain)
__INIT_EXTERNAL(DINT,RELAY3VALUE1,data__->RELAY3VALUE1,retain)
__INIT_EXTERNAL(DINT,RELAY3VALUE2,data__->RELAY3VALUE2,retain)
__INIT_EXTERNAL(DINT,RELAY3VALUE3,data__->RELAY3VALUE3,retain)
__INIT_EXTERNAL(DINT,RELAY0,data__->RELAY0,retain)
__INIT_EXTERNAL(DINT,RELAY1,data__->RELAY1,retain)
__INIT_EXTERNAL(DINT,RELAY2,data__->RELAY2,retain)
__INIT_EXTERNAL(DINT,RELAY3,data__->RELAY3,retain)
}
// Code part
......@@ -235,16 +235,16 @@ void COUNTERST_body__(COUNTERST *data__) {
__SET_VAR(data__->,CNT0,,(__GET_VAR(data__->CNT0,) + 1));
__SET_VAR(data__->,CNT1,,(__GET_VAR(data__->CNT1,) + 1));
if ((__GET_VAR(data__->CNT1,) == 50)) {
__SET_EXTERNAL(data__->,RELAY3VALUE0,,1);
__SET_EXTERNAL(data__->,RELAY3VALUE1,,1);
__SET_EXTERNAL(data__->,RELAY3VALUE2,,1);
__SET_EXTERNAL(data__->,RELAY3VALUE3,,1);
__SET_EXTERNAL(data__->,RELAY0,,1);
__SET_EXTERNAL(data__->,RELAY1,,1);
__SET_EXTERNAL(data__->,RELAY2,,1);
__SET_EXTERNAL(data__->,RELAY3,,1);
};
if ((__GET_VAR(data__->CNT1,) == 100)) {
__SET_EXTERNAL(data__->,RELAY3VALUE0,,0);
__SET_EXTERNAL(data__->,RELAY3VALUE1,,0);
__SET_EXTERNAL(data__->,RELAY3VALUE2,,0);
__SET_EXTERNAL(data__->,RELAY3VALUE3,,0);
__SET_EXTERNAL(data__->,RELAY0,,0);
__SET_EXTERNAL(data__->,RELAY1,,0);
__SET_EXTERNAL(data__->,RELAY2,,0);
__SET_EXTERNAL(data__->,RELAY3,,0);
__SET_VAR(data__->,CNT1,,0);
};
};
......
......@@ -114,10 +114,10 @@ typedef struct {
__DECLARE_VAR(INT,CNT1)
__DECLARE_VAR(INT,CNT0)
__DECLARE_EXTERNAL(INT,RESETCOUNTERVALUE)
__DECLARE_EXTERNAL(DINT,RELAY3VALUE0)
__DECLARE_EXTERNAL(DINT,RELAY3VALUE1)
__DECLARE_EXTERNAL(DINT,RELAY3VALUE2)
__DECLARE_EXTERNAL(DINT,RELAY3VALUE3)
__DECLARE_EXTERNAL(DINT,RELAY0)
__DECLARE_EXTERNAL(DINT,RELAY1)
__DECLARE_EXTERNAL(DINT,RELAY2)
__DECLARE_EXTERNAL(DINT,RELAY3)
} COUNTERST;
......
......@@ -3,10 +3,10 @@
// Variables
0;VAR;CONFIG.RESETCOUNTERVALUE;CONFIG.RESETCOUNTERVALUE;INT;INT;
1;OUT;CONFIG.RELAY3VALUE0;CONFIG.RELAY3VALUE0;DINT;DINT;
2;OUT;CONFIG.RELAY3VALUE1;CONFIG.RELAY3VALUE1;DINT;DINT;
3;OUT;CONFIG.RELAY3VALUE2;CONFIG.RELAY3VALUE2;DINT;DINT;
4;OUT;CONFIG.RELAY3VALUE3;CONFIG.RELAY3VALUE3;DINT;DINT;
1;OUT;CONFIG.RELAY0;CONFIG.RELAY0;DINT;DINT;
2;OUT;CONFIG.RELAY1;CONFIG.RELAY1;DINT;DINT;
3;OUT;CONFIG.RELAY2;CONFIG.RELAY2;DINT;DINT;
4;OUT;CONFIG.RELAY3;CONFIG.RELAY3;DINT;DINT;
5;FB;CONFIG.RESOURCE1.INSTANCE0;CONFIG.RESOURCE1.INSTANCE0;PLC_PRG;;
6;VAR;CONFIG.RESOURCE1.INSTANCE0.RESET;CONFIG.RESOURCE1.INSTANCE0.RESET;BOOL;BOOL;
7;VAR;CONFIG.RESOURCE1.INSTANCE0.CNT0;CONFIG.RESOURCE1.INSTANCE0.CNT0;INT;INT;
......@@ -20,10 +20,10 @@
15;VAR;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.CNT1;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.CNT1;INT;INT;
16;VAR;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.CNT0;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.CNT0;INT;INT;
17;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RESETCOUNTERVALUE;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RESETCOUNTERVALUE;INT;INT;
18;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE0;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE0;DINT;DINT;
19;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE1;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE1;DINT;DINT;
20;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE2;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE2;DINT;DINT;
21;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE3;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3VALUE3;DINT;DINT;
18;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY0;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY0;DINT;DINT;
19;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY1;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY1;DINT;DINT;
20;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY2;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY2;DINT;DINT;
21;EXT;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3;CONFIG.RESOURCE1.INSTANCE0.COUNTERST0.RELAY3;DINT;DINT;
// Ticktime
......
......@@ -12,13 +12,13 @@
// CONFIGURATION CONFIG
__DECLARE_GLOBAL(INT,CONFIG,RESETCOUNTERVALUE)
__DECLARE_GLOBAL_LOCATION(DINT,__QD1_0)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY3VALUE0)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY0)
__DECLARE_GLOBAL_LOCATION(DINT,__QD1_1)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY3VALUE1)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY1)
__DECLARE_GLOBAL_LOCATION(DINT,__QD1_2)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY3VALUE2)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY2)
__DECLARE_GLOBAL_LOCATION(DINT,__QD1_3)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY3VALUE3)
__DECLARE_GLOBAL_LOCATED(DINT,CONFIG,RELAY3)
void RESOURCE1_init__(void);
......@@ -26,14 +26,14 @@ void config_init__(void) {
BOOL retain;
retain = 0;
__INIT_GLOBAL(INT,RESETCOUNTERVALUE,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY3VALUE0,__QD1_0,retain)
__INIT_GLOBAL(DINT,RELAY3VALUE0,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY3VALUE1,__QD1_1,retain)
__INIT_GLOBAL(DINT,RELAY3VALUE1,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY3VALUE2,__QD1_2,retain)
__INIT_GLOBAL(DINT,RELAY3VALUE2,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY3VALUE3,__QD1_3,retain)
__INIT_GLOBAL(DINT,RELAY3VALUE3,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY0,__QD1_0,retain)
__INIT_GLOBAL(DINT,RELAY0,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY1,__QD1_1,retain)
__INIT_GLOBAL(DINT,RELAY1,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY2,__QD1_2,retain)
__INIT_GLOBAL(DINT,RELAY2,__INITIAL_VALUE(0),retain)
__INIT_GLOBAL_LOCATED(CONFIG,RELAY3,__QD1_3,retain)
__INIT_GLOBAL(DINT,RELAY3,__INITIAL_VALUE(0),retain)
RESOURCE1_init__();
}
......
#include "beremiz.h"
__DECLARE_GLOBAL_PROTOTYPE(INT,RESETCOUNTERVALUE)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY3VALUE0)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY3VALUE1)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY3VALUE2)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY3VALUE3)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY0)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY1)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY2)
__DECLARE_GLOBAL_PROTOTYPE(DINT,RELAY3)
......@@ -12,10 +12,10 @@ FUNCTION_BLOCK CounterST
END_VAR
VAR_EXTERNAL
ResetCounterValue : INT;
Relay3Value0 : DINT;
Relay3Value1 : DINT;
Relay3Value2 : DINT;
Relay3Value3 : DINT;
Relay0 : DINT;
Relay1 : DINT;
Relay2 : DINT;
Relay3 : DINT;
END_VAR
IF Reset THEN
......@@ -26,17 +26,17 @@ FUNCTION_BLOCK CounterST
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 = 50 THEN
Relay3Value0 := 1;
Relay3Value1 := 1;
Relay3Value2 := 1;
Relay3Value3 := 1;
Relay0 := 1;
Relay1 := 1;
Relay2 := 1;
Relay3 := 1;
END_IF;
IF Cnt1 = 100 THEN
Relay3Value0 := 0;
Relay3Value1 := 0;
Relay3Value2 := 0;
Relay3Value3 := 0;
Relay0 := 0;
Relay1 := 0;
Relay2 := 0;
Relay3 := 0;
Cnt1 := 0;
END_IF;
......@@ -67,10 +67,10 @@ END_PROGRAM
CONFIGURATION config
VAR_GLOBAL
ResetCounterValue : INT := 0;
Relay3Value0 AT %QD1.0 : DINT := 0;
Relay3Value1 AT %QD1.1 : DINT := 0;
Relay3Value2 AT %QD1.2 : DINT := 0;
Relay3Value3 AT %QD1.3 : DINT := 0;
Relay0 AT %QD1.0 : DINT := 0;
Relay1 AT %QD1.1 : DINT := 0;
Relay2 AT %QD1.2 : DINT := 0;
Relay3 AT %QD1.3 : DINT := 0;
END_VAR
RESOURCE resource1 ON PLC
......
7cf1024dd8f5d640c14541871d602956
\ No newline at end of file
5c767212bd9f45b1bff8365ee7aa5c48
\ No newline at end of file
......@@ -106,10 +106,10 @@ FUNCTION_BLOCK CounterST
END_VAR
VAR_EXTERNAL
ResetCounterValue : INT;
Relay3Value0 : DINT;
Relay3Value1 : DINT;
Relay3Value2 : DINT;
Relay3Value3 : DINT;
Relay0 : DINT;
Relay1 : DINT;
Relay2 : DINT;
Relay3 : DINT;
END_VAR
IF Reset THEN
......@@ -120,17 +120,17 @@ FUNCTION_BLOCK CounterST
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 = 50 THEN
Relay3Value0 := 1;
Relay3Value1 := 1;
Relay3Value2 := 1;
Relay3Value3 := 1;
Relay0 := 1;
Relay1 := 1;
Relay2 := 1;
Relay3 := 1;
END_IF;
IF Cnt1 = 100 THEN
Relay3Value0 := 0;
Relay3Value1 := 0;
Relay3Value2 := 0;
Relay3Value3 := 0;
Relay0 := 0;
Relay1 := 0;
Relay2 := 0;
Relay3 := 0;
Cnt1 := 0;
END_IF;
......@@ -161,10 +161,10 @@ END_PROGRAM
CONFIGURATION config
VAR_GLOBAL
ResetCounterValue : INT := 0;
Relay3Value0 AT %QD1.0 : DINT := 0;
Relay3Value1 AT %QD1.1 : DINT := 0;
Relay3Value2 AT %QD1.2 : DINT := 0;
Relay3Value3 AT %QD1.3 : DINT := 0;
Relay0 AT %QD1.0 : DINT := 0;
Relay1 AT %QD1.1 : DINT := 0;
Relay2 AT %QD1.2 : DINT := 0;
Relay3 AT %QD1.3 : DINT := 0;
END_VAR
RESOURCE resource1 ON PLC
......
......@@ -50,10 +50,10 @@ extern PLC_PRG RESOURCE1__INSTANCE0;
* Declare global variables from resources and conf
**/
extern __IEC_INT_t CONFIG__RESETCOUNTERVALUE;
extern __IEC_DINT_p CONFIG__RELAY3VALUE0;
extern __IEC_DINT_p CONFIG__RELAY3VALUE1;
extern __IEC_DINT_p CONFIG__RELAY3VALUE2;
extern __IEC_DINT_p CONFIG__RELAY3VALUE3;
extern __IEC_DINT_p CONFIG__RELAY0;
extern __IEC_DINT_p CONFIG__RELAY1;
extern __IEC_DINT_p CONFIG__RELAY2;
extern __IEC_DINT_p CONFIG__RELAY3;
extern PLC_PRG RESOURCE1__INSTANCE0;
typedef const struct {
......@@ -63,10 +63,10 @@ typedef const struct {
static dbgvardsc_t dbgvardsc[] = {
{&(CONFIG__RESETCOUNTERVALUE), INT_ENUM},
{&(CONFIG__RELAY3VALUE0), DINT_O_ENUM},
{&(CONFIG__RELAY3VALUE1), DINT_O_ENUM},
{&(CONFIG__RELAY3VALUE2), DINT_O_ENUM},
{&(CONFIG__RELAY3VALUE3), DINT_O_ENUM},
{&(CONFIG__RELAY0), DINT_O_ENUM},
{&(CONFIG__RELAY1), DINT_O_ENUM},
{&(CONFIG__RELAY2), DINT_O_ENUM},
{&(CONFIG__RELAY3), DINT_O_ENUM},
{&(RESOURCE1__INSTANCE0.RESET), BOOL_ENUM},
{&(RESOURCE1__INSTANCE0.CNT0), INT_ENUM},
{&(RESOURCE1__INSTANCE0.CNT1), INT_ENUM},
......@@ -78,10 +78,10 @@ static dbgvardsc_t dbgvardsc[] = {
{&(RESOURCE1__INSTANCE0.COUNTERST0.CNT1), INT_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.CNT0), INT_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RESETCOUNTERVALUE), INT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY3VALUE0), DINT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY3VALUE1), DINT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY3VALUE2), DINT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY3VALUE3), DINT_P_ENUM}
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY0), DINT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY1), DINT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY2), DINT_P_ENUM},
{&(RESOURCE1__INSTANCE0.COUNTERST0.RELAY3), DINT_P_ENUM}
};
typedef void(*__for_each_variable_do_fp)(dbgvardsc_t*);
......
<?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-10-21T16:00:32">
<contentHeader name="Counter (OSIE)" modificationDateTime="2021-10-22T13:55:18">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
......@@ -154,22 +154,22 @@
<INT/>
</type>
</variable>
<variable name="Relay3Value0">
<variable name="Relay0">
<type>
<DINT/>
</type>
</variable>
<variable name="Relay3Value1">
<variable name="Relay1">
<type>
<DINT/>
</type>
</variable>
<variable name="Relay3Value2">
<variable name="Relay2">
<type>
<DINT/>
</type>
</variable>
<variable name="Relay3Value3">
<variable name="Relay3">
<type>
<DINT/>
</type>
......@@ -186,17 +186,17 @@ ELSE
Cnt0 := Cnt0 + 1;
Cnt1 := Cnt1 + 1;
IF Cnt1 = 50 THEN
Relay3Value0 := 1;
Relay3Value1 := 1;
Relay3Value2 := 1;
Relay3Value3 := 1;
Relay0 := 1;
Relay1 := 1;
Relay2 := 1;
Relay3 := 1;
END_IF;
IF Cnt1 = 100 THEN
Relay3Value0 := 0;
Relay3Value1 := 0;
Relay3Value2 := 0;
Relay3Value3 := 0;
Relay0 := 0;
Relay1 := 0;
Relay2 := 0;
Relay3 := 0;
Cnt1 := 0;
END_IF;
......@@ -226,7 +226,7 @@ Out0 := Cnt0;]]></xhtml:p>
<simpleValue value="0"/>
</initialValue>
</variable>
<variable name="Relay3Value0" address="%QD1.0">
<variable name="Relay0" address="%QD1.0">
<type>
<DINT/>
</type>
......@@ -237,7 +237,7 @@ Out0 := Cnt0;]]></xhtml:p>
<xhtml:p><![CDATA[OPC-UA relay 0]]></xhtml:p>
</documentation>
</variable>
<variable name="Relay3Value1" address="%QD1.1">
<variable name="Relay1" address="%QD1.1">
<type>
<DINT/>
</type>
......@@ -248,7 +248,7 @@ Out0 := Cnt0;]]></xhtml:p>
<xhtml:p><![CDATA[OPC-UA relay 1]]></xhtml:p>
</documentation>
</variable>
<variable name="Relay3Value2" address="%QD1.2">
<variable name="Relay2" address="%QD1.2">
<type>
<DINT/>
</type>
......@@ -259,7 +259,7 @@ Out0 := Cnt0;]]></xhtml:p>
<xhtml:p><![CDATA[OPC-UA relay 2]]></xhtml:p>
</documentation>
</variable>
<variable name="Relay3Value3" address="%QD1.3">
<variable name="Relay3" address="%QD1.3">
<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