Jumat, 06 Maret 2009

Function block in the ladder diagram.

First Rung Place a function block in the ladder diagram.
1. Choose Data Move from the box on the left side of the Compact Function Toolbar. The listbox will become populated with the Data Move Functions.
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.

Insert a row and drag & drop.
1. Insert an empty row between the Rungs 1 and 2 by right clicking on the MOVE_WORD function and selecting Insert Row from the context-sensitive menu.
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.

Compile the program and navigate to errors
1. Insert a few contacts without naming them and a few function blocks without assigning lengths or inputs or outputs
2. Select Folder, Check Block _MAIN. This compiles the folder and brings up the Information Window. If the Information Window is too small, place the cursor on the edge of the window and
click and drag to enlarge it.
3. Scroll through the Information Window to see the errors. To navigate to an error, place the cursor on the error text and double click. The area where the error occurred will be highlighted in the
Ladder Editor window.
4. Fix the errors and check the block again. When there are no more errors, the Syntax Check Summary in the Information Window will show “Total errors: 0.”

Creating New Blocks
You can create new objects in the folder by right clicking in the Folder Browser and picking the appropriate menu item from the File menu or the context-sensitive menu.
Note: If you are using a Series 90 Micro PLC or Series 90-70 PLC, which do not support Instruction List subroutines, you will want to skip Lessons 7 and 8. You can continue with lessons 9 and 10.

Create an Instruction List block.
1. Right click in the Folder Browser and select New, Subroutine, Instruction List from the context sensitive menu. The Create New Instruction List dialog box will be displayed.
2. Name the new block and type in a brief description of the block. Click OK. An Instruction List editor window for the new block will open.
3. Set temporary variables for the IL block. Select Edit, Properties, Variable Table. Select the Temporary Variables radio button. In the Boolean Address Start field, type 1T (or %T00001). In the Integer Address Start field, type 500R (or %R00500). Click OK.

Place a call to your new block in the _MAIN program.
1. Open the _MAIN program. (If the _MAIN program is already open, select it from the Window menu. If it is not open, double click the _MAIN-LD block in the folder browser.)
2. Click the Call button in the Ladder Toolbar and then click in the ladder diagram below the comment you created in Lesson 6. Press Enter. The Call function block will appear as follows.
3. Press Enter and select the new block from the list box that appears.

Tidak ada komentar: