The Industrial Arduino Compatible Platform Productivity Open has a graphical based programming
option called Productivity Blocks.
If programming Arduino by structured text is not your thing, Productivity Blocks will
convert what you have on the screen to a functioning sketch.
Before you install Productivity Blocks, you will need to install the Arduino IDE, and
if you will be using the Productivity Open industrial hardware modules, you will also
need to install the P1AM Library and the Board Manager option.
First you will need to download the Arduino IDE.
A link to this download is provided in the description below.
Once you have it downloaded, select to install it.
Select the default options.
During this process you will be asked to install the driver interface to Arduino.
When done, open up the Arduino IDE software.
Next, we need to install the Productivity Open Library.
To find more detailed information on the library, please select the link from the description
below.
To install this library, select Sketch, Include Library and then Manage Libraries.
When you see this popup, type in P1AM and you will see this option.
Select to install it.
Now that you have that done, you will see this option here.
Next, we need to add the P1AM to the Board Manager.
To start go to File, then Preference and down here copy select to copy the link from the description below
that is titled Board Manager and paste that into this spot.
Now go to Tools, Board and then Board Manager.
Type in the P1AM and install the P1AM-100 platform.
This may take a couple of minutes to complete.
To verify this installation, power up your Productivity Open system, plug the micro
USB cable into the CPU, go to Tools, Board and then select the P1AM.
Now if you look under Ports you should see the CPU shown like this.
Now let’s install Productivity Blocks.
Before you begin, make sure to close any Arduino IDE windows you have open.
A direct link to download Productivity Blocks can be found in the description below.
Once you have that downloaded,
right-click on the Install File and select Run as Administrator.
When you have that installed, open up the Arduino IDE,
select Tools and then Productivity Blocks.
I find the best way to get started with Productivity Blocks is to just pull up one of the examples.
Go to Open and under Documents you will find this folder.
I am going to show this based upon the Blink Output Point example.
Now this mirrors the basic Arduino IDE sketch.
This is where you declare the P1AM library, which allows you to use the Productivity Open
Industrial IO modules.
Here is the setup function and here is the loop.
In this program, as it is executes, it will turn on and off the output point that resides
on the module, which is in Slot 1, and is the first output on that module.
I am using this rack with these modules and my first output module is in slot 2.
So, I am going back to my Productivity Blocks and change this to 2.
When I select to upload this project,
it will take the graphical layout and convert it into a text-based Arduino sketch in
Arduino IDE.
This takes out the entire worry of the syntax or making sure your text is right.
As you can see, here is your library being called and here is the timing routine from
the Blink Output Point example.
Now, let’s say that you want to edit this program.
Let’s say that we don’t want the output to turn on unless the CPU switch is turned on.
This is simple.
Just go back into Productivity Blocks.
Grab an IF statement from the list of control elements.
Drag that to the start of your loop.
Now drag the Blink Module Block up and connect it to the IF statement.
Go under the P1AM CPU elements, grab the CPU switch and attach it to the condition portion
of the IF block.
Now if the CPU switch is true, the output will blink.
You can continue to add to this graphical display to meet the needs of your project
without having the huge learning curve that comes with using structured text programming.
For more information on Productivity Blocks, please go see the Productivity Block WIKI
from the links below.
If you have any questions on the Productivity Open Platform, please feel free to comment
below or see our online technical community.
Select here to see more videos on the Productivity Open platform and make sure to subscribe to our YouTube
channel for new products and solutions.