You are on page 1of 5

1(5)

2019-08-06
Anders Nilsson, Forskningsingenjör
Ingenjörsvetenskap/Produktionssystem
0702-23 83 79
anders.nilsson@hv.se

Exercise 1 I/O-Box Logic, timer and counter

Purpose
Use the engineering tool TwinCAT 3 (TC3) from Beckhoff Automation and create logical applications
according to the industrial standard IEC6-1131-3
• Crate PLC-application
• Develop your logical thinking
• Run application in a simulated environment

Equipment
TwinCAT 3 installed on a windows computer

If you use your private computer;


• Install TwinCAT 3.x Engineering software from www.beckhoff.com
• Run the file ” C:\TwinCAT\3.1\System\win8settick.bat” as administrator (right click and select
”Run as administrator”)

Type in the letters if this dialog appears and click OK.

Preparation
• Download the project ” TwinCAT Project IO Box FBD” from Canvas to your computer
• Click on the file ” TwinCAT Project IO Box.sln” to launch the project
• When TC3 started, check that it will run on your local computer, <Local> shall be visible
• Click on ”Activate Configuration” and then answer OK to download the configuration to
your runtime PLC. The configuration contains settings about I/O and cycle times etc.
2(5)

Lab 1a test run the project TwinCAT Project IO Box FBD simulated process
• Select ”PLCSim” and click on the green arrow to download the process simulation application to
the runtime PLC
• Click on the small green arrow to launch the application (if not already started)
• Do the same for ”PLCStudent” to download your application to the runtime PLC
• Click in the project tree and open up the application;
”PLCStudent/PLCStudentProject/POUs/ControlFBD”
• Open up the simulation of the I/O-box, click PLCSim/PLCSimProject/VISUs/Visualization”
• Check that the preprogramed OR function works. Finnish the table for the OR function:

ixButton1 ixButton2 qxLed1


0 0
0 1
1 0
1 1

• Select ”View as Ladder” in the menu FBD/LD/IL

Sketch the ladder diagram here:


3(5)

Task 1b Change from OR to AND


• Log out and change back to FBD and type in AND in the function instead of OR
• Download the application, Green Arrow, and select ”Login with online change”
• Test run and complete the table for the AND function

ixButton1 ixButton2 qxLed1


0 0
0 1
1 0
1 1
• Select ”View as Ladder” in the menu FBD/LD/IL
Sketch the ladder diagram here:

Task 1c Inverting

• Change back to FBD


• Invert the button1, right click to the right of ixButton1 and select ”Negation”

• Run and complete the table for this AND function with an Inverted Input

ixButton1 ixButton2 qxLed1


0 0
0 1
1 0
1 1

• Reflect about this function above and compare with the NAND function. Complete the table
for the NAND function

ixButton1 ixButton2 qxLed1


0 0
0 1
1 0
1 1
4(5)

Task 1d The emergency stop function


• Create a function according to this table:
ixButton1 ixButton2 qxLed1
0 0 1
0 1 0
1 0 0
1 1 0
• There are two solutions, one solution with an OR-function and one with an AND-function just
different placing of the negations.
• Sketch the two solutions as an FBD here:

• What is the name of the theorem that is used when you do this kind of conversions?

• Why is the topic of this exercise “The emergency stop function”?

Task 1d Combined logic


• Create an application in FBD that illuminates the lamp when ixButton1 is on but also when
ixButton2 AND NOT ixButton3 is on. The lamp should never be illuminated if the ixButton4 is
on
• Drag from ”Boolean Operators” in the ”Toolbox”
• Sketch the solution here:
5(5)

Task 1e The Self-holding function


• When a start button and a stop button is wanted to start and stop e.g. an electrical motor is often
the self-holding function used. The self-holding function remember if the start button is pressed.
• Create an FBD application that illuminate qxLamp1 after a press on ixButton7 and turn the lamp
off after a press on ixButton8

Task 1f Timers
• Add a timer (TON) that turns on qxLed2 after that qxlamp1 has been illuminated in 3 seconds
qxLed2 shall turn off as soon as qxLed1 is turned off
• You can find the function block TON under ”Function Blocks”
• Enter the time to t#3s
• Create a new Network by right click and select
• TON is a function and need a name (an instance) e.g. fbTimer, declare it as TON in the header
(Goes automatic if you answer the question you got when you drag in the function block
• Remove the output ET-??? From the TON function block
• Right click on the output Q on the TON function block and select ”Insert Assignment” to got
an assignment to the output qxLed2
• Test run the function

Task 1g Counter
• Add an ”Counter Up” (CTU), in a new network below the timer. The counter shall illuminate
the qxLed3 when you press the ixButton7 five times
• Reset the counter with ixButton8
• Rename the CTU function block to fbCounter and declare it as an CTU
• Test run
• Show the solution for the teacher

You might also like