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.
This is what your code should look like:
Your view should look something like this:
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.
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.