L14 Introduction to Function Block Programming

34
LAB 14 Introduction to Function Block Programming

Transcript of L14 Introduction to Function Block Programming

Page 1: L14 Introduction to Function Block Programming

LAB 14 Introduction to Function Block

Programming

Page 2: L14 Introduction to Function Block Programming
Page 3: L14 Introduction to Function Block Programming

WELCOME TO THE INTRODUCTION TO FUNCTION BLOCK PROGRAMMING HANDS ON LAB ________5

ABOUT THIS HANDS-ON LAB __________________________________________________5

LAB MATERIALS ___________________________________________________________5

DOCUMENT CONVENTIONS____________________________________________________6

LAB 1: INTRODUCTION TO FUNCTION BLOCK PROGRAMMING IN RSLOGIX 5000 (45 MIN.)________7

REVIEWING IEC61131-3 PROGRAMMING LANGUAGES _______________________________7

LAUNCHING RSLOGIX 5000 AND CREATING A NEW PROJECT__________________________8

CREATING AND CONFIGURING A NEW PERIODIC TASK AND PROGRAM ___________________9

CREATING A FUNCTION BLOCK ROUTINE AND SCHEDULING IT TO RUN __________________10

EDITING THE FUNCTION BLOCK ROUTINE ________________________________________11

EDITING THE FUNCTION BLOCK LOOP SIMULATION ROUTINE _________________________15

AUTOTUNING THE PIDE LOOP ________________________________________________18

CREATING A TREND TO TRACK PROCESS VARIABLES_______________________________22

ON-LINE EDIT OF A FUNCTION BLOCK ROUTINE ___________________________________25

LAB 2: EXERCISING THE PIDE USING ACTIVE X FACEPLATES ____________________________29

CONFIGURING A TOPIC IN RSLINX _____________________________________________29

ADDING A PIDE FACEPLATE TO AN MS EXCEL SPREADSHEET ________________________31

CONFIGURING COMMUNICATIONS IN THE PIDE FACEPLATE __________________________33

EXERCISING THE PIDE FACEPLATE ____________________________________________34

LAB SUMMARY ___________________________________________________________34

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 3 of 34

Page 4: L14 Introduction to Function Block Programming
Page 5: L14 Introduction to Function Block Programming

Welcome to the Introduction to Function Block Programming Hands on Lab About This Hands-On Lab

During this lab you will learn the basics of programming with Function Blocks. You will also learn that some applications can be programmed more quickly and easily if you use languages other than ladder logic.

Who Should Complete This Lab

This lab is intended for customers with minimal prior exposure to alternate programming languages, such as Function Block Diagrams.

Lab Materials

For this Hands-On lab, we have provided you with the following materials that will allow you to complete the labs in this workbook.

Hardware

This hands-on lab requires one of the following Demo boxes:

ControlLogix Demo Box

CompactLogix demo box (either L43 or L35E)

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 5 of 34

Page 6: L14 Introduction to Function Block Programming

Software

The IBM-compatible PC in front of you has been loaded with:

RSLogix 5000

RSLinx Classic

Windows O/S

Microsoft Excel

Files

There are no pre-configured lab files for this lab exercise. You will be creating your projects as you go.

Document Conventions

Throughout this workbook, we have used the following conventions to help guide you through the lab materials.

This style or symbol: Indicates: Words shown in bold italics (e.g., RSLogix 5000 or OK)

Any item or button that you must click on, or a menu name from which you must choose an option or command. This will be an actual name of an item that you see on your screen or in an example.

Words shown in Courier text, enclosed in single quotes (e.g., 'Controller1')

An item that you must type in the specified field. This is information that you must supply based on your application (e.g., a variable).

Note: When you type the text in the field, remember that you do not need to type the quotes; simply type the words that are contained within them (e.g., Controller1).

FYI

The text that follows this symbol is supplemental information regarding the lab materials, but not information that is required reading in order for you to complete the lab exercises. The text that follows this symbol may provide you with helpful hints that can make it easier for you to use this product.

Note: If the mouse button is not specified in the text, you should click on the left mouse button.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 6 of 34

Page 7: L14 Introduction to Function Block Programming

Lab 1: Introduction to Function Block Programming in RSLogix 5000 (45 Min.) This lab demonstrates the use of the Function Block Diagramming, which is based on the IEC 61131-3 specification and integrated into the RSLogix 5000 software. In this lab, you will learn how to create and edit a Function Block Diagram.

Reviewing IEC61131-3 Programming Languages

IEC 61131-3 and Programming Languages

The IEC 61131-3 standard includes specifications for 5 graphical programming languages. Each language has the ability to access data controlled by another routine using a different language. Thus, a Function Block Diagram can directly access the accumulated value of a counter controlled by a Relay Ladder Logic routine. Your application will determine which language Editor you will choose.

Relay Ladder Logic (RLL)

First developed to replace hard wired relays and timers in the field. In appearance it resembles electrical schematic diagrams. Anyone that has used relay ladder logic to program PLC’s will know that the RLL functionality has multiplied exponentially and now includes at least 200 different instructions. Allen-Bradley relay ladder logic conforms to the IEC 61131-3 standard.

Instruction List (IL)

The IEC developed the specification for the IL language after reviewing the low level languages (similar in structure to machine assembly language) used by a wide range of PLC manufacturers. One of the advantages of IL is that it is very easy to design PLC’s that can use this language. Often, it is possible to download Instruction List programs without an interim software compiler. On the other hand, IL supports a limited number of changes in program flow and is not considered a “high level language”. While Relay Ladder Logic, Function Block, Structured Text and Sequential function charts can all be converted to Instruction List, Rockwell Automation does not offer an Instruction List Editor for user programming.

Function Block (FB)

Function Blocks are the basic elements of a control system. An FB diagram is similar in appearance to P&ID diagrams used in instrumentation and control. Function Blocks consist of two parts; a set of input and output parameters and an algorithm specific to the specific type of function block. Function Block language is designed to control “parameter areas”, such as all the inputs/outputs required to control a PID loop. The IEC 61131-3 sets forth a standard set of function blocks. Rockwell Automation, like other PLC manufacturers, expands on the basic function blocks to provide functionality that can be easily configured for various application types.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 7 of 34

Page 8: L14 Introduction to Function Block Programming

Sequential Function Chart (SFC)

Unlike Function Block, which is natively suited for continuous processes, the Sequential Function Chart language is based on current methods of describing a sequence of events. This language bears a resemblance to a graphical system that was first used in computer system designs to describe the behavior of programs with multiple states. SFC uses a series of steps and transitions to control the flow of a program. Sequences can have converging or diverging paths and can operate simultaneously with other sequences. While batch/recipe control may be the obvious application for this language, it can be utilized anywhere logical states repeatedly initiate similar sequences of events.

Structured Text (ST)

As a high level language, similar in syntax to other structured text languages such as PASCAL, IEC 61131-3 Structured Text is particularly well suited for managing a wide variety of data types and behaviors. Software Developers will find ST easy to learn, program and document. Another strength of this language is the ability to program complex mathematical algorithms.

Launching RSLogix 5000 and Creating a New Project

In this section of the lab you will launch RSLogix 5000 software and use it to create a new controller file.

Important: You MUST know which demo box you are using before you proceed. If you are unsure, ask your instructor.

1. From the computer desktop, double-click on the RSLogix5000 icon to launch RSLogix5000 software.

The RSLogix5000 screen appears.

2. From the toolbar menu select File > New.

The New Controller dialog appears.

3. When the New Controller screen appears, configure the controller as follows:

From the Type pull-down menu, choose the type of controller at your student station.

From the Revision pull-down menu, specify 16.

In the Name field, type 'Language_Example'.

Configure slot number of controller, if applicable

4. Click OK to accept your changes and exit the New Controller dialog box.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 8 of 34

Page 9: L14 Introduction to Function Block Programming

5. Your Controller Organizer should now appear as follows:

Notice that the Organizer is similar to a Windows-type hierarchy with folder structures.

6. From the Controller Organizer, take a moment to locate the Controller, Tasks, and I/O Configuration folders as we’ll be referencing these later in the lab.

Creating and Configuring a New Periodic Task and Program

In this section of the lab you will create a new periodic task and configure it.

1. From the Controller Organizer, right click on the Tasks folder and choose New Task.

The New Task dialog appears.

2. Enter the parameters as shown below, then click OK to accept your changes.

3. From the Controller Organizer, right click on FB_Task and choose New Program.

The New Program dialog appears.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 9 of 34

Page 10: L14 Introduction to Function Block Programming

4. Enter the parameters as shown below, then click OK to accept your changes.

5. The Tasks folder in the Controller Organizer should appear as follows (note you may have to expand the FB_Task folder):

Creating a Function Block Routine and Scheduling it to Run

The routine is the basic container for your program. It can be made up of any of the supported languages of the controller: ladder diagram, function block, sequential function chart, structured text. Many times the choice of language at this level is driven by the actual functionality of the specific routine and the suitability of one of the supported languages to accomplish the task due to the specific language feature set.

1. From the Controller Organizer, right click on FB_Prog and choose New Routine.

The New Routine dialog appears.

2. Fill in the New Routine dialog as shown below, then click OK to accept your changes.

Note that the Type is a Function Block Diagram.

3. The Tasks folder in the Controller Organizer should now appear as follows:

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 10 of 34

Page 11: L14 Introduction to Function Block Programming

4. To schedule the routine, right click on FB_Prog and choose Properties.

The Program Properties dialog appears.

5. Click on the Configuration tab and choose the FB_Routine routine from the Main pull-down menu, as shown below.

6. Click on Apply, and then click on OK to exit the dialog box.

Editing the Function Block Routine

1. Double-click on FB_Routine routine in the Controller Organizer.

A blank sheet (sheet 1) opens in the workspace.

2. Name this sheet 'TIC101' in the namespace edit box.

The first block to add to the diagram is the Enhanced PID Block (PIDE) to regulate the simulated loop.

3. On the Process tab on the toolbar, click on the PIDE function.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 11 of 34

Page 12: L14 Introduction to Function Block Programming

The PIDE block should now appear on the diagram.

4. Click on the Properties button for this block and take a minute to view all of the available parameters.

Note they are organized into 7 tabs; the Parameters tab lists all parameters in the block.

Note that the first column tells whether the parameter is an input (I) or an output (O) to the block. Also in the parameters tab, you can use the checkbox in the second column to expose or hide parameter pins on the block diagram itself.

5. Click on OK to close the PIDE properties dialog.

6. Click on the Input Wire Connector from the toolbar.

Input Wire Connector

7. Move the Input Wire Connector (by dragging) to the input (left) side of your PIDE block and connect it to the PV point with a wire by clicking once on the input reference output pin and once on the PIDE PV input pin.

Note: You can click and drag the instructions to maneuver them around the sheet. Note: If you are over a valid connection point, the pin turns green.

8. Double-click on the wire connector reference to open a box for tag name entry, type ‘PID_PV’, and press Enter to accept.

9. Click on the Output Wire Connector from the toolbar.

Output Wire Connector

10. Move the Output Wire Connector (by dragging) to the output side of your PIDE block and connect it to your CVEU point by clicking once on the PIDE CVEU pin and once on the Output Wire Connector input pin.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 12 of 34

Page 13: L14 Introduction to Function Block Programming

11. Double-click on the wire connector reference, type ‘PID_CV', and press Enter to accept.

12. Right click on the wire leading from the PID_PV input wire connector to the PIDE_01.PV and choose Assume Data Available from the list that appears as shown:

Setting this line as the “available first” data point will tell the sheet to assume that this path should be evaluated first. The simulation in the next section will create a loopback to the PIDE_PV parameter.

The AutoTune feature needs a PIDE_AUTOTUNE tag associated with it in order to autotune the loop.

13. At the bottom of the PIDE function block, double-click on the ? to enter the Autotune tag name.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 13 of 34

Page 14: L14 Introduction to Function Block Programming

14. Type ‘PIDTune’ in the field and press Enter to accept.

15. Right click on the PIDTune tag reference and choose New “PIDTune” to create the AutoTune tag.

16. Complete the New Tag dialog as follows, then click OK to accept your changes.

17. Save the Project.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 14 of 34

Page 15: L14 Introduction to Function Block Programming

Editing the Function Block Loop Simulation Routine

1. Click on the Add Sheet button to create a new sheet for the simulation elements.

You should now be on a clean sheet, designated sheet 2 of 2. This sheet will contain the simulation.

2. Name the sheet ‘Simulation’.

3. From the Process tab on the toolbar, select and place a dead-time (DEDT) block onto sheet 2 (you may have to use the scroll arrows to find the DEDT instruction within the Process tab).

Next, you’ll create a storage array for this instruction’s use.

4. Double-click on the ? after StorageArray and type ‘Dead_Array’, and press Enter to accept.

5. Right click on the tag reference and choose New “Dead_Array” to create the deadtime array tag.

6. Make this tag a Real Array type of program: FB_Prog scope with a dimension of 100.

7. Click OK on both dialogs to accept your changes.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 15 of 34

Page 16: L14 Introduction to Function Block Programming

8. Open the DeadTime Properties Dialog (by clicking on the ellipsis), select the Parameters tab and configure a Deadtime of 5.0 seconds and a Gain of 1.4.

9. Apply the change and click on OK.

10. From the Process tab on the toolbar, select and place a Lead-Lag (LDLG) block onto sheet 2.

11. Open the LeadLag parameters by clicking on the ellipsis and configure a 40 second lag as shown below:

12. Apply the change and click on OK.

13. Connect DEDT_01.Out to LDLG_01.In as shown below:

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 16 of 34

Page 17: L14 Introduction to Function Block Programming

14. Click on the Input Wire Connector object from the toolbar and connect it to the input of the DeadTime block.

Input Wire Connector

15. Double-click on the wire connector reference, click on the arrow for a drop-down list of available connector references, choose PID_CV, and press Enter to accept.

16. Drop an Output Wire Connector onto the sheet and connect it to the output of the LeadLag.

Output Wire Connector

17. Double-click on the wire connector reference, click on the arrow for a drop-down list of available connector references, choose PID_PV, and press Enter to accept.

You should have a diagram for sheet 2 similar to this:

18. Verify the routine by clicking the button in RSLogix 5000 software:

19. From the toolbar menu, select File > Save.

20. From the toolbar menu, select Communications > Who Active and browse to your controller at your student station.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 17 of 34

Page 18: L14 Introduction to Function Block Programming

21. Download the program to the controller and go into Remote Run mode.

You should notice a green border around the workspace indicating that the code is being scanned by the controller.

Autotuning the PIDE Loop

1. Go back to sheet 1 and click on the properties button ellipses of the PIDE instruction and click on the Autotune tab.

2. Acquire the autotune resource (tag) by clicking the Acquire Tag button.

The tag should now be available for use with this PIDE and autotune.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 18 of 34

Page 19: L14 Introduction to Function Block Programming

FYI

The Autotune tag that was entered at the bottom of the PIDE in RSLogix 5000 is a resource that can either be dedicated to a single PIDE or shared between many PIDE’s. In a shared resource situation, a single PIDE can use the Autotune tag at a time for an individual tuning. As such, there must be a way to “Acquire” the resource for use and to “Release” the resource so that another PIDE can Acquire and use. This section of the dialog deals with that resource acquisition and subsequent release. To acquire or release the resource, simply click the appropriate button. The status indicator displays the current status of the autotuning resource (tag).

3. Configure the Autotune as shown below, then click Apply to accept your changes.

The Autotune will tune a “temperature” process by increasing the PIDE CV by 30 percent from its current value and will abort the autotune run if the process variable is going to rise above 100 before the autotune run is complete.

FYI

The Process Type specifies what type of system is to be tuned. This is important because it may influence the type of model (integrating / non-integrating, etc) chosen for the autotune test.

The PV Change Limit is an absolute limit (in the engineering units) for the referenced PIDE configuration to stop (abort) the autotune procedure if the system will violate that limit in the course of the autotune run.

The CV Step Size is the amount by which the autotune will change the PIDE CV to exercise the system. The amount (in percent) entered here will be added to the current CV amount for the duration of the autotune run.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 19 of 34

Page 20: L14 Introduction to Function Block Programming

4. Click on the Autotune button to display the PIDE Autotune start screen as shown below:

5. Click on the Start button to begin the Autotune process. This process will take a couple minutes.

Note that the Execution State is In Progress and the Abort button is active.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 20 of 34

Page 21: L14 Introduction to Function Block Programming

6. When the autotune is finished, the first thing you should verify is that the Execution State is Complete and your gains should appear as shown below:

This section shows the recommended gains based upon the last successful autotune run as well as the current gains being used in the PIDE.

7. Load the Slow Response set of gains into the PIDE by selecting the radio button for Slow Response.

8. Click on the Set Gains in PIDE button.

Note that the Current gains in the PIDE have changed to reflect the Slow Response selection.

9. Close the Autotune and Tune dialogs so that you are back to sheet 1 of the FBD.

Notice the PID_PV value changing.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 21 of 34

Page 22: L14 Introduction to Function Block Programming

Creating a Trend to Track Process Variables

1. From the Controller Organizer, right click on the Trends folder and select New Trend.

2. When the New Trend window appears, enter the trend name as shown below, then click Next.

3. When the following screen appears, select FB_Prog from the Scope pull-down menu and expand the PIDE_01 tag in the Available Tags window.

4. Select the PIDE_01.PV tag from the list and click the Add button.

5. Repeat step 4 for the PIDE_01.CV and PIDE_01.SP elements.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 22 of 34

Page 23: L14 Introduction to Function Block Programming

The configuration window should appear as follows:

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 23 of 34

Page 24: L14 Introduction to Function Block Programming

6. Click Finish to accept your changes.

The trend chart will appear as shown below:

7. Right click on the black area and choose Chart Properties.

8. Click on the X-Axis tab and set the time span to 3 minutes.

9. Click on the Y-axis tab.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 24 of 34

Page 25: L14 Introduction to Function Block Programming

10. Click on the Custom radio button and set the min and max values as shown below:

11. Click Apply to accept your changes, then click OK to exit the trend properties window.

The trend display has now been defined; it will be used later in this lab.

On-Line Edit of a Function Block Routine

The on-line editing functionality is procedurally identical to that of ladder routines:

Start edits on the selected routine (the original routine is running while edits are made on a copy)

Make the desired edits on the copy.

Verify (Accept) the edits in the copy.

Test the edited copy (swap the original and the edited version in the execution thread).

Optionally Untest to return execution to the original.

Assemble the edited copy to replace the original.

In the Function Block editor the edit ‘zone’ is the entire routine upon which edits are being performed. So two copies of the routine being edited are held in memory from the time that the edits are verified until the edits are either cancelled or assembled.

1. Navigate to the routine FB_Routine so that sheet 1 is in the editor workspace.

2. Click once on the Start Pending Routine Edits button in the function block toolbar.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 25 of 34

Page 26: L14 Introduction to Function Block Programming

You should now be in the Pending Edits view.

Note that the border around the function block diagram is no longer green. This is because the program is not running the routine being edited. It is still running the original. In order to view the original, click once on the Original View button.

To return to the Pending Edits View, click once on the Pending Edits View button.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 26 of 34

Page 27: L14 Introduction to Function Block Programming

3. From the instruction toolbar, place an Input Reference (IREF) on the sheet to the left of the PIDE and wire it to the SPProg input.

4. Type RemoteSP into the IREF and create this tag as a REAL.

5. Click once on the Accept Pending Routine Edits button to verify and accept the edits.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 27 of 34

Page 28: L14 Introduction to Function Block Programming

The Edit toolbar will now change available options to reflect that the routine has been verified and is ready to either be tested or cancelled. Also, the view has changed to the Test ? view and the border around the sheet has changed to reflect the fact that it can be activated by testing.

* Note: If the Edit toolbar does not resemble this or errors were noted during verification, then review the steps in this section.

6. Click once on the Test Accepted Program Edits button to activate the new routine effectively swapping it with the currently active routine.

7. When prompted to Test Program Edits, click Yes. Notice that the border around the edited sheet becomes green indicating that it is now the active copy.

At this time you can explore the Original and Test views, and the Test and UnTest capability. Do not Cancel the edit or you will not be able to exercise the edits that you have made unless you redo this entire section.

8. Click once on the Assemble Accepted Program Edits button to make the program edit into the working program and to leave edit mode.

9. When prompted to Assemble Program Edits, click Yes to proceed. Notice that edit symbols have been removed from the border around the edited sheet indicating that it is now the only copy in the program.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 28 of 34

Page 29: L14 Introduction to Function Block Programming

Lab 2: Exercising the PIDE using Active X Faceplates RSLogix5000 provides seven Active X faceplates that can be used in FTView or any Active X container (such as MS Excel). Faceplates are available for the following function blocks: Alarm, Enhanced Select, Totalizer, Ramp/Soak, Discrete 2 State Device, Discrete 3 State Device, and Enhanced PID.

We will create an Enhanced PID faceplate in Excel, but first we need to set up an OPC topic in RSLinx that the faceplates can use to communicate with the controller.

Configuring a Topic in RSLinx

1. Minimize your RSLogix 5000 project using the Restore Down button.

2. From computer desktop, click on the RSLinx icon.

3. From the toolbar menu in RSLinx, select DDE/OPC > Topic Configuration.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 29 of 34

Page 30: L14 Introduction to Function Block Programming

4. When the following window appears, click on the Language_Example topic, expand the AB_ETHIP_1 driver, and select the controller at your student station. Note: If you are unsure about the controller, ask your instructor.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 30 of 34

Page 31: L14 Introduction to Function Block Programming

5. Under the Data Collection tab, configure the topic as shown below:

6. Click Apply and then Done when finished.

7. Minimize your RSLinx session.

Now we can start Excel and place a PIDE faceplate on a worksheet.

Adding a PIDE Faceplate to an MS Excel Spreadsheet

1. From the computer desktop, double-click on the Microsoft Office Excel 2003 icon. You should have a blank worksheet on your screen. Since the faceplates are Active X controls, we must access the “Control Toolbox” in Excel to insert any Active X objects on our sheet. If the Control Toolbox is not visible, go to View, select Toolbars, then select Control Toolbox.

2. From the Control Toolbox on the spreadsheet, select the More Controls icon in the bottom of

the toolbox.

3. From the scroll list that appears, scroll down to select Logix 5000 PIDE Faceplate Control. Your cursor should now turn to a crosshair.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 31 of 34

Page 32: L14 Introduction to Function Block Programming

4. Draw a box with your cursor on your sheet so you have the following:

Next we need to link this faceplate to the PIDE instruction in the controller using the RSLinx topic we defined earlier.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 32 of 34

Page 33: L14 Introduction to Function Block Programming

Configuring Communications in the PIDE Faceplate

1. In Excel, right click on the PIDE Faceplate and choose Logix 5000 PIDE Faceplate Control Object > Properties.

2. When the following screen appears, click on the ellipsis next to the tag entry. This will launch the tag browser.

3. Expand the + sign next to your topic (Language_Example) to browse the Online tags.

4. Under Online tags, expand Program:FB_Prog and select the PIDE_01 tag, then click OK.

5. Once you have verified that your configuration appears as follows, click Apply to accept your changes. Click OK.

6. Exit the design mode by selecting the triangular icon in the Control Toolbox.

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 33 of 34

Page 34: L14 Introduction to Function Block Programming

Exercising the PIDE Faceplate

1. With the PIDE in manual mode, change the SP to 30 by either manually entering the value in the SP edit field or by using the vertical slider.

2. Go into automatic mode by clicking the Auto button.

3. Observe the changes in the process variable (PV) on the faceplate and in RSLogix 5000.

4. Back in your RSLogix 5000 project, click the Run button in your trend and view the process changes as you exercise the PIDE.

5. Change the SP to 0 and observe the trend. The PV should settle to 0.

6. From the toolbar menu in both RSLogix 5000 and Microsoft Excel, select File > Exit and exit the your projects without saving your changes.

Lab Summary

In this lab, you completed the following tasks:

Launched RSLogix 5000 and created the project which you will use for the duration of this lab exercise

Viewed the Controller Organizer in preparation for proceeding to the next section of the lab exercise

Created a periodic task called FB_Task and configured it to execute every 100ms.

Created a program called FB_Prog and scheduled it to execute as part of FB_Task.

Created a Function Block routine called FB_Routine

Scheduled FB_Routine to execute as the Main Routine for program FB_Prog

Created a FB Loop Simulation

Autotuned a PIDE

Created a trend to view process variable changes

Exercised the PIDE using Active X Faceplates

L14 - Introduction to FunctionBlock Programming.doc Integrated Architecture On Tour 2008 Page 34 of 34