Pathfinder - Logic Flows for Beginners
This document describes the basics of a Logic Flow for those who are just diving into the world of Pathfinder Core Pro.
If you are looking for some more information about creating a Logic Flow within Pathfinder Core Pro, or some more specifics about the parts involved, there are already a few places you can check out:
Pathfinder Core Pro Manual (Logic Flow Section)
To gain more in-depth knowledge about Logic Flows and how to use them, referencing the above Pathfinder Core Pro manual link will be helpful. However, this article will briefly clarify some of the terms and symbols used within the Logic Flow section for those who are just starting out.
Logic Flow: What is it?
Below is an excerpt directly from the Pathfinder Core Pro manual that describes Logic Flows in detail:
Pathfinder Core PRO’s event system is called Logic Flows, and it enables information visualization so that you can see how things work within your system.
Each Logic Flow can be thought of as an event. More specifically, a Logic Flow is a set of property translations. During an event, we convert an input property value to an output property value.
There are four components that may be used to design a Logic Flow:
A property in the system being monitored for changes.
A property in the system which will be changed by the Logic Flow.
A list of changes that can be applied to the value of a property.
A way to logically combine multiple states using logical operators such as AND, OR, NOT, etc.
Using these tools, you can visually build Logic Flows to accomplish just about any task you want.
Logic Flows, simply put, are a way to sense a condition, and then have that condition trigger an action. For example, if I want to push a button and have it turn on a light, then I would create a Logic Flow that starts by sensing changes in my button, and if it senses that the button is "ON", it proceeds to turn on a light for me.
Simple enough? Let's get a little more specific on how these work now.
Instead of using code with if/then statements and other text-based layouts, Logic Flows are built with a graphical interface, making it much easier for a user to see what is happening visually. These are the visual representations of the components you read about above:
The "Start Point"
the "End Point"
and for some more complex options, the "Combiner"
(not covered in this article)
Break It Down
Let's take our previous example (about pushing a button to turn on a light) and convert it into a Logic Flow. Ultimately, we need to tell the Logic Flow to monitor the state of the button, and then turn the light on if it senses the button has been pushed.
Now, before we get going, we're need to modify this example a little bit and use actual conditions and actions that are available in Pathfinder.
- Instead of watching if a button has been "pushed," we're going to monitor the "state" of the button (simply, "On" or "Off").
- And instead of "turning a light on," we're going to modify the output "state" of a GPIO port. Specifically, we're going to set a pin "low," which, can be used as a way to "switch" our light on.
What is a GPIO? What do you mean "set a pin low?"
In the world of GPIO, there are GPIs (inputs) and GPOs (outputs). There are also "states" of a GPO. Again, think of a light switch. It has an "on" state and an "off" state. GPO states are a little more defined, so they have "low" states and "high" states. A low state would be when the GPO is considered "on" and conducting low-voltage electricity. A high state would be when the GPO is considered "off" and no low-voltage electricity is sending out.
Pathfinder has the ability to sense and change both of these states on Axia GPIO devices.
Let's start by defining what we're monitoring (Start Point), and what we're going to affect (End Point). To do this, we first select an object to monitor:
Double-click the Start Point and choose a device. In this case, I've chosen a button on an iQ console:
Next we double-click the End Point and choose the object that is going to turn the light bulb on. In this case, I've just selected a GPO pin that will turn on our light by changing its pin state from high to low (we'll see how that's done with the Translator after this part):
Now, let's go back to the middle (the Translator) and tell this Logic Flow what we want it to do:
I will select a condition on the left, and an action on the right. If the condition on the left is TRUE, then the action on the right will be executed. In this example, my condition is "ON," meaning if the button is in the "ON" state, then the condition is true. And if the condition is true, the Pin State of the GPO will change to "Low":
How Do We Turn the Light Off?
If you tried to build the above example in a Logic Flow, you'll notice that it allows you to turn the light on, but it does not allow you to turn it off (even when the button state is "OFF"). This is because you need to explicitly tell your Logic Flow to do this.
Let's say we want to make our light turn off by turning our button to an "OFF" state, we would need to do this by simply creating another condition and action within the same Translator:
Let us know how we can help
If you have further questions on this topic or have ideas about improving this document, please contact us.