Multiprog: The OR Structure

This step of the tutorial will introduce you to another new structure, and briefly touch on the idea of scope, which will be important when we come to discuss the ideas behind function blocks.Now, we will be adding an OR type structure, which will be explained shortly. First, add a new network to the page, then click the contact, followed by the “add Contact below” button (Image 3.1).

Image 3.1 The add contact below button

Doing this will put a second contact in parallel with the first. Name these two contacts A and B, and the coil Z – Note that in the dialog box, you can click the arrow to bring up a drop down menu with all of the previously used variables (Image 3.2).Up until now, we haven't mentioned the right hand side of this box – This is to select the scope of the variable. Scope is a fairly important topic, but the explanation will have to wait until later, as it won't make a lot of sense without the right context. For now, all you need to know is that local variables are only accessible from the current function block, whereas global variables can be accessed from anywhere in the program (And seen on the global variables tab in the project tree window). Once a project starts to use multiple function blocks, the idea of scoping comes into play a lot more heavily.

Image 3.2 The variable selection drop down

Once you have followed the instructions, you should have something that looks like Image 3.3.

Image 3.3 The completed OR Network

This is known as an OR structure, because the two contacts are in parallel, which means if either of them are true (closed) then power can flow through to the coil Z. The following truth table applies to this type of structure.

False False False
False True False
True False True
True True True

The OR structure is the second of the two basic structures involved in ladder logic – Some of you may have noticed that they are simply the effects of what happens when you put components in series or parallel – While this is true, Everything from now on will either be in series or parallel, meaning a firm grasp of these two concepts is fairly important to proceed. Using these two rules will allow you to build much bigger, more complex structures, that utilise the principles in interesting ways, such as the subject of the next tutorial, the latch.

Joel Duncan

Read more posts by this author.

Subscribe to Bubble Automation Blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!