Factory I/O with Control I/O: From A to B Basic Solution

A Step-by-Step Tutorial for solving Factory I/O's "From A to B" Scene with Control I/O

This tutorial is part of the series, "Factory I/O with Control I/O". In this series, you can learn PLC programming by programming solutions for a range of common industrial automation applications. By the end of the series, you will have created a portfolio of projects that demonstrate your expertise in PLC programming. You can find all of the content from that series here.

In this tutorial, I will show you how to solve the Factory IO scene "From A to B".

This is a very basic scene that we will use to learn some fundamental concepts about PLCs, PLC programming, Factory IO and Control IO. Since this is the first tutorial in the series, I will take my time to explain concepts in detail. In future tutorials, we will move faster through the basics and only explain the new concepts.

By the end of this tutorial, you will have written and tested your first PLC program using Factory IO and Control IO.

To follow along with this tutorial, you will need to have Factory IO installed on your machine. If you don't already have Factory IO installed on your machine, you can use my affiliate link to start your 30-day trial of Factory IO.

Before we start programming a solution for this scene, let's look at the requirements for this application.

Application Requirements

Factory IO Scene From A to B Overview

In this tutorial, we will program the controls for a roller conveyor. The roller conveyor is equipped with a motor which the PLC can run and stop using a digital output and a photoelectric sensor which detects if a tote is present at the end of the conveyor.

The only requirement for the application is that the conveyor should run when the sensor is not occupied.

Now that we understand the requirements from the application, let's set up our program and start programming a solution.

Open the “From A to B” Scene

Launch Factory IO from the Start Menu of your machine and click on Scenes to open the list of pre-built scenes available for Factory IO.

Open the Scenes list in Factory IO

Click on “1 — From A to B” to open today’s scene.

Open “1 — From A to B”

Launch the Control I/O Editor

Factory IO can communicate with a wide range of PLCs from different manufacturers. To communicate with each PLC, Factory IO uses a dedicated communication driver.

As well as being able to communicate with third party PLCs, Factory IO has a built-in soft PLC, called Control I/O, which can be used to program solutions for scenes. You can write Control I/O programs in the Control I/O editor which is launched automatically when you choose the Control I/O communication driver in a Factory IO scene.

To select the Control IO driver, click on File > Drivers.

Open the Drivers menu with File > Drivers

In the Driver Selection dropdown, chose Control I/O.

Select the Control I/O Driver

After selecting the Control I/O driver, the Control I/O editor opens. This is a graphical code editor that can be used to write PLC programs for Factory IO scenes in a language similar to Function Block Diagram (FBD).

Program the Solution

As discussed in the Application Requirements section, the conveyor should run when the sensor is not occupied.

How can we create that logic in the Control I/O editor?

To start, we can add the inputs and outputs that are required for the application to the Control I/O editor's canvas.

The inputs and outputs for the application are available as tags in the Control I/O editor. A tag is a logical name for a memory location in the PLC. In this application, the input tag "Sensor" contains the status of the photoelectric sensor that is mounted on the end of the conveyor.

Photoelectric cells in Factory IO are "normally-closed" sensors. This means that the Sensor tag has the value True when the sensor is free and the value False when the sensor is free. Although this may seem confusing, it helps the PLC to detect and react to any abnormal situations easily.

Add the Required Tags to the Control I/O Canvas

The output tag "Conveyor" can be used by the PLC to run the conveyor's motor. To run the conveyor, the PLC will write the value True to the Conveyor tag and to stop the Conveyor the PLC will write the value False to the Conveyor tag.

Now that we have added the I/O variables to the canvas, we have to create the logic to control the value of the Conveyor tag based on the status of the Sensor tag.

Luckily for us, there is a direct relationship between the value of the Sensor tag and the Conveyor tag. When the Sensor tag has the value True, the sensor is free and the Conveyor tag should have the value True so that the conveyor runs. When the Sensor tag has the value False, the sensor is occupied and the Conveyor tag should have the value False so that the conveyor stops.

We can copy the value from the Sensor tag to the Conveyor tag by creating a connection between the two tags. We can create a connection between the tags by dragging from the circle on the Sensor tag to the circle on the Conveyor tag.

Create a Connection Between the Tags

The logic for the scene has been implemented. Let's test our program to see if it behaves as expected.

To monitor your code being executed and the model running, you can click on the eye in the top right-hand corner of the Control I/O editor. This makes the code editor opaque so that you can see the Factory IO model in the background.

Enable Opacity for Control I/O Editor

Now you can click the play icon to watch the behaviour of the Factory IO scene.

Click to Play the Scene

As expected, the tote runs to the end of the conveyor and stops when the photoelectric sensor is triggered.

The Box Runs to the End of the Conveyor

You can remove the tote from the conveyor by dragging it and dropping it on the floor. When the sensor becomes free, you should see that the conveyor motor starts running again.

Wrap Up

In this tutorial, we learned how to create a simple PLC program to control a conveyor. Although the program itself was simple, we learned some important things including:

  • How to open a Factory IO scene
  • How to configure the Control I/O driver
  • What are tags and how to use them in a PLC program
  • How to test a PLC program in Factory IO 

In the next tutorial, we will learn how to extend this Factory IO scene and how to write a more advanced PLC program that uses AND and OR logic and the seal-in circuit design pattern.

If you haven't already, sign up to the mailing list below to be notified when that part is available.

Finally, the project files for this tutorial are linked below.

PLC Bootcamp

Learn how to write, test, and simulate your first PLC program for free.

Enroll Free

Learn Something New Every Week

Sign up to the mailing list to get a new post about industrial automation and controls engineering delivered to your inbox every week.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.


PLC Bootcamp

Learn the skills you need to start your journey as a PLC programmer. Enroll in PLC Bootcamp to learn how to write and test your first PLC program for free.