Tutorial 9: Creating a temperature controller supervisor for your temperature regulator

Having prepared our temperature regulator to act as a servant, let us build a supervisor to control it.

We will build this:

The below illustration shows what you will build in this tutorial. The red dots indicate tutorial steps.

Step 1 Create a temperature controller component with logging and visualisation.

Create a new type inherited from PD 7664 process component. Rename to "XX_temperature_controller_simple".

Add a servant proxy for our component "XX_temperature_regulator_notification".

Create two registers "Control set point" and "Temperature log" of type absolute temperature and enable logging. Set default value for set point to 25 degrees celcius. Also remember to set the range of both registers.

If you are unsure how to do it, refer back to tutorial 1 step 2 (create local variables) and 4 (create registers) and tutorial 3 (adding data logging).

Override  calculate actual and write temperature into the temperature register and write the set point to the servant.

This is what your code should look like:

 

Create a visualisation for the component based on PD 11813 Comp_view.  Add visualisation for your two registers and the name of the component. Adjust the view region so it fits the content.

Your view should look something like this:

 

 

 

 

 

Step 2 Create main assembly with visualisation.

Create an assembly, rename to "XX_temperature_controller_simple_main".

Add two instances of "XX_temperature_controller_simple" rename one to "Bedroom controller" and one to "Diningroom controller". Add two instances of "XX_temperature_regulator_notification_assembly". Rename one to "Bedroom" and one to "Diningroom". Connect the supervisor/servant-pairs.

Add one instance of: "Download assembly with 610", PD850 and "COPP PC with display". Connect the nets and locate your components in the PD850.

Create a visualisation for your main assembly with a controls section for the temperature controllers and a regulator section for the temperature regulators. You can reuse any of the visualisations already made. Refer to tutorial 4 if you are unsure how to do it. 

Your visualisation should look something like this:

 

Step 3. Create build and run project

Create a project and rename to "XX_temperature_controller_simple_project". Set "color theme", "Quantity <> local unit relations table" and "editor for view type table". Add your main assembly "XX_temperature_controller_simple_main".  Add your visualisation from step 2 as guest view on the COPP PC with display. Find the "Project Downloader device" in the "download" assembly and set it as downloader.  Type in serial numbers for the devices.

Reuse the test bed as-is. 

Set the control set point to various values, notice how it gets sent to the servant. Likewise observe how the actual temperature gets sent from the servant to the supervisor

For our next tutorial we will enhance the functionality of the temperature controller.