From 7762ea3f1bf9d3041ecb92ebf5a591adef982a77 Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Thu, 9 Feb 2017 22:21:09 +0100 Subject: [PATCH 1/9] updated for wests --- coffee/models/mtcs/common/software.coffee | 8 +- coffee/models/mtcs/services/software.coffee | 162 +++++++++++++++++--- coffee/models/mtcs/software.coffee | 9 ++ 3 files changed, 153 insertions(+), 26 deletions(-) diff --git a/coffee/models/mtcs/common/software.coffee b/coffee/models/mtcs/common/software.coffee index 227600f..62dd215 100644 --- a/coffee/models/mtcs/common/software.coffee +++ b/coffee/models/mtcs/common/software.coffee @@ -1988,7 +1988,7 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusReadCoilProcess", address : { type: t_uint16 , comment: "Modbus data address"} variables: value : { type: t_bool, comment: "Value of the coil" } - errorId : { type: t_uint16, comment: "Error Id. Modbus error code" } + errorId : { type: t_int16, comment: "Error Id. Modbus error code" } ######################################################################################################################## # ModbusRTUBusWriteCoilProcess @@ -2000,7 +2000,7 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusWriteCoilProcess", address : { type: t_uint16 , comment: "Modbus data address"} value : { type: t_bool, comment: "Value to write on the coil" } variables: - errorId : { type: t_uint8, comment: "Error Id. Modbus error code" } + errorId : { type: t_int16, comment: "Error Id. Modbus error code" } ######################################################################################################################## # ModbusRTUBusReadRegisterProcess @@ -2012,7 +2012,7 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusReadRegisterProcess", address : { type: t_uint16 , comment: "Modbus data address"} variables: value : { type: t_int16, comment: "Value of the register" } - errorId : { type: t_uint8, comment: "Error Id. Modbus error code" } + errorId : { type: t_int16, comment: "Error Id. Modbus error code" } ######################################################################################################################## # ModbusRTUBusWriteRegisterProcess @@ -2024,7 +2024,7 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusWriteRegisterProcess", address : { type: t_uint16 , comment: "Modbus data address"} value : { type: t_int16, comment: "Value to write on the register" } variables: - errorId : { type: t_uint8, comment: "Error Id. Modbus error code" } + errorId : { type: t_int16, comment: "Error Id. Modbus error code" } ######################################################################################################################## # ModbusRTUBus diff --git a/coffee/models/mtcs/services/software.coffee b/coffee/models/mtcs/services/software.coffee index 35a50be..8f3f781 100644 --- a/coffee/models/mtcs/services/software.coffee +++ b/coffee/models/mtcs/services/software.coffee @@ -163,6 +163,55 @@ MTCS_MAKE_CONFIG THISLIB, "ServicesMeteoConfig", comment: "Config for the 3.5 V reference voltage" expand: false + + + +######################################################################################################################## +# ServicesWestTemperatureTimeConfig +######################################################################################################################## + +MTCS_MAKE_CONFIG THISLIB, "ServicesWestTemperatureTimeConfig", + items: + enable: + type: t_bool + comment: "Enable this time (TRUE) or not (FALSE)" + hour: + type: t_double + comment: "The time to change the setpoint, as decimal hour (e.g. 9.5 = 9:30 am)" + offset: + type: t_double + comment: "Setpoint = air temperature of meteo station + this offset (in degrees celsius)" + + +######################################################################################################################## +# ServicesWestTemperatureUpdateConfig +######################################################################################################################## + +MTCS_MAKE_CONFIG THISLIB, "ServicesWestTemperatureUpdateConfig", + items: + time0: { type: THISLIB.ServicesWestTemperatureTimeConfig, comment: "Time config 0" } + time1: { type: THISLIB.ServicesWestTemperatureTimeConfig, comment: "Time config 1" } + time2: { type: THISLIB.ServicesWestTemperatureTimeConfig, comment: "Time config 2" } + time3: { type: THISLIB.ServicesWestTemperatureTimeConfig, comment: "Time config 3" } + time4: { type: THISLIB.ServicesWestTemperatureTimeConfig, comment: "Time config 4" } + + +######################################################################################################################## +# ServicesWestControllerConfig +######################################################################################################################## + +MTCS_MAKE_CONFIG THISLIB, "ServicesWestControllerConfig", + items: + address: + type: t_uint8 + comment: "The address of the controller" + measurement: + type: COMMONLIB.MeasurementConfig + comment: "The measurement config" + update: + type: t_bool + comment: "True to automatically update the setpoint" + ######################################################################################################################## # ServicesWestConfig ######################################################################################################################## @@ -171,7 +220,22 @@ MTCS_MAKE_CONFIG THISLIB, "ServicesWestConfig", items: pollingInterval : type: t_double - comment: "Time between West reads in seconds" + comment: "Time between bus reads in seconds" + domeTemperature: + type: THISLIB.ServicesWestControllerConfig + comment: "The address of the Dome temperature controller" + firstFloorTemperature: + type: THISLIB.ServicesWestControllerConfig + comment: "The address of the first floor temperature controller" + pumpsRoomTemperature: + type: THISLIB.ServicesWestControllerConfig + comment: "The address of the pumps room temperature controller" + oilHeatExchangerTemperature: + type: THISLIB.ServicesWestControllerConfig + comment: "The address of the oil heat exchanger temperature controller" + temperatureUpdate: + type: THISLIB.ServicesWestTemperatureUpdateConfig + comment: "The config for the temperature setpoint" @@ -203,6 +267,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "Services", editableConfig : { type: THISLIB.ServicesConfig , comment: "Editable configuration of the Services subsystem", expand: false } references: operatorStatus : { type: COMMONLIB.OperatorStatus , comment: "Shared operator status" } + domeApertureStatus : { type: COMMONLIB.ApertureStatus , comment: "Is the dome open or closed?", expand: false } variables_read_only: config : { type: THISLIB.ServicesConfig , comment: "Active configuration of the Services subsystem" } parts: @@ -220,6 +285,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "Services", arguments: config : {} attributes: + airTemperature : {} statuses: attributes: healthStatus : { type: COMMONLIB.HealthStatus } @@ -227,7 +293,9 @@ MTCS_MAKE_STATEMACHINE THISLIB, "Services", comment : "West service" arguments: operatorStatus : {} - config : {} + config : {} + airTemperature : {} + domeApertureStatus : {} attributes: statuses: attributes: @@ -285,6 +353,8 @@ MTCS_MAKE_STATEMACHINE THISLIB, "Services", west: operatorStatus : -> self.operatorStatus config : -> self.config.west + airTemperature : -> self.parts.meteo.airTemperature + domeApertureStatus : -> self.domeApertureStatus ######################################################################################################################## @@ -609,14 +679,45 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesMeteo", self.referenceVoltage ) + + + ######################################################################################################################## # ServicesWestController ######################################################################################################################## -#MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWestController", -# references: -# config: { type: THISLIB.ServicesWestControllerConfig, comment: "A small config only for a single WEST controller" } -# variables: -# isPolling : {} +MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWestController", + variables: + isEnabled : { type: t_bool, comment: "Are the processes enabled?" } + unit : { type: COMMONLIB.Units } + variables_read_only: + invalidData : { type: t_bool , comment: "True if there is invalid data"} + processValue : { type: COMMONLIB.QuantityValue, comment: "The process value" } + outputPower : { type: COMMONLIB.QuantityValue, comment: "The output power" } + setpoint : { type: COMMONLIB.QuantityValue, comment: "The setpoint" } + references: + config : { type: THISLIB.ServicesWestControllerConfig, comment: "A small config only for a single WEST controller" } + processes: + update : { type: COMMONLIB.Process, comment: "Read the process value"} + writeSetpoint : { type: COMMONLIB.ChangeSetpointProcess, comment: "Write the setpoint"} + statuses: + healthStatus : { type: COMMONLIB.HealthStatus , comment: "Is the data valid and within range?" } + alarmStatus : { type: COMMONLIB.HiHiLoLoAlarmStatus , comment: "Alarm status"} + calls: + alarmStatus: + superState : -> self.config.measurement.enabled + config : -> self.config.measurement.alarms + value : -> self.processValue.value + healthStatus: + superState : -> self.config.measurement.enabled + isGood : -> NOT( OR(self.invalidData, + self.statuses.alarmStatus.hiHi, + self.statuses.alarmStatus.loLo)) + hasWarning : -> OR( self.statuses.alarmStatus.hi, + self.statuses.alarmStatus.lo ) + update: + isEnabled: -> self.isEnabled + writeSetpoint: + isEnabled: -> self.isEnabled @@ -629,17 +730,18 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWest", variables: {} references: - operatorStatus : { type: COMMONLIB.OperatorStatus , comment: "Shared operator status" } - config : { type: THISLIB.ServicesWestConfig , comment: "The config" } + operatorStatus : { type: COMMONLIB.OperatorStatus , comment: "Shared operator status" } + config : { type: THISLIB.ServicesWestConfig , comment: "The config" } + airTemperature : { type: THISLIB.ServicesMeteoMeasurement , comment: "Air temperature" } statuses: healthStatus : { type: COMMONLIB.HealthStatus , comment: "Are the WESTs in healthy state (good) or not (bad)" } operatingStatus : { type: COMMONLIB.OperatingStatus , comment: "Are the WESTs being polled (auto) or not (manual)?" } parts: - bus : { type: COMMONLIB.ModbusRTUBus , comment: "The shared Modbus RTU bus" } - # domeTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the dome to control the temperature " } - # firstFloorTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the first floor to control the temperature" } - # pumpsRoomTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the pumps room to control the temperature" } - # oilHeatExchangerTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the heat exchanger to control the oil temperature" } + bus : { type: COMMONLIB.ModbusRTUBus , comment: "The shared Modbus RTU bus" } + domeTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the dome to control the temperature " } + firstFloorTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the first floor to control the temperature" } + pumpsRoomTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the pumps room to control the temperature" } + oilHeatExchangerTemperature : { type: THISLIB.ServicesWestController , comment: "The West controller at the heat exchanger to control the oil temperature" } processes: changeOperatingState : { type: COMMONLIB.ChangeOperatingStateProcess , comment: "Change the operating state (e.g. AUTO, MANUAL, ...)" } calls: @@ -648,16 +750,32 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWest", changeOperatingState: isEnabled : -> self.operatorStatus.tech healthStatus: - isGood : -> TRUE # MTCS_SUMMARIZE_GOOD(self.parts.domeTemperature, - # self.parts.firstFloorTemperature, - # self.parts.pumpsRoomTemperature, - # self.parts.oilHeatExchangerTemperature) - hasWarning : -> FALSE # MTCS_SUMMARIZE_WARN(self.parts.domeTemperature, - # self.parts.firstFloorTemperature, - # self.parts.pumpsRoomTemperature, - # self.parts.oilHeatExchangerTemperature) + isGood : -> MTCS_SUMMARIZE_GOOD(self.parts.domeTemperature, + self.parts.firstFloorTemperature, + self.parts.pumpsRoomTemperature, + self.parts.oilHeatExchangerTemperature) + hasWarning : -> MTCS_SUMMARIZE_WARN(self.parts.domeTemperature, + self.parts.firstFloorTemperature, + self.parts.pumpsRoomTemperature, + self.parts.oilHeatExchangerTemperature) bus: isEnabled : -> AND(self.operatorStatus.tech, self.statuses.operatingStatus.manual) + domeTemperature: + isEnabled : -> self.bus.isEnabled + unit : -> COMMONLIB.Units.DEGREES_CELSIUS + config : -> self.config.domeTemperature + firstFloorTemperature: + isEnabled : -> self.bus.isEnabled + unit : -> COMMONLIB.Units.DEGREES_CELSIUS + config : -> self.config.firstFloorTemperature + pumpsRoomTemperature: + isEnabled : -> self.bus.isEnabled + unit : -> COMMONLIB.Units.DEGREES_CELSIUS + config : -> self.config.pumpsRoomTemperature + oilHeatExchangerTemperature: + isEnabled : -> self.bus.isEnabled + unit : -> COMMONLIB.Units.DEGREES_CELSIUS + config : -> self.config.oilHeatExchangerTemperature ######################################################################################################################## diff --git a/coffee/models/mtcs/software.coffee b/coffee/models/mtcs/software.coffee index f4263ab..1f19df6 100644 --- a/coffee/models/mtcs/software.coffee +++ b/coffee/models/mtcs/software.coffee @@ -317,6 +317,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", expand: false arguments: operatorStatus : { type: COMMONLIB.OperatorStatus, expand: false } + domeApertureStatus : { type: COMMONLIB.ApertureStatus, expand: false } attributes: statuses: attributes: @@ -383,6 +384,13 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", aziPos : { type: COMMONLIB.AngularPosition, expand: false } attributes: isTracking : { type: t_bool } + parts: + attributes: + shutter: + attributes: + statuses: + attributes: + apertureStatus: { type: COMMONLIB.ApertureStatus, expand: false} statuses: attributes: poweredStatus : { type: COMMONLIB.PoweredStatus } @@ -456,6 +464,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", operatorStatus : -> self.statuses.operatorStatus services: operatorStatus : -> self.statuses.operatorStatus + domeApertureStatus : -> self.parts.dome.parts.shutter.statuses.apertureStatus telemetry: operatorStatus : -> self.statuses.operatorStatus m1: From 5cc2aead844d96c5634b398585fe7e58f091918e Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Thu, 9 Feb 2017 22:24:42 +0100 Subject: [PATCH 2/9] updated for wests --- coffee/models/mtcs/services/software.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/coffee/models/mtcs/services/software.coffee b/coffee/models/mtcs/services/software.coffee index 8f3f781..52ac8fa 100644 --- a/coffee/models/mtcs/services/software.coffee +++ b/coffee/models/mtcs/services/software.coffee @@ -761,19 +761,19 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWest", bus: isEnabled : -> AND(self.operatorStatus.tech, self.statuses.operatingStatus.manual) domeTemperature: - isEnabled : -> self.bus.isEnabled + isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.domeTemperature firstFloorTemperature: - isEnabled : -> self.bus.isEnabled + isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.firstFloorTemperature pumpsRoomTemperature: - isEnabled : -> self.bus.isEnabled + isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.pumpsRoomTemperature oilHeatExchangerTemperature: - isEnabled : -> self.bus.isEnabled + isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.oilHeatExchangerTemperature From 01025ec8b134c2054a4ec9276f93f14e3f2a2860 Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 00:41:53 +0100 Subject: [PATCH 3/9] trying to find bug --- coffee/models/mtcs/software.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coffee/models/mtcs/software.coffee b/coffee/models/mtcs/software.coffee index 1f19df6..2df6722 100644 --- a/coffee/models/mtcs/software.coffee +++ b/coffee/models/mtcs/software.coffee @@ -390,7 +390,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", attributes: statuses: attributes: - apertureStatus: { type: COMMONLIB.ApertureStatus, expand: false} + apertureStatus: { type: COMMONLIB.ApertureStatus } statuses: attributes: poweredStatus : { type: COMMONLIB.PoweredStatus } @@ -403,7 +403,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", comment : "The config manager (to load/save/activate configuration data)" type : COMMONLIB.ConfigManager statuses: - initializationStatus : { type: COMMONLIB.InitializationStatus } + initializationStatus : { type: ABORT(self.parts.dome) }#COMMONLIB.InitializationStatus } healthStatus : { type: COMMONLIB.HealthStatus } busyStatus : { type: COMMONLIB.BusyStatus } operatorStatus : { type: COMMONLIB.OperatorStatus } From 75b5066fb2391b9250965cf392a9d244e4dc6360 Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 00:50:20 +0100 Subject: [PATCH 4/9] trying to find bug --- coffee/models/mtcs/software.coffee | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/coffee/models/mtcs/software.coffee b/coffee/models/mtcs/software.coffee index 2df6722..e9a5560 100644 --- a/coffee/models/mtcs/software.coffee +++ b/coffee/models/mtcs/software.coffee @@ -20,7 +20,6 @@ REQUIRE "models/mtcs/dome/software.coffee" MODEL "http://www.mercator.iac.es/onto/models/mtcs/software" : "mtcs_soft" mtcs_soft.IMPORT common_soft -mtcs_soft.IMPORT cover_elec mtcs_soft.IMPORT cover_soft mtcs_soft.IMPORT m1_soft mtcs_soft.IMPORT m2_soft @@ -535,19 +534,14 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", # TODO: currently only proof-of-concept, must be expanded!!! -mtcs_soft.ADD MTCS_MAKE_INTERFACE(THISLIB.MTCS, "interface") +#mtcs_soft.ADD MTCS_MAKE_INTERFACE(THISLIB.MTCS, "interface") -#MTCS_SOFT_ELEC_INTERFACE THISLIB.MTCS, "interface", -# [ -# [ mtcs_soft.interface.parts.cover.parts.top.parts.p1.encoderErrorSignal, cover_elec.TC.slot3.soft_interface.p1 ] -# ] - -for i in [1..4] - mtcs_soft.interface.parts.cover.parts.top.parts["p#{i}"].encoderErrorSignal.ADD sys.isInterfacedWith cover_elec.TC.io.slot3.soft_interface["input#{i}"] - mtcs_soft.interface.parts.cover.parts.bottom.parts["p#{i}"].encoderErrorSignal.ADD sys.isInterfacedWith cover_elec.TC.io.slot3.soft_interface["input#{4+i}"] +#for i in [1..4] +# mtcs_soft.interface.parts.cover.parts.top.parts["p#{i}"].encoderErrorSignal.ADD sys.isInterfacedWith cover_elec.TC.io.slot3.soft_interface["input#{i}"] +# mtcs_soft.interface.parts.cover.parts.bottom.parts["p#{i}"].encoderErrorSignal.ADD sys.isInterfacedWith cover_elec.TC.io.slot3.soft_interface["input#{4+i}"] #for i in [1..13] # mtcs_soft.interface.parts.cover.parts.io.parts["slot#{i}"].wcState.ADD sys.isInterfacedWith cover_elec.TC.io["slot#{i}"].soft_interface.WcState From 3071b298ef743943601281b45d8e746f347db72a Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 00:58:03 +0100 Subject: [PATCH 5/9] trying to fix bug --- coffee/models/mtcs/software.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coffee/models/mtcs/software.coffee b/coffee/models/mtcs/software.coffee index e9a5560..812c2e6 100644 --- a/coffee/models/mtcs/software.coffee +++ b/coffee/models/mtcs/software.coffee @@ -402,7 +402,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", comment : "The config manager (to load/save/activate configuration data)" type : COMMONLIB.ConfigManager statuses: - initializationStatus : { type: ABORT(self.parts.dome) }#COMMONLIB.InitializationStatus } + initializationStatus : { type: COMMONLIB.InitializationStatus } healthStatus : { type: COMMONLIB.HealthStatus } busyStatus : { type: COMMONLIB.BusyStatus } operatorStatus : { type: COMMONLIB.OperatorStatus } @@ -528,6 +528,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "MTCS", superState : -> self.statuses.operatorStatus.observer disabled_calls: ['axes'] + ######################################################################################################################## ## INTERFACE ######################################################################################################################## From 83a7715be65303494b93f1ec2375e484071c58fe Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 01:08:11 +0100 Subject: [PATCH 6/9] forgot argument --- coffee/models/mtcs/services/software.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/coffee/models/mtcs/services/software.coffee b/coffee/models/mtcs/services/software.coffee index 52ac8fa..9e94ec5 100644 --- a/coffee/models/mtcs/services/software.coffee +++ b/coffee/models/mtcs/services/software.coffee @@ -733,6 +733,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWest", operatorStatus : { type: COMMONLIB.OperatorStatus , comment: "Shared operator status" } config : { type: THISLIB.ServicesWestConfig , comment: "The config" } airTemperature : { type: THISLIB.ServicesMeteoMeasurement , comment: "Air temperature" } + domeApertureStatus : { type: COMMONLIB.ApertureStatus , comment: "Is the dome open or closed?", expand: false } statuses: healthStatus : { type: COMMONLIB.HealthStatus , comment: "Are the WESTs in healthy state (good) or not (bad)" } operatingStatus : { type: COMMONLIB.OperatingStatus , comment: "Are the WESTs being polled (auto) or not (manual)?" } From c9478bbfc44d9d6b2e0a156251af97589b05992e Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 02:56:38 +0100 Subject: [PATCH 7/9] forgot argument --- coffee/models/mtcs/dome/software.coffee | 3 +++ coffee/models/mtcs/services/software.coffee | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/coffee/models/mtcs/dome/software.coffee b/coffee/models/mtcs/dome/software.coffee index c4cc3c2..cdc71f6 100644 --- a/coffee/models/mtcs/dome/software.coffee +++ b/coffee/models/mtcs/dome/software.coffee @@ -269,12 +269,15 @@ MTCS_MAKE_STATEMACHINE THISLIB, "DomeShutter", isEnabled : -> self.operatorStatus.tech # statuses lowerApertureStatus: + superState : -> NOT(OR(self.wirelessTimeout,self.wirelessError)) isOpen : -> self.lowerOpenSignal isClosed : -> self.lowerClosedSignal upperApertureStatus: + superState : -> NOT(OR(self.wirelessTimeout,self.wirelessError)) isOpen : -> self.upperOpenSignal isClosed : -> self.upperClosedSignal apertureStatus: + superState : -> NOT(OR(self.wirelessTimeout,self.wirelessError)) isOpen : -> AND(self.statuses.lowerApertureStatus.open , self.statuses.upperApertureStatus.open ) isClosed : -> AND(self.statuses.lowerApertureStatus.closed , self.statuses.upperApertureStatus.closed ) healthStatus: diff --git a/coffee/models/mtcs/services/software.coffee b/coffee/models/mtcs/services/software.coffee index 9e94ec5..81e80d4 100644 --- a/coffee/models/mtcs/services/software.coffee +++ b/coffee/models/mtcs/services/software.coffee @@ -696,6 +696,7 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWestController", setpoint : { type: COMMONLIB.QuantityValue, comment: "The setpoint" } references: config : { type: THISLIB.ServicesWestControllerConfig, comment: "A small config only for a single WEST controller" } + bus : { type: COMMONLIB.ModbusRTUBus , comment: "The shared Modbus RTU bus" } processes: update : { type: COMMONLIB.Process, comment: "Read the process value"} writeSetpoint : { type: COMMONLIB.ChangeSetpointProcess, comment: "Write the setpoint"} @@ -765,18 +766,22 @@ MTCS_MAKE_STATEMACHINE THISLIB, "ServicesWest", isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.domeTemperature + bus : -> self.parts.bus firstFloorTemperature: isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.firstFloorTemperature + bus : -> self.parts.bus pumpsRoomTemperature: isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.pumpsRoomTemperature + bus : -> self.parts.bus oilHeatExchangerTemperature: isEnabled : -> self.parts.bus.isEnabled unit : -> COMMONLIB.Units.DEGREES_CELSIUS config : -> self.config.oilHeatExchangerTemperature + bus : -> self.parts.bus ######################################################################################################################## From 58f4080bc395ba5a0be607af7b5b6a9af60f926d Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 16:06:00 +0100 Subject: [PATCH 8/9] improved models --- coffee/models/mtcs/common/software.coffee | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/coffee/models/mtcs/common/software.coffee b/coffee/models/mtcs/common/software.coffee index 62dd215..d2b0454 100644 --- a/coffee/models/mtcs/common/software.coffee +++ b/coffee/models/mtcs/common/software.coffee @@ -1984,7 +1984,7 @@ MTCS_MAKE_CONFIG THISLIB, "InstrumentConfig", MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusReadCoilProcess", extends: THISLIB.BaseProcess arguments: - unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} + unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} address : { type: t_uint16 , comment: "Modbus data address"} variables: value : { type: t_bool, comment: "Value of the coil" } @@ -1996,11 +1996,11 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusReadCoilProcess", MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusWriteCoilProcess", extends: THISLIB.BaseProcess arguments: - unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} + unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} address : { type: t_uint16 , comment: "Modbus data address"} - value : { type: t_bool, comment: "Value to write on the coil" } + value : { type: t_bool , comment: "Value to write on the coil" } variables: - errorId : { type: t_int16, comment: "Error Id. Modbus error code" } + errorId : { type: t_int16 , comment: "Error Id. Modbus error code" } ######################################################################################################################## # ModbusRTUBusReadRegisterProcess @@ -2008,7 +2008,7 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusWriteCoilProcess", MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusReadRegisterProcess", extends: THISLIB.BaseProcess arguments: - unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} + unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} address : { type: t_uint16 , comment: "Modbus data address"} variables: value : { type: t_int16, comment: "Value of the register" } @@ -2020,9 +2020,9 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusReadRegisterProcess", MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusWriteRegisterProcess", extends: THISLIB.BaseProcess arguments: - unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} + unitID : { type: t_uint8 , comment: "Modbus station address (1..247)"} address : { type: t_uint16 , comment: "Modbus data address"} - value : { type: t_int16, comment: "Value to write on the register" } + value : { type: t_int16 , comment: "Value to write on the register" } variables: errorId : { type: t_int16, comment: "Error Id. Modbus error code" } @@ -2032,6 +2032,8 @@ MTCS_MAKE_PROCESS THISLIB, "ModbusRTUBusWriteRegisterProcess", MTCS_MAKE_STATEMACHINE THISLIB, "ModbusRTUBus", variables_hidden: isEnabled : { type: t_bool , comment: "Is control enabled?" } + variables: + retries : { type: t_int16 , initial: int(3), comment: "Number of retries for a succesfull process" } processes: readCoil : { type: THISLIB.ModbusRTUBusReadCoilProcess, comment: "Read coil" } writeCoil : { type: THISLIB.ModbusRTUBusWriteCoilProcess, comment: "Write coil" } From 994be407d6976c669c340ebdb09bb26c77f10e8a Mon Sep 17 00:00:00 2001 From: Wim Pessemier Date: Fri, 10 Feb 2017 21:30:05 +0100 Subject: [PATCH 9/9] West finished for now --- coffee/models/mtcs/services/software.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coffee/models/mtcs/services/software.coffee b/coffee/models/mtcs/services/software.coffee index 81e80d4..dd2208c 100644 --- a/coffee/models/mtcs/services/software.coffee +++ b/coffee/models/mtcs/services/software.coffee @@ -211,6 +211,12 @@ MTCS_MAKE_CONFIG THISLIB, "ServicesWestControllerConfig", update: type: t_bool comment: "True to automatically update the setpoint" + updateMinimumSetpoint: + type: t_double + comment: "Minimum setpoint when the PLC updates the value" + warningMessage: + type: t_string + comment: "A warning message (empty = not shown)" ######################################################################################################################## # ServicesWestConfig