This is part 3 of the PLC programming quickstart. The checklist continues with items 5 and 6. This part will cover PLC programming tools in the development environments . To recap the items covered in the previous two parts.
- I/O Declaration : Find the methods and location of I/O declaration for the PLC program.
- Variable declaration: Find the location and types of variables supported.
- PLC Logic: Check on the location of program organization units (POU’s) . Check on applicability of programs, functions and function blocks.
- Task Configuration: Are the POU’s to be executed organized by task. If so, check on the location functionality of the task manager.
This part will cover 2 more items. Step 5 is to explore the general environment and program language editors. Step 6 is the function in the environment.
5. Environment, Editors, Toolbars
There is often more than one way to do things in the programming environment. Get to know the locations and options of the tools and editor specific functions.
A good starting point is usually the toolbox and toolbars. In SoMachine and CCW, selecting View in the menu bar at the top yields a selection of toolbars and functions available in the environment.
In SoMachine and CCW, the toolbox shows up on the right side of the screen.
The other option for adding objects into a program is using the object icons in the toolbar at the top, below the menus.
Another place to check is the contextual options available when using the right click button. For example, in the ladder environment, right clicking in a rung ( or network as it is referred to in IEC terminology) brings up the objects that can be added.
This also applies to other parts of the environment. For example, right clicking in the device directory brings up items that can be added in a specific context.
This shows us there are often multiple ways to accomplish the same outcome. An coil can be added by dragging and dropping it from the toolbox. A coil can be added by right clicking on the rung/network. A coil can be added from the menu bar at the top.
The right click also pulls up some contextual options in the CCW environment.
Find the way that you feel most comfortable using. There is no right and wrong to it.
6. Functions and libraries
Any task becomes harder without the right tools. For a long time, I was re-creating a periodic ON-OFF function using two timers until I discovered a function called BLINK in CODESYS. The same applied to a simple scaling function block. I later found one already built into SoMachine. The moral of the story is to figure out what is available in the environment early. It will save time and effort. It will reduce the amount of code that gets written.
There are a set of functions that are used in most PLC programs. These include timers, triggers and PID function blocks. Knowing where these functions are and how they are used is next on this checklist.
To find the basic functions:
- check toolbox from previous step.
- if there is a library manager, check the libraries
- review the help files
For instance, in SoMachine, the Util and Toolbox libraries are worth a review. They contain functions to simplify programming..scaling, limit checking, PID,…
They are located in the Library Manager.
Final point about familiarizing with a PLC environment, browse through the help files. There may be details about implementing different functions. The structure of the help files in SoMachine and CCW includes a content list and a search function. Browse through the content list. If anything, this may show you the functions and terminology in the environment.
In summary, the tools and functions in a PLC programming environment will make or break the programming experience. Some key steps on getting up to speed:
- Familiarize yourself and explore the environment prior to starting a project.
- Exploration will include clicking (including right clicks : 0) through all the functions, object and menus on-screen.
- Browse through the functions libraries and toolboxes.
- Browse through the help files.
If a question comes up while doing the above, note it down. Check with the vendor or refer to any example projects that may be available.
Happy programming on your next PLC project!