Section 7

Section 7
31
31
Example Program
Step 26:
Adding a
Comparative
Boolean
Instruction
You are now ready to start a new rung. The next rung of logic will turn ON an output
when the counter reaches a count of 5. Use the Tool palette to open the Equal To
(Comparative Boolean) dialog. Type in CTA0, which is the DirectSOFT name for the
accumulated value of counter CT0. Tab to the right side of the input window to enter
K5. Select the check mark when you have entered the constant value, K5.
Click on this
icon to open
“equal to”
dialog.
In this example, you will use C1 as a test output coil. You will be able to see if C1 turns
Step 27:
ON by viewing the screen during the running of this program. As an output turns from
Adding a
Conditional Output OFF to ON, there is a color change on the screen for that particular element.
Add C1 to the rung at this time by moving your cursor to the end of the rung and
pressing F5 to open the Coil Tab of the Instruction Browser. Select Standard
Coil and OUT from the available choices. Select OK when finished.
32
Example Program
After selecting OK in the Instruction Browser, the Element Dialog box appears.
You will be prompted for the output relay designation. In this case, type in C1.
Element Dialog Window
You can now enter the nickname “Test Output1” for C1, using the same
procedure used earlier. Press the key combination CTRL + D to bring up the
Documentation Editor and enter“Test Output1” into the Nickname window.
33
33
Example Program
Close the Documentation Editor and return to the rung. Notice the Nickname Test
Output1 is now above the element. You are now finished with these rungs. Accept
them by using the hot key F8 or by selecting Edit/Accept from the upper menu bar.
Step 28:
Copying to the
Clipboard
The following example illustrates the use of the Copy and Paste features of
DirectSOFT. You will copy a rung and paste it to the next. Then, change the count
value to K6 and use output relay C2 to test it.
To copy a rung, first select the rung. Rungs cannot be selected and copied
unless you have accepted the rung. Accept the rung by selecting Edit and
Accept. You will see a green vertical bar by the rung when it is accepted.
Now you can select the rung for copying. This is accomplished by placing your
cursor on the rung and using the SHIFT + Arrow key combination. With the rung
selected, select Edit then select Copy to send a copy of the rung to the Windows
clipboard.
34
Example Program
Step 29:
Pasting to your
Program
Once you have selected the rung and copied it to the clipboard,
¬ move the cursor down to the next rung in order to paste. The position of the paste
will always be one rung above the current cursor position.
­ To paste, select the Clipboard Icon, select Paste from the Edit menu, or
use the key combination CTRL + V. Step 2 below shows the pasted rung in
position.
Move the cursor up to the pasted rung and start changing the elements. Start by
editing the conditional contact so it shows K6.
® When the cursor is on the conditional contact, you can press the Enter key
and the input window will be opened. Press the tab key to move the cursor to the
right. Type in K6 in place of K5 and then select the check mark 3.
¬
­
®
35
35
Example Program
Next, move the cursor to the end of the pasted rung. With the cursor over the C1
output element, double click with your mouse. This opens the window for editing the
output coil. Change it to C2.
You will also want to assign the nickname C2 to “Test Output2”. Use the key
combination CTRL + D to bring up the Documentation Editor. Follow the steps
discussed previously for changing and entering the nickname. When your finished
the dialog will show the information given below.
36
Example Program
Step 30:
Ending the
Program
Every program must have a rung with the END command. Move your cursor to the
far right of the next rung. Press the F5 key to bring up the Coil Tab of the Instruction
Browser. Select Program Control under Coil Class and END under Coils.
Click on OK when you are finished. With the final rung showing the END statement,
you have now completed the program. Press F8 to accept the rungs. Finally, click on
the Save to Disk icon of the toolbar. You are now ready to connect and communicate
with your PLC. Move to the next page and see how to download the program to the
PLCs memory and test it.
Save to Disk
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement