First Steps
In this sample a project for a room containing a lamp and blinds is created with the help of the Building Automation Manager
Hardware
The following hardware is needed:
- CX1010 (embedded PC)
- KL1104 (4-channel digital input terminal, 24 V DC) → 1 button for the lamp and 2 buttons for the blinds
- KL9260 (power supplier, 230V AC) → power supply for the following two terminals
- KL2751 (1-channel universal dimmer, 230 V AC) → output for the dimmer lamp
- KL2722 (2-channel triac output terminal, 230 V AC) → output for the blinds
- KL9010 (end terminal)
CAUTION | ||
Operating high voltage Be careful when working with 230V devices. Wrong usage may easily cause injuries, damages of the device or short-circuits. Let only qualified personnel work with these devices and read the corresponding hardware documentation. |
Setting up the PLC
- Register the CX1010 as a remote computer for TwinCAT.
- The local TwinCAT program must run in Start or Config mode.
- Create a folder for your project.
- Copy the Building Automation PLC project to it (usually located in C:\TwinCAT\BAFrameworkV2.20\BAManager\Samples\FirstSteps).
Make sure the project is NOT read-only. - Open the Building Automation PLC project with TwinCAT PLC Control.
- Select PC or CX (x86) as the target system in PLC Configuration
- Login to the CX1010 (which causes compiling and downloading of the program).
- Set this project as the boot project for this CX1010.
- Start the PLC.
- Save the project. Make sure that the *.tpy file is now in your project folder
Notice | |
Read the documentation of PLC Control if you are not confirmed with its usage. It is recommended to have taken part in a TwinCAT training. |
Using the Building Automation Manager
To start the application go to Start → All Programs → TwinCAT System → TwinCAT Building Automation Framework → TwinCAT Building Automation Manager.
The Building Automation Manager should look like this:
If the BA Manager does not look like this please click on File → New. |
Adding the hardware
First add the controller. Right-click on Controllers in the Controllers tab and select Add Item....
The following dialog will appear:
This dialog is always used when you want to append elements. It lists up all possible elements you can append at this position.
If you insert no name then a default name is used. The name can be changed afterwards as well.
We now want to add just one CX1010, so you have to choose the CX1010.
Now you can see the general information about the new CX1010. On this page you can change the name of the element, see the internal id and the type, add comments or disable the element.
To establish the connection select the Settings tab and click on the Search (Ethernet)... button.
There are now two different ways to find your CX1010 in the network:
- Enter the Hostname or IP of the CX1010 and click on Host Name / IP.
- Click Broadcast Search. Thereby all devices in the network are listed.
Select your device and click the Add button.
The information of the device show up in the Settings tab:
Click on the + to the left of the CX1010 1 node, select I/O Devices and append a CX1100 Power Supplier/Terminal Device.
Append a CX1100-KB (Terminal Coupler) to CX1100 Power Supplier/Terminal Device 1.
Now append all the above mentioned terminals to Coupler CX1100-KB (Terminal Coupler) 1. When you're finished it should look like this:
Click on Application Program in the tree-view and select the Settings tab. The *.tpy file of your Building Automation PLC project has to be entered here. To do so click on Change... and open the *.tpy file of your PLC project.
It is recommended to have all project-related files in one folder. The Relative to BAMX-File option becomes available, after the project was saved for the first time. It can be done by clicking on File → Save As.... |
Creating sensors and actuators
Sensors have to be linked to the input-channels and actuators have to be linked to the output-channels of the hardware.
Click on the + left to the Application Program node and after that on the + to the left of the Sensors. Append 3 Type 1 - standard Digital Signal (use the Multiple control-box to append them in one step).
Select the Settings tab of the first digital signal and click on the Linked to... button.
Link to the first channel of the KL1104.
Repeat this for the other digital signals and link them to channel 2 and 3 of the KL1104 terminal.
Expand Actuators and append a Type 1 - standard Lamp. Link the Analog Output of the lamp to channel 1 of the KL2751.Append a Type 1 - standard Blind Drive and link Digital Output Up to channel 1 and Digital Output Down to channel 2 of the KL2722.
Setting up groups and functional units
To be able to add functionality, every sensor and actuator has to be placed inside of a group. Actuator groups have to be called up from a functional unit.
Expand Actuator Groups and append a Type 1 - standard Lamp Group. Select the Lamps tab and click on the Edit button.
Select Type 1 - standard Lamp 1 and click >> (or alternatively double-click on Type 1 - standard Lamp 1).
Now the element moves to the right side to indicate that it is selected.
Repeat this the same way with the blind drive group.
Creating sensor groups
The sensor groups provide the ability to set up and customize functionalities. They contain the information which action of which functional unit is called up when something happens to a sensor.
Expand Sensor Groups and append 3 Type 1 - standard Digital Signal Group. Select the Signals tab of the 1st (2nd, 3rd) group and add the 1st (2nd, 3rd) digital signal.
Expand Functional Units and append a Type 1 - Dimmer Switch unit. Select the lamp group you created before in the Sensors / Actuators tab of this new unit by clicking on Edit. Choose the Type 1 - standard Digital Signal Group 1 for Dimm Up/Down by clicking on Edit.
Repeat this process for the sunblind. Choose Type 1 - standard Digital Signal Group 2 for drive Up and 3 for drive Down.
Designing the building
The Building Automation Manager allows you to design the whole structure of your building and add the corresponding functional units to it. Select the Buildings tab and append a Building with a floor and an area. Select the Contents tab of the Area 1 and add the Type 1 - Dimmer Switch 1 and Type 1 - standard Sunblind 1 functional units.
Activate the configuration
First, save the project again by clicking on File → Save As....
The Activate Configuration dialog can be accessed via the menu Action → Activate Configuration. Select the CX1010 1 and click on Activate complete Configuration.
Now wait until the Building Automation Manager has finished the activation of the configuration. If no warning or error appears in the Messages field at the bottom of the BA Manager everything is working perfectly.
Congratulations, you have created your first and fully functional Building Automation Project!