Start with Ladder Logic in IECuino
In this post, we are going to explain to you how to start with Ladder Logic once your project is created. After that, you have to access to the working area. Within the project environment, if we do not have any file yet, the system displays a message indicating it and inviting us to create it.
The first thing you need to do to start with Ladder Logic is creating one of the following elements which you are going to work with:
– Ladder Diagram
– Arduino Code
– Global Variable List
– IO Mapping
Just click on the plus icon on the left and choose the element that you want to create.
Ladder Diagram for Arduino to start with Ladder Logic
Your ladder diagram will be placed under the Task List. You just need to click on the ladder that you want to work to jump from one to another. When you are working on ladder diagram, you can add sections from the + icon on the left.
You need to write the name and add a section. When a section is created, the icon to create a new one moves just down the section created.
You can also see two icons at the right of the section created. With the delete icon, you can remove the section from your diagram, and you can change the name using the settings icon.
Just below the header, there are some tabs that will allow you to choose if you want to work with basic nodes or communication nodes (available soon).
When you are working with ladder diagram, you have the block icons available and ready to add to your section.
You can add blocks by dragging and dropping with a mouse or using a keyboard. Notice that -in brackets- you can see the keyboard shortcut to add the element to the ladder diagram. It is important to remember these keyboard shortcuts because it allows you to program much faster than with the mouse.
There are blocks that can be placed anywhere in the diagram, but the last three blocks (coil, timer and counter) can only be placed as an exit in the last, and more to the right position in the diagram.
When you drop an element into the diagram or select a current element, the properties of the selected element appear on the right of the interface.
You can establish a relation between the element and a global variable present in your Global Variable List file.
You can also add comments in case you need them.
Arduino’s code for Ladder Logic in IECuino
When programming with Arduino code in the IECuino environment, take into account that you do not need to use the usual loop.
Global Variable List (GVL)
By clicking on the plus icon close to Application, you can create new elements. If you create a GVL (Global Variable List), this element will be placed below the Application slot.
By clicking on the plus icon on the right you can create the variables.
You need to write the name of the variables WITHOUT spaces.
Choose the variable type (you have 17 different variables types) and add some comments, in case you need it.
It is always good to use adequate variable names.
The variables created here will be available to use on the ladder diagram and the IO Mapping.
With the icons placed on the right side, you can delete or edit the variables, changing the name, type or description.
If you want to delete a variable, remember that you must always confirm it by writing DELETE
IO Mapping of the Arduino device
By clicking on the plus icon close to Application you can create new elements, a new File.
If you create an IO Mapping, this element will be placed below the Device slot.
Once created, you can start working with them.
New IO Mapping
By clicking on the plus icon on the right, you can create the IO Mapping of your project.
First, you need to choose if it’s INPUT or OUTPUT and then the corresponding number along with the variable assigned.
Edit or Delete
With the icons placed on the right-hand side, you can delete or edit the IO Mappings, change the name, type or description.
If you want to delete an element, remember that you need always to write DELETE.