exercise 3 online operations - lab-volt data files user-defined data files file type identifier file...

22
3-1 Exercise 3 Online Operations EXERCISE OBJECTIVES To download a project to a PLC. To run and test a PLC ladder program. To monitor data files while the PLC is in the Run mode. To modify a PLC ladder program. To test the modified PLC ladder program. DISCUSSION Data File Organization The data files are the part of the PLC memory that contains I/O values and files where data is monitored, manipulated, and modified for control purposes. As Table 3-1 shows, there are several types of data files. Each type is represented by a letter identifier and a file number. DEFAULT DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE NUMBER FILE TYPE IDENTIFIER FILE NUMBER Output O 0 Bit B Input I 1 Timer T Status S 2 Counter C 9 - 255 Bit B 3 Control R Timer T 4 Integer N Counter C 5 Control R 6 Integer N 7 Float F 8 Table 3-1. Types of data files. The data files are divided into 16-bit word elements. As Figure 3-1 shows, some data files consist of single-word elements, while some consist of 3-word elements. Input and Output data files are single-word elements. Each used bit in an input or output file element represents the status of a PLC input or output. In the case of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, bits b 0 through b 13 of input file word I:0.0 represent the status of the 14 PLC inputs. Bits b 0 through b 9 of output file word O:0.0 represent the status of the 10 PLC Trainer outputs. Counter and Control data files are 3-word elements. Word 0 contains bit status information. Words 1 and 2 contain the preset and accumulated values (for timer and counter files) or the length and position values (for control files).

Upload: vutuyen

Post on 04-Apr-2018

250 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

3-1

Exercise 3

Online Operations

EXERCISE OBJECTIVES

• To download a project to a PLC.• To run and test a PLC ladder program.• To monitor data files while the PLC is in the Run mode.• To modify a PLC ladder program.• To test the modified PLC ladder program.

DISCUSSION

Data File Organization

The data files are the part of the PLC memory that contains I/O values and fileswhere data is monitored, manipulated, and modified for control purposes. AsTable 3-1 shows, there are several types of data files. Each type is represented bya letter identifier and a file number.

DEFAULT DATA FILES USER-DEFINED DATA FILES

FILE TYPE IDENTIFIERFILE

NUMBERFILE TYPE IDENTIFIER

FILE

NUMBER

Output O 0 Bit B

Input I 1 Timer T

Status S 2 Counter C 9 - 255

Bit B 3 Control R

Timer T 4 Integer N

Counter C 5

Control R 6

Integer N 7

Float F 8

Table 3-1. Types of data files.

The data files are divided into 16-bit word elements. As Figure 3-1 shows, some datafiles consist of single-word elements, while some consist of 3-word elements.

• Input and Output data files are single-word elements. Each used bit in an inputor output file element represents the status of a PLC input or output. In the caseof the PLC used on the Lab-Volt PLC Trainer Model 3240-2, bits b0 through b13

of input file word I:0.0 represent the status of the 14 PLC inputs. Bits b0 throughb9 of output file word O:0.0 represent the status of the 10 PLC Trainer outputs.

• Counter and Control data files are 3-word elements. Word 0 contains bit statusinformation. Words 1 and 2 contain the preset and accumulated values (for timerand counter files) or the length and position values (for control files).

Page 2: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-2

• Integer files are single-word elements.

Figure 3-1. PLC data file organization.

Instruction Addressing

The address you specify for an instruction when entering a ladder program dependson the type of data file used to store the instruction status. You can address data fileelements, words, or bits. The address format depends on the type of addressed file.Table 3-2 indicates the address formats that can be used to program the PLC onyour Lab-Volt PLC trainer. As the table shows, addresses consist of alphanumericcharacters separated by delimiters (colon, slash, and period):

• colons [:] are used to separate a file type and number;

• slashes [/] are used to separate a bit from an element or word;

• periods [.] are used to separate an element from a word within that element, ora word from a slot number.

Figure 3-2 shows examples of instruction addresses.

Page 3: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-3

FILE TYPE ADDRESS FORMAT EXPLANATION

Output O:e/bO = Outpute = Slot number (0 for the PLC Trainer)b = Output terminal number (0 to 7)

Input I:e/bI = Inpute = Slot number (0 for the PLC Trainer)b = Input terminal number (0 to 11)

Status S:e/bS = Statuse = Element number (0 to 15)b = Bit location within the element

BitBf:e/b

OrBf/b

B = Bitf = File number (3 is the default number)e = Element number (0 to 255). 1-word

elements, 16 bits per element.b = Bit location within the file

TimerTf:e.s

OrTf:e/b

T = Timerf = File number (4 is the default number)e = Element numbers = Word (1 or PRE for preset value, 2 or ACC

for accumulated value)b = Bit location within the element

CounterCf:e.s

OrCf:e/b

C = Counterf = File number (5 is the default number)e = Element numbers = Word (1 or PRE for preset value, 2 or ACC

for accumulated value)b = Bit location within the element

Control Rf:eR = Controlf = File number (6 is the default number)e = Element number

Integer Nf:e/b

N = Integerf = File number (7 is the default number)e = Element number (0 to 255)b = Bit location within the element

Table 3-2. Address formats.

Figure 3-2. Various instruction addresses.

Note that data files of the Bit type are bit stream continuous files. Therefore, you canaddress bits by specifying an element (word) and a bit (Word/Bit method), or by

Page 4: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-4

specifying a bit alone (Sequential method). For example, word/bit address B3:5/10and sequential address B3/90 physically designate the same memory location.

PLC Input and Output Interfaces

PLC input interface

The trainer PLC contains an internal input interface that permits activation of the PLCinputs, using the signals provided by 24-VDC or AC-line rated input devices, suchas pushbutton switches or sensors.

Figure 3-3 shows the PLC input interface. (See the table that follows this figure fora description of the interface elements). The interface card has 14 input terminals(labeled IN 0 through IN 13) associated to the 14 PLC inputs. When a PLC input isactivated, the processor sets the corresponding bit to logic state 1 in its input datafile. The processor then determines whether the program instructions having theaddress of this bit are true or false.

Each input terminal of the card is connected to a pair of PLC input jacks mounted onthe trainer front panel, to permit activation of the PLC inputs with either a 24-VDC orthe AC-line voltage.

There are several ways to activate a PLC input:

• By connecting the positive (red) jack of one of the seven switches on the trainerfront panel to any of the 24-VDC PLC input jacks on this panel. In Figure 3-3, forexample, pushbutton switch 1 of the trainer is connected to PLC input jack 1.Pressing the switch pushbutton causes a DC voltage of 24 V to be applied toinput jack 1 and, therefore, to terminal 1 of the interface card. This in turn causesPLC input 1 to become activated, and the processor to set the input data file bitat address I:0/1 to logic state 1.

• By connecting an external input device able to provide a DC voltage of 24 V toany of the 24-VDC PLC input jacks. In Figure 3-3, for example, a mechanical limitswitch is connected to PLC input jack 4. When the limit switch is activated, itscontacts close, causing a DC voltage of 24 V to be applied to PLC input jack 4and, therefore, to terminal 4 of the interface card. This in turn causes PLC input 4to become activated, and the processor to set to logic state 1 the input data filebit located at address I:0/4. (Note that the positive terminal of the external24-VDC source could also be connected directly to any of the 24-VDC PLC inputjacks to activate PLC inputs.)

• By connecting an external input device able to provide the AC line voltage to anyof the AC-line PLC input jacks. In Figure 3-3, for example, a pressure switch isconnected to PLC input jack 6. When the pressure switch is activated, its contactsclose, causing the AC line voltage to be applied to PLC input jack 6. This voltageis converted into a DC voltage of 24 V by an AC-line to 24-VDC converter. The24-VDC voltage is applied to terminal 6 of the interface card, causing PLC input 6to become activated, and the processor to set to logic state 1 the input data filebit located at address I:0/6. [Note that the line (L) terminal of the external AC-linevoltage source could also be connected directly to any of the AC-line PLC inputjacks to activate PLC inputs.]

Page 5: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-5

Figure 3-3. PLC input interface (PLC Trainer Model 3240-2).

INPUT INTERFACE ELEMENT DESCRIPTION

1 Input interface card2 Front-panel 24-VDC input jacks3 Front-panel AC-line input jacks4 Trainer front-panel pushbutton switch 15 Program instruction I:0/16 24-VDC mechanical limit switch (external)7 External 24-VDC source8 Program instruction I:0/49 AC-line rated pressure switch (external)10 External AC-line voltage source11 Program instruction I:0/6

Table 3-3. Description of the elements of the input interface card (refer to Figure 3-3).

Page 6: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-6

PLC output interface

The trainer PLC contains an internal output interface that permits external devicessuch as motors, lamps, and solenoids to be energized or de-energized throughcontrol relays, as the controller program is executed.

Figure 3-4 shows the PLC output interface. (See the table that follows this figure fora description of the interface elements) The interface card has 10 output terminals(labeled OUT 0 through OUT 9) corresponding to the 10 PLC outputs. When an

output (OTE) program instruction becomes true, the processor sets to logic state 1the corresponding bit in its output data file. This causes the correspondingPLC output to become activated.

Each output terminal of the card is connected to a relay solenoid (CRx), and also toa lamp (Lx) mounted on the trainer front panel. These two devices are energizedwhen the associated PLC output is activated. Each relay solenoid controls two setsof contacts connected to a pair of PLC output jacks on the trainer front panel: thispermits the energizing of an output device at either 24-V DC or the AC-line voltage.

– When toggle switch V1 on the trainer front panel is set to the 24-VDC position, aDC voltage of 24 V is applied to those within PLC output jacks 0 through 4 whoseassociated PLC output is activated. When switch V1 is set to the AC-line position,the AC line voltage is applied to those within PLC output jacks 0 through 4 whoseassociated PLC output is activated.

– Similarly, when toggle switch V2 on the front panel is set to the 24-VDC position,a DC voltage of 24 V is applied to those within PLC output jacks 5 through 9whose associated PLC output is activated. When switch V2 is set to the AC-lineposition, the AC line voltage is applied to those within PLC output jacks 5 through9 whose associated PLC output is activated.

In Figure 3-4, for example, switch V1 is set so as to energize the devices connectedto PLC output jacks 0 through 4 with the AC line voltage, while switch V2 is set soas to energize the devices connected to PLC output jacks 5 through 9 with aDC voltage of 24 V.

• When program instruction OTE O:0/1 becomes true, the processor sets thecorresponding bit to logic state 1 in its output data file. This causes PLC output 1to become activated. Consequently, the AC-line voltage is applied to the motorconnected to PLC output jack 1, while lamp 1 next to this jack turns on.

• When program instruction OTE O:0/6 becomes true, the processor sets thecorresponding bit to logic state 1 in its output data file. This causes PLC output 6to become activated. Consequently, a DC voltage of 24 V is applied to thehydraulic valve solenoid connected to PLC output jack 6, while lamp 6 next to thisjack turns on.

Page 7: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-7

Figure 3-4. PLC output interface (PLC Trainer Model 3240-2).

Page 8: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-8

OUTPUT INTERFACE ELEMENT DESCRIPTION

1 Output interface card2 Output relay solenoids3 Front-panel output lamps4 Front-panel output switches (V1 and V2)5 Output relay contacts6 24-VDC output jacks7 AC-line output jacks8 Program instruction OTE O:0/19 AC-line rated motor (external)10 Program instruction OTE O:0/611 24-VDC hydraulic valve solenoid

Table 3-4. Description of the elements of the input interface card (refer to Figure 3-4).

Downloading a Project to a PLC

To download a project to the memory of the MicroLogix PLC on your trainer, youmust first connect the computer used to run RSLogix 500 to the PLC, via a serial1761-CBL cable. The project can then be downloaded by completing the followingsteps:

• Make sure that the system communications are configured in such a way as toensure proper communication between the computer that runs RSLogix 500 andthe PLC. The recommended protocol is DF1 full duplex.

• Download the project to the PLC.

Note: The PLC must be in the Program mode of operation in order for a projectto be downloaded. A project cannot be downloaded to the PLC while the PLCis in the Run mode.

Once the project has been downloaded to the PLC, the computer that runs

RSLogix 500 can go online. A device is said to be online when it is in direct

communication with the PLC. For example, the computer that runs RSLogix 500must be online to change the mode of operation of the PLC. A device is said to beoffline when it is not in direct communication with the PLC. For example, thecomputer that runs RSLogix 500 is offline when a ladder program is created oredited.

PLC (Processor) Modes of Operation

The PLC processor includes the following modes of operation: Run, Program, and

Test. The mode of operation can easily be changed by using RSLogix 500.

Run Mode

In this mode, the processor monitors the status (activated/deactivated) of the PLCinputs, scans and executes the ladder program and, depending on which PLCoutputs are activated, energizes the proper relays of its output interface in order fora voltage to be applied to the associated PLC output devices. While the processor

is in the Run mode, you can monitor the ladder program as it is executed. However,you cannot edit the ladder program. You can also monitor and edit data files onlinewhen the processor is in the Run mode.

Page 9: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-9

Program Mode

The Program mode allows you to edit and/or modify a ladder program. In this mode,the processor does not scan or execute the ladder program. All PLC outputs aredeactivated, regardless of the current status of the output data file bits. You can usethe Program mode to monitor and edit a ladder program offline. You can also usethis mode to monitor and edit data files offline.

Test Mode

In this mode, the processor operates as described in the Run mode, and you canperform the same operations, except that the relays of the PLC output interface arenot energized. The following program tests can be performed:

• Continuous Scan: the processor continuously scans the PLC inputs and executesthe ladder program, but it does not energize the relays of the PLC outputinterface. This prevents voltage from being applied to the PLC output devices.

• Single Scan: the processor executes a single operating cycle, which includesinput reading and program execution, but it does not energize the relays of thePLC output interface.

Procedure Summary

In this exercise, you will create a new project from a project previously saved to aproject file. You will verify the configuration of the system communications. You willdownload a project to the PLC of the PLC Trainer and go online. You will place thePLC in the Run mode and test the ladder program. You will then go offline, modifythe ladder program, and save the new program to a project file. You will downloadthe new program to the PLC and test it. You will perform online editing of data. At theend of the exercise, you will clear the PLC memory.

Note: As earlier mentioned, the manual applies specifically to PLC TrainerModel 3240-2. If you are using another model, follow the exercise procedure byadapting it as described below.

• Model 3240-1: When asked to activate a PLC input, depress thecorresponding AC-line pushbutton on the trainer front panel. When askedto deactivate a PLC input, release the corresponding AC-line pushbutton onthe trainer front panel. To determine whether or not a PLC output isactivated, you can observe the PLC output status indicators on thePLC module, or you can connect the trainer AC-line voltage source to thesupply terminals used for powering the PLC output devices and observe thestatus (lit or off) of the PLC output lamps on the trainer front panel.

• Model 3240-A or Model 3240-3: You can activate a PLC input in either ofthe following ways:

– By connecting the jack of this PLC input to the positive (red) jackof a pushbutton switch on the trainer front panel. The PLC inputcan then be activated by depressing the switch’s pushbutton,and de-activated by releasing the pushbutton.

Page 10: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-10

– By connecting the jack of this PLC input to the positive (red) jackof a toggle switch on the trainer front panel. The PLC input canthen be activated by moving the toggle upward, and de-activatedby moving the toggle downward.

– By connecting the jack of this PLC input to the positive (red) jackof the trainer’s 24-VDC source.

• Model 3270-4: Connect an external 24-VDC source to the supply jacksintended for this purpose at the left bottom of the trainer front panel. Whenasked to activate a PLC input, connect the corresponding PLC input jack tothe positive terminal of the 24-VDC source, using a connection lead. Whenasked to deactivate a PLC input, remove the lead between thecorresponding PLC input jack and the 24-VDC source. To determinewhether or not a PLC output is activated, observe the PLC output statusindicators on the PLC module.

• Model 3270-1: When asked to activate a PLC input, connect thecorresponding PLC input jack to the positive terminal of an external 24-VDCsource, using a connection lead. (The common jack of the PLC inputinterface must be connected to the common of the 24-VDC source). Whenasked to deactivate a PLC input, remove the lead between thecorresponding PLC input jack and the 24-VDC source. To determinewhether or not a PLC output is activated, observe the PLC output statusindicators on the PLC module.

• Model 9066, connect the DC COM jacks (2) to the DC SUPPLY OUTPUTnegative terminal. To activate a PLC input, connect the corresponding PLCinput jack to the positive terminal of the DC SUPPLY OUTPUT. Todetermine whether or not a PLC output is activated, you can see it on theLCD display default page (if not on this page, press ESC and select I/Ostatus. To act on a physical device, connect VAC/VDC jacks to the positiveterminal of the DC SUPPLY OUTPUT if you are are using the two firstoutputs or connect DC 24 + and DC 24 V - to the corresponding terminalsof the DC SUPPLY OUTPUT to use last four outputs.

EQUIPMENT REQUIRED

Refer to the Equipment Utilization Chart, in Appendix A of this manual, to obtain thelist of equipment required to perform this exercise.

PROCEDURE

Setting Up the Equipment

G 1. Connect the RS-232 serial port of the computer station to thecommunications port of the PLC on the PLC Trainer, usinga 1761-CBL cable. Figure 3-5 shows the interconnection of the equipmentwith PLC Trainer model 3240-2.

Page 11: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-11

Note: The interconnection is the same for the standalone PLCModel 3270-4. For the PLC Trainer Model 3240-1 or thestandalone PLC Model 3270-1, connect the RS-232 serial port ofthe computer station to the Lab-Volt PC Interface, Model 3246.Then, connect the PC Interface to the communications port of thePLC on the PLC Trainer, using a 1747-C10 cable. (Refer to theAppendix section dealing with the model you are using, ifnecessary).

G 2. Turn on the computer and start RSLogix 500.

Turn on the PLC Trainer.

Figure 3-5. Interconnection of the computer running RSLogix 500 to the Lab-Volt PLC Trainer,

Model 3240-2, using a 1761-CBL cable.

Page 12: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-12

Creating a New Project from an Already Existing Project File

G 3. Open project file EXERC_2.RSS that you created and saved in the previousexercise of this manual.

G 4. Choose the Save As command in the File menu to open the Save Program

As dialog box.

Change the filename to: EXERC_3. In the File PLC Information section ofthe dialog box, change the processor name to EXERC_3.

Click the Save button to save the project created in the previous exercise

to a project file named EXERC_3 and close the Save Program As dialogbox.

Observe that the project tree and program file LAD 2 of processorEXERC_3 are displayed in the RSLogix 500 window. This indicates thatproject EXERC_3 is in the computer memory.

Verifying the Configuration of System Communications

G 5. Before downloading a program to a PLC, the configuration of the systemcommunications must be verified to ensure proper operation of the system.

To do so, choose the Options command in the Tools menu to open the

System Options dialog box.

G 6. Click the System Communications tab in the dialog box to open thecorresponding folder.

The Driver should be an AB_DF1-1 and the Processor Node should be set

to 1, unless otherwise specified by your instructor.

Click the OK button to close the System Options dialog box.

Note: If you are using the former PLC Trainer Model 3240-1 orthe standalone PLC Model 3270-1, the Driver should be anAB_PIC-1 and the Processor Node should be set to 1.

Downloading a Project to a PLC and Going Online

G 7. Observe that the Online bar (upper leftmost scrollable bar in the Onlinesection of the RSLogix 500 window) indicates that RSLogix 500 is offline.

To download project EXERC_3 to the PLC of the PLC Trainer, choose the

Download command in the Online bar drop-down list.

The Revision Note dialog box will appear. Click OK to close it. This startsthe RSLinx application (its entry window is displayed briefly on the computerscreen). This application manages system communications.

Page 13: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-13

Note: When the RSLinx application is launched, it stays behindthe RSLogix 500 application.

A message box will then appear, asking a confirmation before downloading

project EXERC_3 to the PLC memory. Click the Yes button to close themessage box and start downloading the project to the PLC.

Note: If the PLC is currently in the RUN mode at that point, amessage box will appear, prompting you to switch the processor

to the PROG mode. Click the Yes button to continue thedownloading. Another message will then appear, prompting you

to change back to Run mode. Click the No button.

Once the project has been downloaded to the PLC memory, anothermessage box will appear, asking if you want to go online (or if you want tochange back to the Run mode, if the PLC were already in this mode). Click

the Yes button to go online.

Observe that the ladder icon in the Online bar rotates. This indicates thatRSLogix 500 is in direct communication with the PLC.

Changing the PLC Mode of Operation

G 8. Notice that the Online bar now indicates "REMOTE PROG". This meansthat the remote device, that is, the PLC, is in the Program mode ofoperation. In this mode, the PLC does not execute the ladder program.

What must be done in order for the PLC to execute the program?

G 9. Open the Online bar drop-down list and choose the Run command.

A message box should appear asking for a confirmation before switching

the PLC mode of operation to Run. Click the Yes button to close the

message box and place the PLC in the Run mode.

G 10. Observe that the Online bar now indicates "REMOTE RUN". This means

that the remote device, that is, the PLC, is in the Run mode of operation.Also, observe that the power rails in ladder program LAD 2 are highlighted

to indicate that the PLC is in the Run mode. Finally, observe that the RUNstatus LED on the PLC module is lit.

Page 14: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-14

Testing the Ladder Program

G 11. Open data file I1 - INPUT and position the corresponding window at thebottom of the RSLogix 500 window.

Observe that data file I1- INPUT contains 16-bit words, bits 0 through 13 ofinput file word I:0.0 corresponding to the 14 inputs of the PLC. Opening thisfile allows you to monitor the input file bits when you test the ladderprogram.

G 12. On the PLC Trainer, activate PLC input 0. To do so, connect the positive(red) jack of toggle switch 4 on the trainer front panel to the 24-VDC PLCinput jack 0 on this panel. Set the toggle of switch S4 upward, which willcause a DC voltage of 24 V to be applied to PLC input jack 0. While doing

this, observe data file I1 - INPUT and the ladder program:

– Observe that input file bit 0 (I:0.0/0) goes to logic state 1, indicating thatPLC input 0 is activated.

– Also, observe that instructions XIC I:0/0 in rungs 0 and 1 of the ladderprogram are highlighted, indicating that they are true.

Note: As earlier mentioned, the procedure applies to PLC TrainerModel 3240-2. If you are using another trainer model, activate ordeactivate a PLC input by referring to the Procedure Summary.

G 13. On the PLC Trainer, deactivate PLC input 0. To do so, set the toggle ofswitch S4 downward, which will remove the DC voltage of 24 V from PLCinput jack 0. What happens to input file bit 0? What happens to instructionsXIC I:0/0 in rungs 0 and 1 of the ladder program? Why?

G 14. Fill in Table 3-5 below. To do so, activate or deactivate PLC inputs 0 and 1,by using toggle switches 4 and 5 of the trainer connected to the 24-VDCPLC input jacks 0 and 1, and actuating the switch toggles in order to obtaineach of the four combinations given in this table, while observing data

file I1 - INPUT and the ladder program. For each of the four combinations,note the status (true or false) of instruction OTE O:0/0 in rung 0 of the mainladder program in order to obtain the truth table of this rung.

Note: Instruction OTE O:0/0 in the ladder program is highlightedwhen true.

Page 15: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-15

PLC INPUT 0 PLC INPUT 1 OTE O:0/0

DEACTIVATED DEACTIVATED

ACTIVATED DEACTIVATED

DEACTIVATED ACTIVATED

ACTIVATED ACTIVATED

Table 3-5. Truth table of rung 0 of the main ladder program.

G 15. Fill in Table 3-6. To do so, activate or deactivate PLC inputs 0 and 1 in orderto obtain each of the four combinations given in this table, and observe data

file I1 - INPUT and the ladder program. For each of the four combinations,note the status (true or false) of instruction OTE O:0/1 in rung 1 of the mainladder program in order to obtain the truth table of this rung.

PLC INPUT 0 PLC INPUT 1 OTE O:0/1

DEACTIVATED DEACTIVATED

ACTIVATED DEACTIVATED

DEACTIVATED ACTIVATED

ACTIVATED ACTIVATED

Table 3-6. Truth table of rung 1 of the main ladder program.

G 16. Activate PLC input 2 only, by using toggle switch 6 of the trainer connectedto the 24-VDC input jack 2. Observe that instructions OTE O:0/2 andOTE O:0/3 of the ladder program are both true.

Keep PLC input 2 activated. Activate PLC input 5 by using toggle switch 7of the trainer connected to the 24-VDC input jack 5. Are instructionsOTE O:0/2 and OTE O:0/3 of the ladder program still true? Explain.

G 17. Deactivate PLC input 5: instructions OTE O:0/2 and OTE O:0/3 of the ladderprogram become true again. Apart from PLC input 2, what other PLC inputscan be activated to leave instructions OTE O:0/2 and OTE O:0/3 in rung 2true? Verify your answer by activating the proper PLC inputs, usingpushbutton switches 1 and 2 of the trainer connected to the 24-V DC inputjacks 3 and 4.

Page 16: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-16

From your observations, is rung 2 true when the conditions indicated in therung comment are met? Explain.

G 18. On the PLC Trainer, make sure that all PLC inputs are deactivated (removeall the connection leads between the trainer switches and the PLC inputjacks and place all the switch toggles downward).

Testing the PLC Output Interface

G 19. You will now observe the effect that activating and deactivating the PLCinputs have on the status of the PLC outputs. To determine whether a PLCoutput is activated or deactivated, you will observe the ladder programoutput instructions, the output data file of the processor, as well as thestatus of the lamps next to the PLC output jacks of the trainer.

Note: Since trainer models 3270-4, 3270-1 and 9066 do not haveoutput lamps, observe the PLC output status LED's on thePLC module instead. For trainer model 3240-1, which has outputlamps next to the PLC output jacks, connect the trainer AC-linevoltage source to the supply terminals for these jacks, as shownin Figure 3-6, to permit the powering of the lamps.

G 20. Open data file O0 - OUTPUT and place the corresponding window at the

bottom of the RSLogix 500 window (next to the I1 - INPUT data file window).

Data file O0 - OUTPUT contains 16-bit words, bits 0 through 7 of output fileword O:0.0 corresponding to the 8 outputs of the PLC. Opening this fileallows you to monitor the output file bits as the ladder program is tested.

G 21. Activate PLC input 0 while observing data file O0 - OUTPUT and the ladderprogram. Observe that output file bit 1 (O:0.0/1) goes to logic state 1, sinceinstruction OTE O:0/1 in rung 1 becomes true.

Also, observe that PLC output lamp 1 on the trainer front panel is lit,indicating that PLC output 1 is activated. Is this your observation?

G Yes G No

Page 17: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-17

Figure 3-6. (Model 3240-1 only) Connections required for powering the PLC output lamps.

G 22. Activate PLC inputs 0, 1, and 2, using toggle switches 4, 5, and 6 of the

trainer, while observing data file O0 - OUTPUT, the ladder program, andthe PLC output lamps on the trainer front panel.

From your observations, do the lamps on the trainer front panel reflect thestatus (activated/deactivated) of the PLC outputs? Explain.

On the PLC Trainer, make sure that all PLC inputs are deactivated.(Remove all the connection leads between the trainer switches and thePLC input jacks, and place all the switch toggles downward).

In RSLogix 500, close the two data file windows.

Editing the Ladder Program

G 23. Open the Online bar drop-down list and choose the Program command.

A message box should appear asking for a confirmation before switching

the PLC mode of operation to Program. Click the Yes button to close the

message box and place the PLC in the Program mode.

The PC RUN status LED on the PLC module is now unlit, since the PLC is

no longer in the Run mode.

Page 18: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-18

G 24. The ladder program can only be edited while RSLogix 500 is offline. Choose

the Go Offline command in the Online bar drop-down list to setRSLogix 500 offline.

Observe that the project tree and program file LAD 2 of processorEXERC_3 are still displayed in the RSLogix 500 window, even if the systemis offline. This occurs because processor EXERC_3 in the PLC memory iscopied to the computer memory (this operation is referred to as an upload)when you go offline.

G 25. You are now ready to edit (modify) the main ladder program of projectEXERC_3 in order to obtain the one shown in Figure 3-7.

Figure 3-7. New version of the main ladder program of project EXERC_3.

Replace the output energize instruction in rung 0 with a timer-on-delay(TON) instruction. To do so, select instruction OTE O:0/0 in rung 0 and

choose the Change Instruction Type command in the context-sensitive

menu. Type TON using the keyboard and press the Enter key.

Observe that the OTE instruction in rung 0 has been replaced with a boxcontaining the parameters of the TON instruction that has been newlyentered.

G 26. Enter an address for the TON instruction. To do so, double-click Timer

within the TON instruction, type: T4:0, and then press the mouse left buttonto enter this address.

Select a time base for instruction TON T4:0. To do so, double-click Time

Base within this instruction. In the Time Base drop-down list that appears,

Page 19: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-19

select 0.01 s as the time base, then press the mouse left button to acceptthis selection.

Select a preset value for instruction TON T4:0. To do so, double-click

Preset within this instruction, type: 1000, then press the mouse left buttonto accept this value.

Leave the Accumulated value of instruction TON T4:0 set to 0.

This completes the parameter setting for instruction TON T4:0. Rung 0 inRSLogix 500 should now be identical to rung 0 in the ladder program ofFigure 3-7.

G 27. Select instruction XIC I:0/1 in rung 1 and choose the Cut command in thecontext-sensitive menu to remove this instruction.

Select the lower left-hand corner of the branch in rung 1 (which will cause

this corner to become highlighted) and choose the Cut command in thecontext-sensitive menu to remove the branch.

Double-click the address of instruction XIC I:0/0 in rung 1 to select it, type

the following address: T4:0/DN instead, then press the mouse left button toaccept this new address.

Rung 1 in RSLogix 500 should now be identical to rung 1 in the ladderprogram of Figure 3-7.

G 28. Select rung 2 by clicking on "0002" at the left of this rung and choose the

Cut command in the context-sensitive menu to remove this rung.

G 29. Modify the rung comments in rungs 0 and 1 as follows:

Rung 0:When this rung is true, instruction TON T4:0 is timing.

Rung 1:This rung is true when instruction TON T4:0 has completed its

timing cycle.

Using the Verify Rung command, verify the rungs that have been edited.Correct the errors, if any.

The main ladder program in RSLogix 500 should be identical to that shownin Figure 3-7.

G 30. Using the Save As command in the File menu, save the new ladderprogram in a project file named EXERC_3a.RSS.

Note: Do not forget to also change the processor name while youare in the Save Program As dialog box.

Page 20: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-20

Testing the New Version of the Ladder Program

G 31. To test processor EXERC_3a, project EXERC_3a must be downloaded to

the PLC memory and the PLC must then be placed in the Run mode.

Download project EXERC_3a to the PLC.

Go online and place the PLC in the Run mode.

G 32. On the PLC Trainer, activate both PLC inputs 0 and 1 and, for the next10 seconds, observe the ladder program in RSLogix 500 and the PLCoutput lamps on the trainer front panel.

Describe what happens when PLC inputs 0 and 1 are activated.

Note: Once the 10-s timing cycle has been completed, you canrestart the timer by deactivating and then reactivating PLC input 1in order to observe this cycle again.

Note: The operation of PLC timer instructions will be covered indetail in another exercise.

G 33. At the end of the timing cycle, that is, when PLC output lamp 1 is lit,deactivate PLC input 1 and observe what happens to the ladder program inRSLogix 500 and to the PLC output lamps on the trainer front panel.

Record below your observations and explain the reason why this occurs.

Page 21: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-21

Online Edition of Data

G 34. In rung 0 of the main ladder program, select the timer preset value by

double-clicking Preset, type: 300, and then press the mouse left button toaccept this value.

G 35. On the PLC Trainer, deactivate and then activate both PLC inputs 0 and 1to initiate a new timing cycle, while observing the ladder program inRSLogix 500 and the PLC output lamps on the trainer front panel.

From you observations, what effect does decreasing the Preset value ofinstruction TON T4:0 have on the value of the time delay?

Clearing the PLC Memory

G 36. Place the PLC in the Program mode of operation and note that all outputs

become deactivated when the PLC is placed in the Program mode.

G 37. To clear the PLC memory, choose the Clear Processor Memory command

in the Comms menu. A message box should appear requesting a

confirmation before clearing the PLC memory. Click the OK button to clearthe PLC memory, close the project, and return to the offline mode.

G 38. Close RSLogix 500. Turn off the computer.

G 39. On the PLC Trainer, make sure that all PLC inputs are deactivated. Turn offthe PLC Trainer. Remove all the switch connection leads, set all the switchtoggles downward, and return all the equipment.

CONCLUSION

In this exercise, you saw how to create a new project from a project previously savedto a project file. You learned how to verify the configuration of the systemcommunications. You saw how to download a project to the PLC of the PLC Trainerand go online. You learned how to place the PLC in the Run mode of operation andtest the ladder program. You saw how to go offline, modify the PLC ladder program,and save the modified program to a project file. You learned how to perform onlineediting of data. You saw how to clear the PLC memory.

Page 22: Exercise 3 Online Operations - Lab-Volt DATA FILES USER-DEFINED DATA FILES FILE TYPE IDENTIFIER FILE ... of the PLC used on the Lab-Volt PLC Trainer Model 3240-2, ... (Sequential method)

Online Operations

3-22

REVIEW QUESTIONS

1. A pilot lamp illuminates when a PLC input is activated. What programinstructions would be required to achieve this operation?

2. What input file bit condition is required for an Examine If Open (XIO) instructionto be true?

3. Does the processor scan or execute the ladder program when the PLC is in the

Program mode?

4. In rung 2 of the ladder program of Figure 2-7, instruction OTE O:0\2 is true whenPLC inputs 2, 3, OR 4 are activated, AND PLC input 5 is activated. True orfalse? Explain why.

5. When the PLC is in the Run mode, can a project be downloaded to theprocessor? Explain.