Multiprog: The AND Structure

This is the second in our series of tutorials for KW multiprog in tandem with the advantech ADAM or APAX units. This tutorial will define the first of our commonly used programming structures, and also explain the concept of variables, and how they are used.

To start off, place a contact network, then click the wire in between the contact and coil, then click the “add contact” button (Image 2.1). This will add a second contact to the rung (A rung is a line of ladder).

Image 2.1 Adding a contact into a network

Once this is done, double click the contact on the left, this will bring up a dialog box (Image 2.2) Adding a name to the name box will cause that contact to be associated with the name given.
This name is called a variable – Multiprog uses these as identifiers to link together different components. For example, if a contact and a coil share the name “X,” If the coil is set(powered / true), the contact becomes true, and if the coil is reset (unpowered / false), the contact then goes to false. In general, it is ok to have several contacts sharing the same variable name, as long as there is only one coil, as having more than one coil will cause only the last one in the ladder to have any effect – it will overwrite any previous coils in the code. (Unless its specifically a set or reset coil, but this will be explained in a future tutorial once it becomes relevant).

Image 2.2 Assigning a variable to a contact

Following this, naming both contacts and the coil as shown in Image 2.3 – gives you the basic AND structure for multiprog : If A AND B are both true, then Y will be set. This is due to the fact that if either A or B are false, they will block the flow from left to right by being open – By proxy, any contacts that have the name Y will also be made true/ false, as these are governed by the coil -This gives us the truth table of

A B C
False False False
False True False
True False False
True True True

Image 2.3 The completed AND Rung

While it may look simple, this structure is one of the two building blocks that will make up pretty much any logic – The other being OR, which will be the focus of the next tutorial (Those of you who are already familiar with logic, will be wondering where the NOT is, fear not, that is also coming soon). Once you are ready, move on to tutorial three for the next step on the road to becoming a PLC programmer!

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!