Refactor room and light configurations for Node-RED integration
- Updated global variable lists in GVL_IO.gvl and GVL_NVL_placeholders.gvl to reflect new room naming conventions and structures. - Revised PLC_App.st to map new room configurations for lighting control. - Enhanced documentation in all-lights-and-rooms.md and ha-lights-and-rooms.md to align with updated room and light entity naming. - Adjusted room-config.js and related Node-RED flows to support the new configuration structure. This update improves the organization and clarity of room and light management within the Node-RED integration, ensuring consistency across the system.
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
(*
|
||||
GVL: GVL_IO
|
||||
Option C relay feedback only. EL2809 DO: map channels directly in the device tree
|
||||
to NVL_Out (e.g. NVL_Out.l_masterBedroom.l_1..l_6, ...) and boiler relay.
|
||||
to NVL_Out (e.g. NVL_Out.l_open_plan_living_room.l_1..l_6, ...) and boiler relay.
|
||||
Initialize EtherCAT_RelayFeedback to zero at startup (or use default init).
|
||||
*)
|
||||
VAR_GLOBAL
|
||||
// ---------- Option C: relay feedback (copy of output for next cycle) ----------
|
||||
EtherCAT_RelayFeedback: STRUCT
|
||||
masterBedroom: struct_room_outs;
|
||||
masterBathroom: struct_room_outs;
|
||||
bedroom_1: struct_room_outs;
|
||||
bedroom_2: struct_room_outs;
|
||||
bathroom: struct_room_outs;
|
||||
guest_wc: struct_room_outs;
|
||||
kitchen: struct_room_outs;
|
||||
pantry: struct_room_outs;
|
||||
livingRoom: struct_room_outs;
|
||||
diningRoom: struct_room_outs;
|
||||
entrance: struct_room_outs;
|
||||
hallway: struct_room_outs;
|
||||
veranda: struct_room_outs;
|
||||
front: struct_room_outs;
|
||||
back: struct_room_outs;
|
||||
side: struct_room_outs;
|
||||
open_plan_living_room: struct_room_outs;
|
||||
open_plan_dining_room: struct_room_outs;
|
||||
open_plan_entrance: struct_room_outs;
|
||||
open_plan_guest_wc: struct_room_outs;
|
||||
kitchen_kitchen: struct_room_outs;
|
||||
kitchen_pantry: struct_room_outs;
|
||||
bedrooms_office: struct_room_outs;
|
||||
bedrooms_hallway: struct_room_outs;
|
||||
bedrooms_laundry: struct_room_outs;
|
||||
bedrooms_shower: struct_room_outs;
|
||||
bedrooms_bedroom: struct_room_outs;
|
||||
master_bedroom_suite: struct_room_outs;
|
||||
master_bedroom_bathroom: struct_room_outs;
|
||||
exterior_veranda: struct_room_outs;
|
||||
exterior_entrance: struct_room_outs;
|
||||
exterior_yard: struct_room_outs;
|
||||
END_STRUCT;
|
||||
END_VAR
|
||||
|
||||
@@ -5,42 +5,42 @@
|
||||
*)
|
||||
VAR_GLOBAL
|
||||
NVL_In: STRUCT
|
||||
masterBedroom: struct_room_cmds;
|
||||
masterBathroom: struct_room_cmds;
|
||||
bedroom_1: struct_room_cmds;
|
||||
bedroom_2: struct_room_cmds;
|
||||
bathroom: struct_room_cmds;
|
||||
guestWc: struct_room_cmds;
|
||||
kitchen: struct_room_cmds;
|
||||
pantry: struct_room_cmds;
|
||||
livingRoom: struct_room_cmds;
|
||||
dinningRoom: struct_room_cmds;
|
||||
entrance: struct_room_cmds;
|
||||
hallway: struct_room_cmds;
|
||||
outVeranda: struct_room_cmds;
|
||||
outFront: struct_room_cmds;
|
||||
outBack: struct_room_cmds;
|
||||
outSide: struct_room_cmds;
|
||||
open_plan_living_room: struct_room_cmds;
|
||||
open_plan_dining_room: struct_room_cmds;
|
||||
open_plan_entrance: struct_room_cmds;
|
||||
open_plan_guest_wc: struct_room_cmds;
|
||||
kitchen_kitchen: struct_room_cmds;
|
||||
kitchen_pantry: struct_room_cmds;
|
||||
bedrooms_office: struct_room_cmds;
|
||||
bedrooms_hallway: struct_room_cmds;
|
||||
bedrooms_laundry: struct_room_cmds;
|
||||
bedrooms_shower: struct_room_cmds;
|
||||
bedrooms_bedroom: struct_room_cmds;
|
||||
master_bedroom_suite: struct_room_cmds;
|
||||
master_bedroom_bathroom: struct_room_cmds;
|
||||
exterior_veranda: struct_room_cmds;
|
||||
exterior_entrance: struct_room_cmds;
|
||||
exterior_yard: struct_room_cmds;
|
||||
boiler: struct_boiler_cmd;
|
||||
END_STRUCT;
|
||||
|
||||
NVL_Out: STRUCT
|
||||
l_masterBedroom: struct_room_outs;
|
||||
l_masterBathroom: struct_room_outs;
|
||||
l_bedroom_1: struct_room_outs;
|
||||
l_bedroom_2: struct_room_outs;
|
||||
l_bathroom: struct_room_outs;
|
||||
l_guestWc: struct_room_outs;
|
||||
l_kitchen: struct_room_outs;
|
||||
l_pantry: struct_room_outs;
|
||||
l_livingRoom: struct_room_outs;
|
||||
l_dinningRoom: struct_room_outs;
|
||||
l_entrance: struct_room_outs;
|
||||
l_hallway: struct_room_outs;
|
||||
l_outVeranda: struct_room_outs;
|
||||
l_outFront: struct_room_outs;
|
||||
l_outBack: struct_room_outs;
|
||||
l_outSide: struct_room_outs;
|
||||
l_open_plan_living_room: struct_room_outs;
|
||||
l_open_plan_dining_room: struct_room_outs;
|
||||
l_open_plan_entrance: struct_room_outs;
|
||||
l_open_plan_guest_wc: struct_room_outs;
|
||||
l_kitchen_kitchen: struct_room_outs;
|
||||
l_kitchen_pantry: struct_room_outs;
|
||||
l_bedrooms_office: struct_room_outs;
|
||||
l_bedrooms_hallway: struct_room_outs;
|
||||
l_bedrooms_laundry: struct_room_outs;
|
||||
l_bedrooms_shower: struct_room_outs;
|
||||
l_bedrooms_bedroom: struct_room_outs;
|
||||
l_master_bedroom_suite: struct_room_outs;
|
||||
l_master_bedroom_bathroom: struct_room_outs;
|
||||
l_exterior_veranda: struct_room_outs;
|
||||
l_exterior_entrance: struct_room_outs;
|
||||
l_exterior_yard: struct_room_outs;
|
||||
boiler_status: struct_boiler_status;
|
||||
END_STRUCT;
|
||||
|
||||
|
||||
@@ -23,12 +23,14 @@ This folder describes the **network variable** setup used for CODESYS ↔ Node-R
|
||||
|
||||
| Variable | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `l_masterBedroom` | struct_room_outs | 12 BOOLs (l_1..l_6, l_1_status..l_6_status) |
|
||||
| `l_masterBathroom` | struct_room_outs | same |
|
||||
| `l_bedroom_1` .. `l_bedroom_2` | struct_room_outs | same |
|
||||
| `l_bathroom`, `l_guestWc`, `l_kitchen`, `l_pantry` | struct_room_outs | same |
|
||||
| `l_livingRoom`, `l_dinningRoom`, `l_entrance`, `l_hallway` | struct_room_outs | same |
|
||||
| `l_outVeranda`, `l_outFront`, `l_outBack`, `l_outSide` | struct_room_outs | same |
|
||||
| `l_open_plan_living_room` | struct_room_outs | 6 BOOLs (`l_1..l_6`) |
|
||||
| `l_open_plan_dining_room` | struct_room_outs | same |
|
||||
| `l_open_plan_entrance` | struct_room_outs | same |
|
||||
| `l_open_plan_guest_wc` | struct_room_outs | same |
|
||||
| `l_kitchen_kitchen`, `l_kitchen_pantry` | struct_room_outs | same |
|
||||
| `l_bedrooms_office`, `l_bedrooms_hallway`, `l_bedrooms_laundry`, `l_bedrooms_shower`, `l_bedrooms_bedroom` | struct_room_outs | same |
|
||||
| `l_master_bedroom_suite`, `l_master_bedroom_bathroom` | struct_room_outs | same |
|
||||
| `l_exterior_veranda`, `l_exterior_entrance`, `l_exterior_yard` | struct_room_outs | same |
|
||||
| `boiler_status` | struct_boiler_status | state, relay_output, on_time_minutes, remaining_minutes, emergency_active, time_limit_reached, error_state, error_code |
|
||||
|
||||
**In CODESYS:** Create an **NVL Sender** (Network Variable List), bind it to the **NVL_Out** structure (the same struct as in `GVL_NVL_placeholders.gvl` → `NVL_Out`). Set protocol to UDP, destination IP/port to your Node-RED host, task and interval (e.g. EtherCAT_Task, 50 ms).
|
||||
@@ -43,7 +45,7 @@ This folder describes the **network variable** setup used for CODESYS ↔ Node-R
|
||||
|
||||
| Variable | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `masterBedroom` .. `side` (15 rooms) | struct_room_cmds | ha_l1_on, ha_l1_off, ... ha_l6_on, ha_l6_off, zigbee_sw1..6, ha_all_on, ha_all_off |
|
||||
| `open_plan_living_room` .. `exterior_yard` (16 rooms) | struct_room_cmds | ha_l1_on, ha_l1_off, ... ha_l6_on, ha_l6_off, zigbee_sw1..6, ha_all_on, ha_all_off |
|
||||
| `boiler` | struct_boiler_cmd | ha_on, ha_off, schedule_on, schedule_off, emergency_stop, max_on_time_minutes |
|
||||
|
||||
**In CODESYS:** Create an **NVL Receiver**, bind it to the **NVL_In** structure. Set protocol to UDP, listen port, task and interval. The PLC will overwrite `NVL_In` with received data each cycle.
|
||||
|
||||
@@ -25,7 +25,7 @@ PLC sends one block: all rooms’ `struct_room_outs` followed by `struct_boiler_
|
||||
6 BOOLs in order: `l_1, l_2, l_3, l_4, l_5, l_6` (light state; with Option C this is both output and status).
|
||||
|
||||
- **Size per room:** 6 bytes.
|
||||
- **Rooms in order:** l_masterBedroom, l_masterBathroom, l_bedroom_1, l_bedroom_2, l_bathroom, l_guestWc, l_kitchen, l_pantry, l_livingRoom, l_dinningRoom, l_entrance, l_hallway, l_outVeranda, l_outFront, l_outBack, l_outSide.
|
||||
- **Rooms in order:** l_open_plan_living_room, l_open_plan_dining_room, l_open_plan_entrance, l_open_plan_guest_wc, l_kitchen_kitchen, l_kitchen_pantry, l_bedrooms_office, l_bedrooms_hallway, l_bedrooms_laundry, l_bedrooms_shower, l_bedrooms_bedroom, l_master_bedroom_suite, l_master_bedroom_bathroom, l_exterior_veranda, l_exterior_entrance, l_exterior_yard.
|
||||
- **Total for lights:** 16 × 6 = **96 bytes**.
|
||||
|
||||
### struct_boiler_status (after all rooms)
|
||||
@@ -50,7 +50,7 @@ PLC sends one block: all rooms’ `struct_room_outs` followed by `struct_boiler_
|
||||
// msg.payload = Buffer (UDP payload from PLC)
|
||||
const buf = msg.payload;
|
||||
const roomSize = 6;
|
||||
const roomNames = ['l_masterBedroom','l_masterBathroom','l_bedroom_1','l_bedroom_2','l_bathroom','l_guestWc','l_kitchen','l_pantry','l_livingRoom','l_dinningRoom','l_entrance','l_hallway','l_outVeranda','l_outFront','l_outBack','l_outSide'];
|
||||
const roomNames = ['l_open_plan_living_room','l_open_plan_dining_room','l_open_plan_entrance','l_open_plan_guest_wc','l_kitchen_kitchen','l_kitchen_pantry','l_bedrooms_office','l_bedrooms_hallway','l_bedrooms_laundry','l_bedrooms_shower','l_bedrooms_bedroom','l_master_bedroom_suite','l_master_bedroom_bathroom','l_exterior_veranda','l_exterior_entrance','l_exterior_yard'];
|
||||
|
||||
const out = { rooms: {}, boiler_status: {} };
|
||||
|
||||
@@ -90,7 +90,7 @@ PLC expects one block: all rooms’ `struct_room_cmds` followed by `struct_boile
|
||||
ha_l1_on, ha_l1_off, ha_l2_on, ha_l2_off, ha_l3_on, ha_l3_off, ha_l4_on, ha_l4_off, ha_l5_on, ha_l5_off, ha_l6_on, ha_l6_off, zigbee_sw1..6, ha_all_on, ha_all_off.
|
||||
|
||||
- **Size per room:** 20 bytes.
|
||||
- **Rooms in order:** masterBedroom, masterBathroom, bedroom_1, bedroom_2, bathroom, guestWc, kitchen, pantry, livingRoom, dinningRoom, entrance, hallway, outVeranda, outFront, outBack, outSide.
|
||||
- **Rooms in order:** open_plan_living_room, open_plan_dining_room, open_plan_entrance, open_plan_guest_wc, kitchen_kitchen, kitchen_pantry, bedrooms_office, bedrooms_hallway, bedrooms_laundry, bedrooms_shower, bedrooms_bedroom, master_bedroom_suite, master_bedroom_bathroom, exterior_veranda, exterior_entrance, exterior_yard.
|
||||
- **Total for rooms:** 16 × 20 = **320 bytes**.
|
||||
|
||||
### struct_boiler_cmd
|
||||
@@ -112,7 +112,7 @@ ha_l1_on, ha_l1_off, ha_l2_on, ha_l2_off, ha_l3_on, ha_l3_off, ha_l4_on, ha_l4_o
|
||||
```javascript
|
||||
// Build binary payload for PLC from commands
|
||||
const roomSize = 20;
|
||||
const roomNames = ['masterBedroom','masterBathroom','bedroom_1','bedroom_2','bathroom','guestWc','kitchen','pantry','livingRoom','dinningRoom','entrance','hallway','outVeranda','outFront','outBack','outSide'];
|
||||
const roomNames = ['open_plan_living_room','open_plan_dining_room','open_plan_entrance','open_plan_guest_wc','kitchen_kitchen','kitchen_pantry','bedrooms_office','bedrooms_hallway','bedrooms_laundry','bedrooms_shower','bedrooms_bedroom','master_bedroom_suite','master_bedroom_bathroom','exterior_veranda','exterior_entrance','exterior_yard'];
|
||||
|
||||
const buf = Buffer.alloc(328);
|
||||
const rooms = msg.payload.rooms || {};
|
||||
|
||||
@@ -2,112 +2,112 @@
|
||||
POU: PLC_App
|
||||
Main program (Option C: copy of output as relay feedback).
|
||||
Requires: NVL_In, NVL_Out, GVL_IO (EtherCAT_RelayFeedback).
|
||||
Map EL2809 DO channels in the device tree directly to NVL_Out (e.g. Ch0..5 = l_masterBedroom.l_1..l_6)
|
||||
Map EL2809 DO channels in the device tree directly to NVL_Out (e.g. Ch0..5 = l_open_plan_living_room.l_1..l_6)
|
||||
and Ch15 to boiler relay (e.g. NVL_Out.boiler_status.relay_output or a GVL BOOL).
|
||||
Optional: DI_Emergency_Stop (physical E-Stop input).
|
||||
*)
|
||||
PROGRAM PLC_App
|
||||
VAR
|
||||
masterBedroom: fb_room;
|
||||
masterBathroom: fb_room;
|
||||
bedroom_1: fb_room;
|
||||
bedroom_2: fb_room;
|
||||
bathroom: fb_room;
|
||||
guest_wc: fb_room;
|
||||
kitchen: fb_room;
|
||||
pantry: fb_room;
|
||||
livingRoom: fb_room;
|
||||
diningRoom: fb_room;
|
||||
entrance: fb_room;
|
||||
hallway: fb_room;
|
||||
veranda: fb_room;
|
||||
front: fb_room;
|
||||
back: fb_room;
|
||||
side: fb_room;
|
||||
open_plan_living_room: fb_room;
|
||||
open_plan_dining_room: fb_room;
|
||||
open_plan_entrance: fb_room;
|
||||
open_plan_guest_wc: fb_room;
|
||||
kitchen_kitchen: fb_room;
|
||||
kitchen_pantry: fb_room;
|
||||
bedrooms_office: fb_room;
|
||||
bedrooms_hallway: fb_room;
|
||||
bedrooms_laundry: fb_room;
|
||||
bedrooms_shower: fb_room;
|
||||
bedrooms_bedroom: fb_room;
|
||||
master_bedroom_suite: fb_room;
|
||||
master_bedroom_bathroom: fb_room;
|
||||
exterior_veranda: fb_room;
|
||||
exterior_entrance: fb_room;
|
||||
exterior_yard: fb_room;
|
||||
boiler: fb_boiler;
|
||||
END_VAR
|
||||
|
||||
// ========== SECTION 1: LIGHTING (Option C: relay feedback = copy of output) ==========
|
||||
|
||||
// Master Bedroom
|
||||
masterBedroom(switches := NVL_In.masterBedroom, relay_status := EtherCAT_RelayFeedback.masterBedroom);
|
||||
EtherCAT_RelayFeedback.masterBedroom := masterBedroom.lights;
|
||||
NVL_Out.l_masterBedroom := masterBedroom.lights;
|
||||
// Open Plan - Living Room
|
||||
open_plan_living_room(switches := NVL_In.open_plan_living_room, relay_status := EtherCAT_RelayFeedback.open_plan_living_room);
|
||||
EtherCAT_RelayFeedback.open_plan_living_room := open_plan_living_room.lights;
|
||||
NVL_Out.l_open_plan_living_room := open_plan_living_room.lights;
|
||||
|
||||
// Master Bathroom
|
||||
masterBathroom(switches := NVL_In.masterBathroom, relay_status := EtherCAT_RelayFeedback.masterBathroom);
|
||||
EtherCAT_RelayFeedback.masterBathroom := masterBathroom.lights;
|
||||
NVL_Out.l_masterBathroom := masterBathroom.lights;
|
||||
// Open Plan - Dining Room
|
||||
open_plan_dining_room(switches := NVL_In.open_plan_dining_room, relay_status := EtherCAT_RelayFeedback.open_plan_dining_room);
|
||||
EtherCAT_RelayFeedback.open_plan_dining_room := open_plan_dining_room.lights;
|
||||
NVL_Out.l_open_plan_dining_room := open_plan_dining_room.lights;
|
||||
|
||||
// Bedroom 1
|
||||
bedroom_1(switches := NVL_In.bedroom_1, relay_status := EtherCAT_RelayFeedback.bedroom_1);
|
||||
EtherCAT_RelayFeedback.bedroom_1 := bedroom_1.lights;
|
||||
NVL_Out.l_bedroom_1 := bedroom_1.lights;
|
||||
// Open Plan - Entrance
|
||||
open_plan_entrance(switches := NVL_In.open_plan_entrance, relay_status := EtherCAT_RelayFeedback.open_plan_entrance);
|
||||
EtherCAT_RelayFeedback.open_plan_entrance := open_plan_entrance.lights;
|
||||
NVL_Out.l_open_plan_entrance := open_plan_entrance.lights;
|
||||
|
||||
// Bedroom 2
|
||||
bedroom_2(switches := NVL_In.bedroom_2, relay_status := EtherCAT_RelayFeedback.bedroom_2);
|
||||
EtherCAT_RelayFeedback.bedroom_2 := bedroom_2.lights;
|
||||
NVL_Out.l_bedroom_2 := bedroom_2.lights;
|
||||
|
||||
// Bathroom
|
||||
bathroom(switches := NVL_In.bathroom, relay_status := EtherCAT_RelayFeedback.bathroom);
|
||||
EtherCAT_RelayFeedback.bathroom := bathroom.lights;
|
||||
NVL_Out.l_bathroom := bathroom.lights;
|
||||
|
||||
// Guest WC
|
||||
guest_wc(switches := NVL_In.guestWc, relay_status := EtherCAT_RelayFeedback.guest_wc);
|
||||
EtherCAT_RelayFeedback.guest_wc := guest_wc.lights;
|
||||
NVL_Out.l_guestWc := guest_wc.lights;
|
||||
// Open Plan - Guest WC
|
||||
open_plan_guest_wc(switches := NVL_In.open_plan_guest_wc, relay_status := EtherCAT_RelayFeedback.open_plan_guest_wc);
|
||||
EtherCAT_RelayFeedback.open_plan_guest_wc := open_plan_guest_wc.lights;
|
||||
NVL_Out.l_open_plan_guest_wc := open_plan_guest_wc.lights;
|
||||
|
||||
// Kitchen
|
||||
kitchen(switches := NVL_In.kitchen, relay_status := EtherCAT_RelayFeedback.kitchen);
|
||||
EtherCAT_RelayFeedback.kitchen := kitchen.lights;
|
||||
NVL_Out.l_kitchen := kitchen.lights;
|
||||
kitchen_kitchen(switches := NVL_In.kitchen_kitchen, relay_status := EtherCAT_RelayFeedback.kitchen_kitchen);
|
||||
EtherCAT_RelayFeedback.kitchen_kitchen := kitchen_kitchen.lights;
|
||||
NVL_Out.l_kitchen_kitchen := kitchen_kitchen.lights;
|
||||
|
||||
// Pantry
|
||||
pantry(switches := NVL_In.pantry, relay_status := EtherCAT_RelayFeedback.pantry);
|
||||
EtherCAT_RelayFeedback.pantry := pantry.lights;
|
||||
NVL_Out.l_pantry := pantry.lights;
|
||||
kitchen_pantry(switches := NVL_In.kitchen_pantry, relay_status := EtherCAT_RelayFeedback.kitchen_pantry);
|
||||
EtherCAT_RelayFeedback.kitchen_pantry := kitchen_pantry.lights;
|
||||
NVL_Out.l_kitchen_pantry := kitchen_pantry.lights;
|
||||
|
||||
// Living Room
|
||||
livingRoom(switches := NVL_In.livingRoom, relay_status := EtherCAT_RelayFeedback.livingRoom);
|
||||
EtherCAT_RelayFeedback.livingRoom := livingRoom.lights;
|
||||
NVL_Out.l_livingRoom := livingRoom.lights;
|
||||
// Bedrooms - Office
|
||||
bedrooms_office(switches := NVL_In.bedrooms_office, relay_status := EtherCAT_RelayFeedback.bedrooms_office);
|
||||
EtherCAT_RelayFeedback.bedrooms_office := bedrooms_office.lights;
|
||||
NVL_Out.l_bedrooms_office := bedrooms_office.lights;
|
||||
|
||||
// Dining Room
|
||||
diningRoom(switches := NVL_In.dinningRoom, relay_status := EtherCAT_RelayFeedback.diningRoom);
|
||||
EtherCAT_RelayFeedback.diningRoom := diningRoom.lights;
|
||||
NVL_Out.l_dinningRoom := diningRoom.lights;
|
||||
// Bedrooms - Hallway
|
||||
bedrooms_hallway(switches := NVL_In.bedrooms_hallway, relay_status := EtherCAT_RelayFeedback.bedrooms_hallway);
|
||||
EtherCAT_RelayFeedback.bedrooms_hallway := bedrooms_hallway.lights;
|
||||
NVL_Out.l_bedrooms_hallway := bedrooms_hallway.lights;
|
||||
|
||||
// Entrance
|
||||
entrance(switches := NVL_In.entrance, relay_status := EtherCAT_RelayFeedback.entrance);
|
||||
EtherCAT_RelayFeedback.entrance := entrance.lights;
|
||||
NVL_Out.l_entrance := entrance.lights;
|
||||
// Bedrooms - Laundry
|
||||
bedrooms_laundry(switches := NVL_In.bedrooms_laundry, relay_status := EtherCAT_RelayFeedback.bedrooms_laundry);
|
||||
EtherCAT_RelayFeedback.bedrooms_laundry := bedrooms_laundry.lights;
|
||||
NVL_Out.l_bedrooms_laundry := bedrooms_laundry.lights;
|
||||
|
||||
// Hallway
|
||||
hallway(switches := NVL_In.hallway, relay_status := EtherCAT_RelayFeedback.hallway);
|
||||
EtherCAT_RelayFeedback.hallway := hallway.lights;
|
||||
NVL_Out.l_hallway := hallway.lights;
|
||||
// Bedrooms - Shower
|
||||
bedrooms_shower(switches := NVL_In.bedrooms_shower, relay_status := EtherCAT_RelayFeedback.bedrooms_shower);
|
||||
EtherCAT_RelayFeedback.bedrooms_shower := bedrooms_shower.lights;
|
||||
NVL_Out.l_bedrooms_shower := bedrooms_shower.lights;
|
||||
|
||||
// Veranda
|
||||
veranda(switches := NVL_In.outVeranda, relay_status := EtherCAT_RelayFeedback.veranda);
|
||||
EtherCAT_RelayFeedback.veranda := veranda.lights;
|
||||
NVL_Out.l_outVeranda := veranda.lights;
|
||||
// Bedrooms - Bedroom
|
||||
bedrooms_bedroom(switches := NVL_In.bedrooms_bedroom, relay_status := EtherCAT_RelayFeedback.bedrooms_bedroom);
|
||||
EtherCAT_RelayFeedback.bedrooms_bedroom := bedrooms_bedroom.lights;
|
||||
NVL_Out.l_bedrooms_bedroom := bedrooms_bedroom.lights;
|
||||
|
||||
// Front
|
||||
front(switches := NVL_In.outFront, relay_status := EtherCAT_RelayFeedback.front);
|
||||
EtherCAT_RelayFeedback.front := front.lights;
|
||||
NVL_Out.l_outFront := front.lights;
|
||||
// Master Bedroom - Suite
|
||||
master_bedroom_suite(switches := NVL_In.master_bedroom_suite, relay_status := EtherCAT_RelayFeedback.master_bedroom_suite);
|
||||
EtherCAT_RelayFeedback.master_bedroom_suite := master_bedroom_suite.lights;
|
||||
NVL_Out.l_master_bedroom_suite := master_bedroom_suite.lights;
|
||||
|
||||
// Back
|
||||
back(switches := NVL_In.outBack, relay_status := EtherCAT_RelayFeedback.back);
|
||||
EtherCAT_RelayFeedback.back := back.lights;
|
||||
NVL_Out.l_outBack := back.lights;
|
||||
// Master Bedroom - Bathroom
|
||||
master_bedroom_bathroom(switches := NVL_In.master_bedroom_bathroom, relay_status := EtherCAT_RelayFeedback.master_bedroom_bathroom);
|
||||
EtherCAT_RelayFeedback.master_bedroom_bathroom := master_bedroom_bathroom.lights;
|
||||
NVL_Out.l_master_bedroom_bathroom := master_bedroom_bathroom.lights;
|
||||
|
||||
// Side
|
||||
side(switches := NVL_In.outSide, relay_status := EtherCAT_RelayFeedback.side);
|
||||
EtherCAT_RelayFeedback.side := side.lights;
|
||||
NVL_Out.l_outSide := side.lights;
|
||||
// Exterior - Veranda
|
||||
exterior_veranda(switches := NVL_In.exterior_veranda, relay_status := EtherCAT_RelayFeedback.exterior_veranda);
|
||||
EtherCAT_RelayFeedback.exterior_veranda := exterior_veranda.lights;
|
||||
NVL_Out.l_exterior_veranda := exterior_veranda.lights;
|
||||
|
||||
// Exterior - Entrance
|
||||
exterior_entrance(switches := NVL_In.exterior_entrance, relay_status := EtherCAT_RelayFeedback.exterior_entrance);
|
||||
EtherCAT_RelayFeedback.exterior_entrance := exterior_entrance.lights;
|
||||
NVL_Out.l_exterior_entrance := exterior_entrance.lights;
|
||||
|
||||
// Exterior - Yard
|
||||
exterior_yard(switches := NVL_In.exterior_yard, relay_status := EtherCAT_RelayFeedback.exterior_yard);
|
||||
EtherCAT_RelayFeedback.exterior_yard := exterior_yard.lights;
|
||||
NVL_Out.l_exterior_yard := exterior_yard.lights;
|
||||
|
||||
// ========== SECTION 2: BOILER ==========
|
||||
|
||||
|
||||
Reference in New Issue
Block a user