VersaPro Tutorial
VersaPro Tutorial
October 2000
October 2000
Goals
After completing this tutorial, you should be familiar with all the features of VersaPro software, including hardware configuration, the user interface, variable declaration, variable view, and reference view tables, the IL and LD editors, and the many different tools and options that allow you to customize your workspace. Terminology Used in This Tutorial Lesson 1: Installation Lesson 2: Starting VersaPro and Creating a Folder Lesson 3: Customizing the Workspace Lesson 4: Importing Files Lesson 5: Using Hardware Configuration Lesson 6: Creating a Ladder Logic Program Lesson 7: Creating New Blocks Lesson 8: Instruction List Editor Lesson 9: Connect to a PLC, Store a Folder, and Monitor Lesson 10: View Tables Lesson 11: Reports and Printouts Conclusion 2 3 3 5 9 12 16 19 20 21 23 24 25
Menu selections
October 2000
Lesson 1: Installation
VersaPro will run on Windows 95, Windows 98, Windows 2000, and Windows NT (with Service Pack 3 or greater). Installation is a straightforward operation: Insert the CD into your CD drive, then find and double click on the setup.exe file.
If you are using Windows 95 and you do not have Dcom 95 installed on your computer, you will be prompted to install it. After Dcom is installed, you must restart your computer before you continue with the installation.
3. Enter Lab_1 for the Folder Name and a description in the Folder Description field if desired. If you want to put the new folder in a directory different from that specified in the Location field, click the browse button next to the Location field.
October 2000
4. Click the Next button. The following screen will appear. Note that the default selection is Empty Folder.
October 2000
Folder Browser
Ladder Editor
VersaPro Workspace
October 2000
2. Click and drag the toolbars to positions to match the Workspace shown on page 5. Note: The Folder Browser, Variable Declaration Table, expanded Function Toolbar, and Local Logic Variable Table (used in Motion programs) can be docked (fixed) or undocked (floating). These windows are docked by default. To select or deselect docking, click the secondary mouse button in the window and choose Allow Docking from the context-sensitive menu. Windows should be undocked only temporarily for moving and then redocked.
3. Display the compact Function Toolbar by selecting View, Function Toolbars, Compact.
Function Toolbar, Compact 4. If they do not already appear, display the Folder Browser and Variable Declaration Table by clicking their buttons in the View toolbar. 5. Undock the Folder Browser and click and drag it to the position shown in the VersaPro Workspace figure on page 5. Repeat this procedure with the Variable Declaration Table and the Function Toolbar.
October 2000
2. Select the Ladder tab and check Variable Name in the Show/hide field box. Next, click the Full button. This causes the Variable Names to be displayed in full mode (up to 2 lines, up to 32 characters). 3. Check Reference Address. (Brief is the only mode available.) 4. Check Description in the Show/hide field box, and click the Full button again. The Variable Descriptions will now be displayed in full mode (up to 4 lines, up to 64 characters). 5. Adjust the Grid Cell Width slide bar until you are comfortable with the Grid Cell Width. Notice that the cell width in the LD editor changes as the slide bar is adjusted. 6. For the purposes of this lab, make sure the Coil/Jump Justification Column checkbox is not selected. If this box is not checked, coils are inserted in the next empty column. If this box is checked, coils are placed in the column specified (right justified). Valid values are integers 10 to 20. (For 90-70 PLCs, Coil/Jump Justification Column should be selected and the value should be 10.) 7. Leave the Show 8x10 Rung Indicator selected. This causes a border to be displayed on the outside edge of row 8 and column 10. (For 90-70 PLCs, this option is always selected.) 8. Click OK. Review the Ladder Editor window to see the effects of the changes you made.
October 2000
3. Use the Font list box to select a different font. 4. Click OK. Note: For additional information on setting VersaPro options, refer to the User's Manual or to online Help.
October 2000
6. Click Finish. The New Folder Wizard closes, and VersaPro attempts to complete the import process. Details of the import process are logged in the Information Window. 7. Spend a few minutes reviewing this folder. Note that all nicknames are imported and that all comments retain their original format. See how different instructions look in the VersaPro ladder diagram editor. You can use the function toolbar to create new logic.
October 2000
1. Create an SNF File. a. b. If you do not already have an .snf file containing variable information, open a folder in Control software and use the Export feature from the Variable Declaration Table to create an .snf file. Close Control before you proceed.
2. Create a new folder in VersaPro. a. b. c. Select File, New Folder. You will be prompted to close your existing open folder. (Only one folder can be open at a time.) The New Folder Wizard will appear. Create a new folder with a new name. If you want to put the new folder in a directory different from that specified in the Location field, click the browse button next to the Location field to select the folder path. Click the Next button. Choose Import Control on the next screen. In the From field, use the browser button to locate a Control folder. Select the Include SNF checkbox, then click the Browse button and, in the Browse dialog box that appears, locate the SNF file that is associated with the Control file to be imported. (This field is optional.) Click OK to begin the Import process. Spend a few minutes reviewing this folder. Note that all nicknames are imported. Also, note that Comment contents are not imported. See how different instructions look in the VersaPro ladder diagram editor. You can use the function toolbar to create new logic.
d. e. f.
g. h.
3. Import a Shared Name File. a. b. c. In the folder you just created, select any cell in the Variable Declaration Table. Select Tools, Import Variables. Locate the Shared Name File (filename extension .snf) on your computer. A browser window will open. Click Open to import the file. If the file being imported contains variables that conflict (same name and scope) with those in the VersaPro folder, the Variable Resolution dialog box will appear. If this happens, you can simply click OK to accept the default settings, or press F1 to get more information about the Variable Resolution settings. The results of the Import process will be logged in the Information Window. Verify that the variables you imported appear in the Variable Declaration Table.
d.
10
October 2000
3. In the VDT, create a variable that can be easily indexed in Excel using the auto-increment feature something with a number at the end like Tank_1. 4. Select the entire variable row, and use either Copy/Paste or Drag and Drop to move this to Excel. 5. Replicate about 100 or so of these variables in Excel. Remember, only the variable name and reference address values should increment. If you have questions about how to do this, refer to the Excel documentation. 6. Select all the variables you created in Excel, and copy them. 7. Go to the first blank line in the VDT and paste the variables into the table. 8. The first thing you should note is that you are prompted to correct a discrepancy between the first variable in the Excel file and the variable you created in VersaPro. VersaPro will prompt you to correct errors as you go allowing you to complete the import even if there are conflicts. Correct this by renaming the variable, and complete the import.
11
October 2000
Rack View
Status Bar
Log View
Reference View
3. The Log View, Power Consumption, and Reference View windows are dockable (they can be set to a fixed location in the Workspace). Move the windows to a position you are comfortable with. Note: Docking is selected by default. To turn docking on or off, select Allow Docking from the contextsensitive menu. , and Power Consumption View windows off and on
4. Toggle the Reference View , Log View by clicking the buttons on the toolbar.
12
October 2000
1. Right click on the Power Supply Module and choose Replace Module. 2. Choose a Power Supply from the Module Catalog and click OK. Review the information in the Parameters Dialog Box and click OK. 3. Right click on the Power Supply Module and choose Replace CPU. 4. Choose a CPU from the Module catalog and click OK. A Parameter Editor window, similar to the one below, will appear.
VersaMax is the only PLC type that uses Carrier/Base modules. If you are configuring a different type, skip steps 6 through 8.
6. Right click again on the Power Supply Module and choose Add Carrier/Base from the context-sensitive menu. 7. Choose a base from the I/O Carriers or the Communications Carriers tab and click OK.
13
October 2000
8. Right click on the Carrier you just added, and choose Add Module. Select a module and click OK. (The appropriate Module Catalog for the Carrier will be displayed.) Close the Parameter Editor window. Your rack system configuration should be similar to the following figure.
2. Experiment with the following Parameter Editor features: Tooltips: When you pass the cursor over an editable cell, valid choices will be displayed in a tool tip. Inline Editing: To place a value directly into a cell, click the cell and start typing. Data Entry Tool: To open the Data Entry Tool, double click or right click on the selected cell, or press F2. The Data Entry Tool provides editing controls appropriate to the type of data being entered in the selected cell. For Reference Address and Range values, its built-in limit values and available reference value ranges prevent you from using the spin buttons or slider bar to enter values outside the allowable limits. However, you can override these limits by typing in any desired value. Error Color: Erroneous or unavailable values are highlighted in the Error Color (default color is red). To change the Error Color, select the HWC Tools menu, Options. Choose Text Error from the Colors list. Mode Setter Parameters: These parameters affect other parameters and are listed in italics. The value entered for a Mode Setter can alter the format and content of the Parameter Editor window. For example, fields may be added or removed from individual tabs, and/or entire tabs can be removed or replaced. Changing a Mode Setter can also erase parameter information that you might already have entered. It is strongly recommended that you select Mode Setter values before entering data for the other parameters in the dialog. To see examples of Mode Setters, look at Sweep Mode on the CPU Scan tab and Port Mode on either of the Port tabs. For an explanation of parameter relationships for these parameters, select the parameter and choose What's This from the context-sensitive menu. Module Help: For a summary of each parameter on the tab being displayed, choose Help, Module Help. 14
October 2000
Spreadsheet Mode: Spreadsheet mode allows all parameter groups to be displayed and edited in a single, scrollable view. (Default is tabbed mode.) To change the edit mode, select View, Parameter Edit. You can also select Tools, Options, and then select the Parameter Edit Options tab. The following figure shows the editor window for the VersaMax CPU002 in spreadsheet mode.
3. Close the Parameter Editor window. 4. Note that the rack system Status Bar indicates "Not Saved." To save your configuration, click the Save button on the toolbar, or select File, Save.
15
October 2000
Place, name, and assign addresses to Boolean elements in the ladder diagram.
1. Make sure that the VDT is visible. If not, select View, Variable Declaration Table, or press Alt + 3. 2. If the MAIN.blk Ladder Diagram editor window is not open, double click the _MAIN-LD block in the folder browser. 3. In the VersaPro _MAIN.blk window, click the Normally Open Contact button on the Ladder Toolbar.
4. Move your cursor into the ladder diagram. Note that the mouse pointer has a Normally Open Contact symbol as a subscript. Click in the first row and leftmost column in the ladder diagram. A Normally Open Contact is placed in the grid where the pointer sits, and a gray box surrounds the contact. 5. Without moving the cursor, type Input_1, 1i and press Enter. The editor recognizes that you are typing a variable name and address, shows the name in the ladder diagram, and places the name and address in the VDT. (1i indicates the address %I00001.) 6. Note that the Normally Open Contact button sticks. Once it is selected, you will place a contact in every time you click in the diagram. Cancel the Normally Open Contact selection by pressing the Escape key. 7. Click the cursor to the right of the Input_1 contact and type nocon (for Normally Open Contact). Since there is no element in the current space, a progressive search is performed to find the element you want as you type. Press Enter. Note: You can drag and drop a variable from the VDT to an element in the logic editor if the function does not have a variable assigned to the parameter. Steps 8 and 9 use this alternate means of assigning a variable name to an element. 8. In the VDT, type the Name, Type, Len, and Address as shown in the figure below. (You can type in the bottom, empty row or choose Insert Row from the context-sensitive menu.)
9. Select the name Input_2 and drag it to the contact that you created in step 7.
11. Place the coil in the diagram a few spaces away and to the right of the second contact. 12. Type Output_1, 1q and press Enter. A variable named Output_1 with a reference address of %Q00001 will be created in the VDT. Press Escape. 13. Use point-to-point wiring to connect the contacts and the coil. Do this by placing the pointer on the right side of the second contact, then right click, hold, and drag to draw a connection from the contact to the right side of the coil. (The cursor changes to a hand with a pencil.)
16
October 2000
First Rung
2. Choose MOVE_WORD from the listbox, click the Function Drop Mode button , and move the cursor into the ladder diagram. A small function block icon will appear next to the mouse pointer. 3. Place the MOVE_WORD instruction in the diagram underneath the rung you created earlier by clicking in this location. Notice that this automatically becomes Rung 2 in the margin. Press the Escape key. 4. Wire the power flow input of the function to the power rail using the point-to-point wiring method. 5. Click in the grid block next to the IN input on the MOVE_WORD function. A gray box will appear next to the input. 6. Type 16#A01 and press Enter. You have just entered a hexadecimal constant as input to the function. The same convention is followed for octal and binary numbers (8#, 2#). You do not need to type a 0 in as a placeholder. 7. After hitting Enter, the gray box moved over to the space next to the Q output. Type REG_1,1R and press the Enter key. The name and address are added to the VDT. 8. Next, double click on the function block. The Function Properties Dialog Box appears. Enter the desired length (and for other functions, the address) and click OK.
October 2000
2. Highlight the function block by clicking on the space to the left of the block and dragging down and to the right. Make sure the entire block and connected values are highlighted, including the constant 16#A01 and the output Reg_1. Release the mouse button. 3. Place the pointer back in the highlighted area and click and drag. When the function block is in the desired position, release the mouse button. The entire block has been cut and pasted into the new location. 4. Note that similar results can be achieved by highlighting an area and then right clicking and choosing Cut and then moving the cursor to the new location, right clicking, and selecting Paste. Or, you can use Ctrl + C and Ctrl + V to cut and paste the highlighted elements. 5. Save your work: Select File, Save All or press Ctrl + Shift + A.
Insert a comment.
1. Click in an area below Rung 2. 2. From the Insert menu, select Comment. A comment line will appear in the area where the cursor was. This is automatically named Rung 3. 3. Double click on the comment line. A scroll box will appear. 4. Type in your comment, hitting enter when you want to create a new line. When you want to exit, press Ctrl + Enter to leave the comment window. Your LD program should be similar to the one shown below. Note: To change the comment display format, select Tools, Options and choose the Brief or Full option on the General tab.
18
October 2000
3. Press Enter and select the new block from the list box that appears.
19
October 2000
2. Type move_word. (The list box will perform a progressive search.) Select the MOVE_WORD( instruction and press Enter. The parameters for this instruction will automatically appear, and the cursor will move to the cell in the Operand column for the first parameter. 3. For the IN parameter, in the Operand column, type REG_1 (or select REG_1, G from the drop down list) and press Enter. Since the variable REG_1 has already been defined, %R00001 will appear in the Ref. Address Column. 4. For the Length parameter, type 3 and press Enter. 5. For the Q= parameter, type REG_2 and press Enter. Since this is a new variable, the Ref Address cell for it will remain empty. Note that Reg1 appears in the VDT. 6. In the VDT, type 200R in the Address cell for Reg1 and press Enter. In the IL Editor, %R00100 will appear in the Ref Address column for Reg1. Your IL program should resemble the following figure.
7. Save your work: Select File, Save All or press Ctrl + Shift + A.
20
October 2000
Communications Setup
Note: If you have already created a Device configuration for your PLC using the Communications Configuration Utility (CCU), you can skip this step. (A Device configuration in the CCU consists of a name that you provide for the configuration, the PLC model, and the default port that VersaPro will use to communicate to the PLC.)
1. Select Tools, Communications Setup. (If a password has been defined for the CCU, the Password dialog box will appear. Enter the password and click OK to continue.) The main screen of the CCU will appear. 2. On the Devices tab in the CCU, click the New button. 3. In the Add New Device dialog box, provide a Name for the PLC device that you will be connecting to. As a minimum, you need to select a Default Port under Selected Device Parameter Settings. 4. When you have finished setting up communications for your PLC, click OK to close the CCU and save changes.
Mode
Sweep Time
Equality Status
VersaPro Status Bar 5. If there are faults noted in the status bar, open the Fault Table by selecting Tools, Fault Table. Clear the table by pressing F9 and then close the table. 6. Put the PLC in STOP mode: Click the Stop PLC button or select PLC, Stop.
21
October 2000
8. Make sure Store Logic to PLC is selected and click OK. 9. Review the results in the Information Window. If the store completes successfully, everything is fine. If you had errors compiling your program, review the log, double-click on the errors, correct the errors and repeat the store operation. (Double clicking the error takes you to the error in the Logic Editor window.) 10. Once Store is complete, put the PLC in run mode by clicking the Run PLC button. Note: To hide the Log view, choose Hide from the context-sensitive menu.
2. Toggle a value by selecting on a Ladder Element and then clicking the Toggle a Reference button the PLC toolbar. The toggled element will be highlighted in red.
22
October 2000
4. You can place variables by copying and pasting them from the VDT or the Ladder diagram. You can also drag them from the VDT. Place INPUT_1 and another instance of REG_1 into the Variable View table using one of these techniques. 5. To display a value in a different numerical format, select the value, then choose Display Format from the View menu or the context-sensitive menu. In the figure below, the second instance of REG_1 is displayed in hexadecimal.
23
October 2000
3. As in the VVT, you can change the display format of a selected value. To display a value in a different numerical format, select the value, then choose Display Format from the View menu or the context-sensitive menu.
24
October 2000
The > and ^ format switches affect all the text that follows them until the end of the string or until the next ^, >, or %n.
Print a report.
1. Select File, Print Report. 2. In the Print Report dialog box, select the options that you want to print. (For more information, click the Help button.) 3. When you are ready to print, click OK.
Conclusion
You are now familiar with the basic functionality in VersaPro. Some features have not been discussed, but everything needed to successfully start programming and running PLCs with VersaPro 2.0 has been introduced in this tutorial. We encourage you to further explore the capabilities of VersaPro 2.0 using the online Help and the VersaPro Programming Software User's Guide, GFK-1670. Remember that GE Fanuc Automation is constantly striving to improve the productivity of our customers, and we would like to hear any feedback you have. If you have suggestions for improvement on this product, please contact your GE Fanuc representative.
25