You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Global variables: All of the 5 programs can access it.
37
38
* Local variables: Only one program has access to it.
38
39
39
40
#### Global Variable
41
+
40
42
Click inside the **Project** tab and click the **Global_vars** section, a table is available to see the full list of global variables on your project.
41
43
42
44
To add a new one, right-click on the table and click the **insert** button.
@@ -61,6 +63,7 @@ Following the same steps explained previously, you can right-click the table, an
61
63
A new variable will be added with default settings, double-click each of them to change them as you need.
62
64
63
65
### Adding Blocks
66
+
64
67
The blocks are features or functions available from libraries and the PLC IDE.
65
68
66
69
These will help you to perform tasks, like AND gates, ADD function, etc...
@@ -71,6 +74,7 @@ To add a block to your program (only possible with LD, SFC, FBD) you can drag an
71
74
Once you drag and drop it on your canvas it will generate a block with some input and output pins fully customizable, most of the time you can right-click the block and add more pins in case you need more than the default.
72
75
73
76
### Task Attachment
77
+
74
78
Once you have your programs you can attach them to a task inside the runtime.
75
79
76
80
There are 4 Tasks:
@@ -100,10 +104,28 @@ Inside the **Tool window** you can drag and drop variables, or click the **Inser
100
104
101
105

102
106
107
+
### Library Management
108
+
109
+
In contrast to the conventional Arduino IDE, the PLC IDE manages the library add-on and usage differently. To add the desired library, go to **Resources** tab and click the **Libraries** listed under the **Sketch**.
110
+
111
+

112
+
113
+
With the 'Sketch Libraries' window open, click the **Add** option and fill out the library name. You will have to fill in the needed library version as well.
114
+
115
+
For example, if you want to add the 1.1.1 version of the 'Arduino_MachineControl' library, respective information must be introduced to its fields accordingly.
116
+
117
+
It is possible to find this information using the [Arduino Library List](https://www.arduinolibraries.info/) or referencing the indexed library on your development environment if you have downloaded it to use within Arduino IDE. By navigating manually to the local libraries directory on your development environment, you can access the meta-data from the 'library.properties' of the desired library.
118
+
119
+
***Currently only publicly available libraries can be added to the PLC IDE Arduino Sketch, and you can check its availability by searching in the [Arduino Library List](https://www.arduinolibraries.info/).***
120
+
121
+
Once you have followed the previous steps, the libraries will be available for use. A library of choice can be removed by clicking on the **Remove** option within the 'Sketch Libraries' window.
122
+
103
123
## Sample Program
124
+
104
125
The program will be a simple counter, increasing the count by X over time.
105
126
106
127
### Arduino Sketch
128
+
107
129
```cpp
108
130
int count = 0;
109
131
constint addition = 1;
@@ -115,6 +137,7 @@ void loop(){
115
137
```
116
138
117
139
### IEC-61131-3 Languages
140
+
118
141
To create a new program open your project tab, go to the toolbar **Project > New object > New program**, set a name for your program and select its language.
119
142
120
143

@@ -131,6 +154,7 @@ There are 5 languages available:
131
154
* Function Block Diagram (FBD)
132
155
133
156
### Structured Text
157
+
134
158
This language is similar to C, the code to assign a value to a variable is the following:
135
159
```
136
160
count := count + addition;
@@ -139,6 +163,7 @@ count := count + addition;
139
163

140
164
141
165
### Instruction List
166
+
142
167
This programming language is similar to Assembly programming.
143
168
144
169
The code for a counter script is:
@@ -151,6 +176,7 @@ ST count
151
176

152
177
153
178
### Ladder Diagram
179
+
154
180
This programming environment is based on lines and blocks, a line has a path from left to right that needs to pass all the in between blocks in order to continue towards the right, if it does pass all the different blocks (like AND gates) it will end on the right on a brackets symbol (coil) triggering whatever you have set up to do, which could be for example a relay latching to Normally-Open (NO).
155
181
156
182
This is how a counter program looks:
@@ -160,18 +186,21 @@ Here is a video doing that from scratch:
160
186
<iframewidth="100%"height="415"src="https://www.youtube.com/embed/0EdATSgIc9o"title="YouTube video player"frameborder="0"allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen></iframe>
161
187
162
188
### Sequential Function Chart
189
+
163
190
This language approaches the script in a similar way as a flowchart, meaning you have blocks that do some work, you check the result of that work, and afterward you keep flowing with the choices.
164
191
165
192
SFC language can not interact directly with the machine, meaning you can not make an output be OFF directly, to do so you will need to create **actions**
166
193
167
194
#### Actions
195
+
168
196
An action is a script in another language (i.e. structured text) that performs the work, this will get triggered depending on the chart.
169
197
170
198
To create one go to your project tree, right-click the SFC script and click the "New action" button.
171
199
172
200

173
201
174
202
#### SFC Program
203
+
175
204
You have blocks available by right-clicking inside the canvas or on the top bar, you can drag and drop them.
176
205
177
206
The SFC program has one rule which is following the order of **Step<sub>0</sub> > Transition<sub>0</sub> > Step<sub>n</sub> > Transition<sub>n</sub> > ... > Jump**
@@ -187,6 +216,7 @@ Here is a video doing that from scratch:
187
216
<iframewidth="100%"height="415"src="https://www.youtube.com/embed/olQooS4bX4A"title="YouTube video player"frameborder="0"allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen></iframe>
188
217
189
218
### Functional Block Diagram
219
+
190
220
This is similar to the SFC Programming, but in this case there is no sequential path on the program, you add blocks to do the needed work.
191
221
192
222
For example, adding the **Add** block will do the Add function each cycle.
@@ -200,6 +230,7 @@ Here is a video doing that from scratch:
200
230
***In the previous programs, we used local variables, remember to select the program's specific variables to be watched, or you will not see any data***
0 commit comments