Click here to learn the biblical way to get to heaven! (The most important page on this site)
You can have your very own virtual server though VPSLink! Using REFERRAL code MJDCDJ you will receive a 10% discount on
your new account, and I will get a service credit on my account. My personal preference is the Link 2 package running XEN for starting out (You can upgrade any time). You can choose from a variety of Linux distributions such as CENTOS, Fedora, Debian, and Ubuntu. This is a great package for learning Linux,
and setting up your own web page, or email server.
Working With Tags
Tags are variables that your program reads and manipulates. There are two types of Tags: Controller tags, and Program tags.
Controller tags are GLOBAL, which means that any program or any controller can read or write to the tag. Program tags are LOCAL to the program they reside in.
Controller Tags:
If one program needs to communicate with another program, you would use a Controller Tag that each program can read from or write to. For this example, lets say a conveyor has three segments. Each segment has it's own program. When an E-Stop button is pressed, we would want all sections to shut down. Therefore the ESTOP would be a GLOBAL tag.
Look at the following example:

Each program has it's own tag database, that no other program can access, but if a program writes a value to a Controller Tag, any program can access the tag.
For this example, I've created a new project called conveyor with an input module in slot 5 and an output module in slot 6.
Open the Controller Tag Database, and be sure 'Edit Tags' is selected. Declare the tag called Estop_Condition, with a BOOL data type. The BOOL data type means one bit of information is to be stored. This is similar to a B3 bit in a PLC or SLC. Press enter.

Program Tags
Program tags are local to the program they reside in. One main advantage of program tags is that we can create one program and copy it multiple times. The exact stame program tags can be used in each instance of the program. This makes the process of building logic for similar pieces of equipment very simple.
Right click on the main program and choose 'Properties' Rename MainProgram to Conveyor_Control.

Right click on the MainTask to add a new program. The name of your program is Section_1.

Expand Section_1 and open the Program Tags. Notice there are no tags in the program tag database. At the bottom of the tag editor screen, be sure 'Edit Tags' is selected.

Set up three program tags as shown. Pay attention to the Data Type. The data type of the tag specifies the way the data is structured within the tag. A BOOL data type will store 1 bit of information, and a DINT (Double Integer) data type will store 32 bits of information (This is usually used for numbers)

Now, let's add some logic: Right click the Section_1 program and add a new routine.

The name will be MainRoutine, then press OK.

We named this the MainRoutine, but did not configure it as the MainRoutine yet. Every program needs to have a main routine. That is the routine the processor scans within the program. You will notice in the controller organizer window, there is no 1 on the ladder icon yet. Right click the Section_1 program and go to properties. Click the Configuration tab. In the Pull down menu next to Main, choose the MainRoutine. Apply your changes, then press OK.

Notice the MainRoutine is now has a 1 on it...

Open the MainRoutine, and add the following logic using the drag and drop method:

The question marks indicate that we need an address on each instruction. Double click the question mark on the XIC,and click the pull down tab.
Be sure Controller Tags is selected. Expand Local:5:I, and click the pull down tab next to data to reveal all 32 bits. Choose bit 0.

For the XIO, choose the ESTOP Tag.

For the OTE, Choose 'Section Running' as a Program scoped tag.

Now that we have one complete program (Or as complete as we need it for example... Let's copy the program and use it for other sections of the conveyor.
Right click the Section_1 program and choose 'Copy'. Right click on the 'MainTask' and choose paste. Then right click the 'MainTask' again, and paste a second time.

This gave us a total of 3 copies of the same program. Right click on Section_11, go to the properties, and rename it to Section_2. Right click Section_2, go to properties, and rename to Section_3. When finished, your project will look like this:

Now all we have to do is go back and change the I/O in each program to reflect the actual switch that turns on the conveyor for that section, and if we had it set up... The output the logic writes to. All the internal bits are already written for us, and the program structure is in place.