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:

CAUTION

First Steps 1:

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

  1. Register the CX1010 as a remote computer for TwinCAT.
  2. The local TwinCAT program must run in Start or Config mode.
  3. Create a folder for your project.
  4. 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.
  5. Open the Building Automation PLC project with TwinCAT PLC Control.
  6. Select PC or CX (x86) as the target system in PLC Configuration
  7. Login to the CX1010 (which causes compiling and downloading of the program).
  8. Set this project as the boot project for this CX1010.
  9. Start the PLC.
  10. 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:

First Steps 2:
First Steps 3:

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....


First Steps 4:

The following dialog will appear:


First Steps 5:

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.


First Steps 6:

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.


First Steps 7:

There are now two different ways to find your CX1010 in the network:

  1. Enter the Hostname or IP of the CX1010 and click on Host Name / IP.
  2. 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:


First Steps 8:

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:


First Steps 9:

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.


First Steps 10:

First Steps 11:

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.


First Steps 12:

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.


First Steps 13:

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).


First Steps 14:

Now the element moves to the right side to indicate that it is selected.

Repeat this the same way with the blind drive group.


First Steps 15:

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.


First Steps 16:

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.


First Steps 17:

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.


First Steps 18:

Activate the configuration

First, save the project again by clicking on File → Save As....


First Steps 19:

The Activate Configuration dialog can be accessed via the menu Action → Activate Configuration. Select the CX1010 1 and click on Activate complete Configuration.


First Steps 20:

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!