diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.rtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.rtc deleted file mode 100644 index bbe2318..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.rtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.rtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.rtc deleted file mode 100644 index b663858..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.rtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.rtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.rtc deleted file mode 100644 index a1e07b4..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.rtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.rtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.rtc deleted file mode 100644 index 831630c..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.rtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Header.rtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/Header.rtc deleted file mode 100644 index f491808..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/Header.rtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/IDS00103 b/Multi-Pond/Controller/Controller/Micro820/Micro820/IDS00103 deleted file mode 100644 index 2cc0e71..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/IDS00103 and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Constants.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Constants.xtc deleted file mode 100644 index 715187a..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Constants.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.mtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.mtc deleted file mode 100644 index 872bd8f..0000000 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.mtc +++ /dev/null @@ -1,11 +0,0 @@ -[MEMORY] -Offset0=0xFB0 -Offset1=0x17B0 -Offset2=0x17B0 -Offset3=0x17B0 -Memory Usage Estimate(Code)=0x2ECC -Memory Usage Estimate(Data)=0x38F4 -Memory Usage Estimate(Retain)=0x182 -Memory Usage Estimate(RetainBlocks)=0x3 -Memory Usage Estimate(Temporary variables)=0x140 -Offset4=0x414 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.s.mtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.s.mtc deleted file mode 100644 index 872bd8f..0000000 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.s.mtc +++ /dev/null @@ -1,11 +0,0 @@ -[MEMORY] -Offset0=0xFB0 -Offset1=0x17B0 -Offset2=0x17B0 -Offset3=0x17B0 -Memory Usage Estimate(Code)=0x2ECC -Memory Usage Estimate(Data)=0x38F4 -Memory Usage Estimate(Retain)=0x182 -Memory Usage Estimate(RetainBlocks)=0x3 -Memory Usage Estimate(Temporary variables)=0x140 -Offset4=0x414 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfLinkReport.s.mtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfLinkReport.s.mtc deleted file mode 100644 index 705b30d..0000000 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfLinkReport.s.mtc +++ /dev/null @@ -1,16 +0,0 @@ -[MODIF] - -[RESULT] -ON_LINE=N -TBL_CONF=Y -CRC_ORG=0x0 -CRC_OLD= -CRC_NEW=0x790E125A -DAT_ORG=0 -DAT_OLD=0 -DAT_NEW=1528905825 -VER_ORG=0 -VER_OLD=0 -VER_NEW=26 -CRC_ALL_OLD= -CRC_ALL_NEW=0x5F8CD14F diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.xtc deleted file mode 100644 index 56c4c9d..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.xtc deleted file mode 100644 index dc7bf3b..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.xtc deleted file mode 100644 index ee7651a..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.xtc deleted file mode 100644 index a7d8ce0..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.xtc deleted file mode 100644 index ae17e1a..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.xtc deleted file mode 100644 index a5c754a..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.s.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.s.xtc deleted file mode 100644 index 04e0bd1..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.s.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.xtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.xtc deleted file mode 100644 index 04e0bd1..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.xtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.otc b/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.otc deleted file mode 100644 index e537ebd..0000000 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.otc +++ /dev/null @@ -1,18 +0,0 @@ -16 - -0, 1 -70, 7 -140, 13 -210, 19 -280, 25 -288, 26 -296, 27 -304, 28 -312, 30 -326, 31 -388, 38 -402, 39 -464, 46 -478, 47 -540, 54 -554, 55 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.rtc b/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.rtc deleted file mode 100644 index 60183f5..0000000 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.rtc and /dev/null differ diff --git a/Multi-Pond/Controller/Controller_Backup.zip b/Multi-Pond/Controller/Controller_Backup.zip deleted file mode 100644 index e18dbf4..0000000 Binary files a/Multi-Pond/Controller/Controller_Backup.zip and /dev/null differ diff --git a/Multi-Pond/Multi-Pond.v12.ccwsuo b/Multi-Pond/Multi-Pond.v12.ccwsuo deleted file mode 100644 index 46033f2..0000000 Binary files a/Multi-Pond/Multi-Pond.v12.ccwsuo and /dev/null differ diff --git a/Multi-Pond/Controller/Controller.acfproj b/PLC/Multi-Pond/Controller/Controller.acfproj similarity index 100% rename from Multi-Pond/Controller/Controller.acfproj rename to PLC/Multi-Pond/Controller/Controller.acfproj diff --git a/Multi-Pond/Controller/Controller/Breakpoints.lst b/PLC/Multi-Pond/Controller/Controller/Breakpoints.lst similarity index 100% rename from Multi-Pond/Controller/Controller/Breakpoints.lst rename to PLC/Multi-Pond/Controller/Controller/Breakpoints.lst diff --git a/Multi-Pond/Controller/Controller/CONTROLLER.err b/PLC/Multi-Pond/Controller/Controller/CONTROLLER.err similarity index 100% rename from Multi-Pond/Controller/Controller/CONTROLLER.err rename to PLC/Multi-Pond/Controller/Controller/CONTROLLER.err diff --git a/Multi-Pond/Controller/Controller/Compile.ic b/PLC/Multi-Pond/Controller/Controller/Compile.ic similarity index 100% rename from Multi-Pond/Controller/Controller/Compile.ic rename to PLC/Multi-Pond/Controller/Controller/Compile.ic diff --git a/Multi-Pond/Controller/Controller/Conf.mtc b/PLC/Multi-Pond/Controller/Controller/Conf.mtc similarity index 100% rename from Multi-Pond/Controller/Controller/Conf.mtc rename to PLC/Multi-Pond/Controller/Controller/Conf.mtc diff --git a/Multi-Pond/Controller/Controller/DevicePref.xml b/PLC/Multi-Pond/Controller/Controller/DevicePref.xml similarity index 100% rename from Multi-Pond/Controller/Controller/DevicePref.xml rename to PLC/Multi-Pond/Controller/Controller/DevicePref.xml diff --git a/Multi-Pond/Controller/Controller/DlgCfg.xml b/PLC/Multi-Pond/Controller/Controller/DlgCfg.xml similarity index 100% rename from Multi-Pond/Controller/Controller/DlgCfg.xml rename to PLC/Multi-Pond/Controller/Controller/DlgCfg.xml diff --git a/Multi-Pond/Controller/Controller/ISaVIEW/Default/Default.HAD b/PLC/Multi-Pond/Controller/Controller/ISaVIEW/Default/Default.HAD similarity index 100% rename from Multi-Pond/Controller/Controller/ISaVIEW/Default/Default.HAD rename to PLC/Multi-Pond/Controller/Controller/ISaVIEW/Default/Default.HAD diff --git a/Multi-Pond/Controller/Controller/LogicalValues.csv b/PLC/Multi-Pond/Controller/Controller/LogicalValues.csv similarity index 97% rename from Multi-Pond/Controller/Controller/LogicalValues.csv rename to PLC/Multi-Pond/Controller/Controller/LogicalValues.csv index d3072c8..37ec3dd 100644 --- a/Multi-Pond/Controller/Controller/LogicalValues.csv +++ b/PLC/Multi-Pond/Controller/Controller/LogicalValues.csv @@ -163,6 +163,7 @@ Controller.Micro820.Micro820.pond4Scaling.euMin, Controller.Micro820.Micro820.pond4Scaling.rawMax, Controller.Micro820.Micro820.pond4Scaling.rawMin, Controller.Micro820.Micro820.pond4Volume, +Controller.Micro820.Micro820.pondVolumeTotal, Controller.Micro820.Micro820.Scaling.GetPond1ScalingParams.calIndex, Controller.Micro820.Micro820.Scaling.GetPond1ScalingParams.highHeightScalingParam, Controller.Micro820.Micro820.Scaling.GetPond1ScalingParams.highVolumeScalingParam, @@ -199,3 +200,4 @@ Controller.Micro820.Micro820.Scaling.GetPond4ScalingParams.lowHeightScalingParam Controller.Micro820.Micro820.Scaling.GetPond4ScalingParams.lowVolumeScalingParam, Controller.Micro820.Micro820.Scaling.GetPond4ScalingParams.maxCalIndex, Controller.Micro820.Micro820.Scaling.GetPond4ScalingParams.success, +Controller.Micro820.Micro820.watchdog_INT, diff --git a/Multi-Pond/Controller/Controller/MbSrvConf_target.xml b/PLC/Multi-Pond/Controller/Controller/MbSrvConf_target.xml similarity index 100% rename from Multi-Pond/Controller/Controller/MbSrvConf_target.xml rename to PLC/Multi-Pond/Controller/Controller/MbSrvConf_target.xml diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.dop b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.dop similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.dop rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.dop diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.ic similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.ic diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.otc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.otc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.otc diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.rtc new file mode 100644 index 0000000..b3287ee Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ADDCALIBRATIONPOINT.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.stf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/AddCalibrationPoint.stf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Binding.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Binding.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Binding.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Binding.rtc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.dop b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.dop similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.dop rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.dop diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.ic similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.ic diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.otc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.otc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.otc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CALIBRATION.rtc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.stf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Calibration.stf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/CnvFct.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CnvFct.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/CnvFct.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/CnvFct.rtc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ics b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ics similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ics rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ics diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_ADDCALIBRATIONPOINT.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_ADDCALIBRATIONPOINT.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_ADDCALIBRATIONPOINT.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_ADDCALIBRATIONPOINT.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_CALIBRATION.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_CALIBRATION.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_CALIBRATION.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_CALIBRATION.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_DELETECALIBRATIONPOINT.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_DELETECALIBRATIONPOINT.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_DELETECALIBRATIONPOINT.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_DELETECALIBRATIONPOINT.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_FINDNUMBEROFCALPOINTS.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_FINDNUMBEROFCALPOINTS.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_FINDNUMBEROFCALPOINTS.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_FINDNUMBEROFCALPOINTS.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_GETSCALINGPARAMETERS.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_GETSCALINGPARAMETERS.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_GETSCALINGPARAMETERS.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_GETSCALINGPARAMETERS.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_LINEARSCALE.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_LINEARSCALE.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_LINEARSCALE.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_LINEARSCALE.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_SCALING.ict b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_SCALING.ict similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_SCALING.ict rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Compile_SCALING.ict diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.ic similarity index 95% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.ic index 823a592..706fd2f 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.ic +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.ic @@ -1,8 +1,8 @@ _STEP 2 0 4 -__TMPB1 := __INT_NULL > LINPPONDNUMBER +__TMPB1 := __CINT00000001 > LINPPONDNUMBER __TMPB2 := LINPPONDNUMBER > __CINT00000004 __TMPB1 := __TMPB1 _OR __TMPB2 -__TMPB3 := __DINT_NULL > LINPPOINTINDEX +__TMPB3 := __CDINT00000001 > LINPPOINTINDEX __TMPB1 := __TMPB1 _OR __TMPB3 __TMPB4 := LINPPOINTINDEX > __CDINT0000000A __TMPB1 := __TMPB1 _OR __TMPB4 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.otc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.otc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.otc diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.rtc new file mode 100644 index 0000000..ce46ed2 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DELETECALIBRATIONPOINT.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DefProg.cnf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DefProg.cnf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/DefProg.cnf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DefProg.cnf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.stf similarity index 93% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.stf index 8de6567..c4774c9 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.stf +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DeleteCalibrationPoint.stf @@ -2,7 +2,7 @@ FUNCTION DeleteCalibrationPoint (* Make sure pond number is between 1 and 4 *) (* and point index is between 1 and 10 *) -IF 0 > linpPondNumber OR linpPondNumber > 4 OR 0 > linpPointIndex OR linpPointIndex > 10 THEN +IF 1 > linpPondNumber OR linpPondNumber > 4 OR 1 > linpPointIndex OR linpPointIndex > 10 THEN DeleteCalibrationPoint := FALSE; END_IF; diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/DwlOrder.txt b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DwlOrder.txt similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/DwlOrder.txt rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/DwlOrder.txt diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/FBS_INPUTS_ASSIGNATION.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FBS_INPUTS_ASSIGNATION.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/FBS_INPUTS_ASSIGNATION.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FBS_INPUTS_ASSIGNATION.ipa diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.ic similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.ic diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.otc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.otc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.otc diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.rtc new file mode 100644 index 0000000..a6190a6 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FINDNUMBEROFCALPOINTS.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.stf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/FindNumberOfCalPoints.stf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.dop b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.dop similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.dop rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.dop diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.ic similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.ic diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.otc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.otc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.otc diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.rtc new file mode 100644 index 0000000..2df9a9e Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GETSCALINGPARAMETERS.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.stf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GetScalingParameters.stf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/GlobalVariable.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GlobalVariable.rtc similarity index 71% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/GlobalVariable.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GlobalVariable.rtc index 651c022..70064de 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/GlobalVariable.rtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/GlobalVariable.rtc differ diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Header.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Header.rtc new file mode 100644 index 0000000..9caa7f3 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Header.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Hierarchy.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Hierarchy.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Hierarchy.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Hierarchy.rtc diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/IDS00103 b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/IDS00103 new file mode 100644 index 0000000..128ba71 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/IDS00103 differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/IO.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/IO.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/IO.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/IO.rtc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.ic similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.ic diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.otc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.otc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.otc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.rtc similarity index 59% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.rtc index af9716b..a31c3a4 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.rtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LINEARSCALE.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.stf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/LinearScale.stf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.ain b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.ain similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.ain rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.ain diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.err b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.err similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.err rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.err diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.icp b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.icp similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.icp rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820.icp diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Conf.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Conf.xtc similarity index 70% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Conf.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Conf.xtc index 01671fd..4aed484 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Conf.xtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Conf.xtc differ diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Constants.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Constants.xtc new file mode 100644 index 0000000..036968d Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Constants.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Dwl.txt b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Dwl.txt similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Dwl.txt rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Dwl.txt diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_DwlOrder.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_DwlOrder.xtc similarity index 78% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_DwlOrder.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_DwlOrder.xtc index 2254f1d..805b357 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_DwlOrder.xtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_DwlOrder.xtc differ diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.mtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.mtc new file mode 100644 index 0000000..e64f46c --- /dev/null +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.mtc @@ -0,0 +1,11 @@ +[MEMORY] +Offset0=0xFB4 +Offset1=0x17B4 +Offset2=0x17B4 +Offset3=0x17B4 +Memory Usage Estimate(Code)=0x2F9C +Memory Usage Estimate(Data)=0x38F8 +Memory Usage Estimate(Retain)=0x182 +Memory Usage Estimate(RetainBlocks)=0x3 +Memory Usage Estimate(Temporary variables)=0x144 +Offset4=0x414 diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.s.mtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.s.mtc new file mode 100644 index 0000000..e64f46c --- /dev/null +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_LinkInfo.s.mtc @@ -0,0 +1,11 @@ +[MEMORY] +Offset0=0xFB4 +Offset1=0x17B4 +Offset2=0x17B4 +Offset3=0x17B4 +Memory Usage Estimate(Code)=0x2F9C +Memory Usage Estimate(Data)=0x38F8 +Memory Usage Estimate(Retain)=0x182 +Memory Usage Estimate(RetainBlocks)=0x3 +Memory Usage Estimate(Temporary variables)=0x144 +Offset4=0x414 diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfLinkReport.s.mtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfLinkReport.s.mtc new file mode 100644 index 0000000..6b6f471 --- /dev/null +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfLinkReport.s.mtc @@ -0,0 +1,28 @@ +[MODIF] +POU=Y +TYPE=Y +LEVEL1=Y +IO=Y +RETAIN=Y +INSTDEF=Y +VARDEF=Y +INIT_INST=Y +ADD_DEL=Y +VARSIZE=Y +IO_DEF=Y +LAST_VA=Y + +[RESULT] +ON_LINE=Y +TBL_CONF=Y +CRC_ORG=0xA4C0B63E +CRC_OLD=0xA4C0B63E +CRC_NEW=0xA4C0B63E +DAT_ORG=1529434199 +DAT_OLD=1529434199 +DAT_NEW=1529434367 +VER_ORG=31 +VER_OLD=31 +VER_NEW=32 +CRC_ALL_OLD=0xC26A6063 +CRC_ALL_NEW=0x20E3D9BB diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfUpdate.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfUpdate.xtc new file mode 100644 index 0000000..0277d56 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MdfUpdate.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.mtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.mtc similarity index 58% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.mtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.mtc index f96a7f9..956042b 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.mtc +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.mtc @@ -1,9 +1,9 @@ [MEMORY] -Memory Usage Estimate(Temporary variables)=0x140 +Memory Usage Estimate(Temporary variables)=0x144 Biggest online change user variable memory block size=0x800 Currently added user variables=0x0 -Total data size=0x10F0 -User variables size=0xFB0 +Total data size=0x10F8 +User variables size=0xFB4 Maximum size for temporary variables=0x2140 -Memory Usage Estimate(Data)=0x38F0 +Memory Usage Estimate(Data)=0x38F4 Free memory for user variables=0x800 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.s.mtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.s.mtc similarity index 58% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.s.mtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.s.mtc index f96a7f9..956042b 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.s.mtc +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_MiscLinkInfo.s.mtc @@ -1,9 +1,9 @@ [MEMORY] -Memory Usage Estimate(Temporary variables)=0x140 +Memory Usage Estimate(Temporary variables)=0x144 Biggest online change user variable memory block size=0x800 Currently added user variables=0x0 -Total data size=0x10F0 -User variables size=0xFB0 +Total data size=0x10F8 +User variables size=0xFB4 Maximum size for temporary variables=0x2140 -Memory Usage Estimate(Data)=0x38F0 +Memory Usage Estimate(Data)=0x38F4 Free memory for user variables=0x800 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.ipa diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.xtc new file mode 100644 index 0000000..41a6814 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_ADDCALIBRATIONPOINT.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.ipa diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.xtc similarity index 53% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.xtc index 1ecd307..43dab0f 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.xtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_CALIBRATION.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.ipa diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.xtc new file mode 100644 index 0000000..1878942 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_DELETECALIBRATIONPOINT.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.ipa diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.xtc new file mode 100644 index 0000000..70bb082 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_FINDNUMBEROFCALPOINTS.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.ipa diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.xtc new file mode 100644 index 0000000..1060e7c Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_GETSCALINGPARAMETERS.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.ipa diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.xtc new file mode 100644 index 0000000..471ee4d Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_LINEARSCALE.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.ipa b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.ipa similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.ipa rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.ipa diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.xtc new file mode 100644 index 0000000..7c1b838 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_Pou_SCALING.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsComplement.ttc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsComplement.ttc similarity index 95% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsComplement.ttc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsComplement.ttc index 93a761e..8a56a48 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsComplement.ttc +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsComplement.ttc @@ -1,10 +1,10 @@ [BEGIN FB INPUTS] I1=micro820.micro820.scaling/getpond1scalingparams.linppondheight,0x48C,REAL -I2=micro820.micro820.scaling/getpond1scalingparams.linppondnumber,0x17F6,INT +I2=micro820.micro820.scaling/getpond1scalingparams.linppondnumber,0x17FA,INT I3=micro820.micro820.scaling/getpond2scalingparams.linppondheight,0x490,REAL -I4=micro820.micro820.scaling/getpond2scalingparams.linppondnumber,0x17F4,INT +I4=micro820.micro820.scaling/getpond2scalingparams.linppondnumber,0x17F8,INT I5=micro820.micro820.scaling/getpond3scalingparams.linppondheight,0x494,REAL -I6=micro820.micro820.scaling/getpond3scalingparams.linppondnumber,0x17F2,INT +I6=micro820.micro820.scaling/getpond3scalingparams.linppondnumber,0x17F6,INT I7=micro820.micro820.scaling/getpond4scalingparams.linppondheight,0x498,REAL -I8=micro820.micro820.scaling/getpond4scalingparams.linppondnumber,0x17F8,INT +I8=micro820.micro820.scaling/getpond4scalingparams.linppondnumber,0x17FC,INT [END] diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.d.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.d.xtc similarity index 53% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.d.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.d.xtc index d0cbb18..11487c8 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.d.xtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.d.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.s.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.s.xtc similarity index 53% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.s.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.s.xtc index d0cbb18..11487c8 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.s.xtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.s.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.xtc similarity index 53% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.xtc index d0cbb18..11487c8 100644 Binary files a/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.xtc and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsDebug.xtc differ diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.s.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.s.xtc new file mode 100644 index 0000000..85462e8 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.s.xtc differ diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.xtc new file mode 100644 index 0000000..85462e8 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MICRO820_SymbolsTarget.xtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.s.txt b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.s.txt similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.s.txt rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.s.txt diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.txt b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.txt similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.txt rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/MdfConf.txt diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Micro820_MiscLinkInfoOlc.mtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Micro820_MiscLinkInfoOlc.mtc new file mode 100644 index 0000000..c2ce647 --- /dev/null +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Micro820_MiscLinkInfoOlc.mtc @@ -0,0 +1,3 @@ +[MEMORY] +Code Space Free Memory=0x2B584 +Code Space Requirement=0x1988 diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/ResPar.cnf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ResPar.cnf similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/ResPar.cnf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/ResPar.cnf diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.dop b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.dop similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.dop rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.dop diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.ic b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.ic similarity index 72% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.ic rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.ic index 6b1e716..d98e4e3 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.ic +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.ic @@ -134,3 +134,60 @@ POND4VOLUME := __TMPR5 _GOTO __LAB8 __LAB7 : __LAB8 : +_STEP 2 0 62 +__TMPB1 := CFGNUMBEROFPONDS = __CINT00000001 +_IF _NOT __TMPB1 _GOTO __LAB9 +_STEP 2 0 63 +PONDVOLUMETOTAL := POND1VOLUME +_STEP 2 0 64 +POND2HEIGHT := __TMPR7 +_STEP 2 0 65 +POND2VOLUME := __TMPR7 +_STEP 2 0 66 +POND3HEIGHT := __TMPR7 +_STEP 2 0 67 +POND3VOLUME := __TMPR7 +_STEP 2 0 68 +POND4HEIGHT := __TMPR7 +_STEP 2 0 69 +POND4VOLUME := __TMPR7 +_GOTO __LABa +__LAB9 : +_STEP 2 0 70 +__TMPB1 := CFGNUMBEROFPONDS = __CINT00000002 +_IF _NOT __TMPB1 _GOTO __LABb +_STEP 2 0 71 +__TMPR1 := POND1VOLUME + POND2VOLUME +PONDVOLUMETOTAL := __TMPR1 +_STEP 2 0 72 +POND3HEIGHT := __TMPR7 +_STEP 2 0 73 +POND3VOLUME := __TMPR7 +_STEP 2 0 74 +POND4HEIGHT := __TMPR7 +_STEP 2 0 75 +POND4VOLUME := __TMPR7 +_GOTO __LABa +__LABb : +__TMPB1 := CFGNUMBEROFPONDS = __CINT00000003 +_IF _NOT __TMPB1 _GOTO __LABc +_STEP 2 0 77 +__TMPR1 := POND1VOLUME + POND2VOLUME +__TMPR1 := __TMPR1 + POND3VOLUME +PONDVOLUMETOTAL := __TMPR1 +_STEP 2 0 78 +POND4HEIGHT := __TMPR7 +_STEP 2 0 79 +POND4VOLUME := __TMPR7 +_GOTO __LABa +__LABc : +__TMPB1 := CFGNUMBEROFPONDS = __CINT00000004 +_IF _NOT __TMPB1 _GOTO __LABd +_STEP 2 0 81 +__TMPR1 := POND1VOLUME + POND2VOLUME +__TMPR1 := __TMPR1 + POND3VOLUME +__TMPR1 := __TMPR1 + POND4VOLUME +PONDVOLUMETOTAL := __TMPR1 +_GOTO __LABa +__LABd : +__LABa : diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.otc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.otc new file mode 100644 index 0000000..0d45458 --- /dev/null +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.otc @@ -0,0 +1,36 @@ +34 + +0, 1 +70, 7 +140, 13 +210, 19 +280, 25 +288, 26 +296, 27 +304, 28 +312, 30 +326, 31 +388, 38 +402, 39 +464, 46 +478, 47 +540, 54 +554, 55 +616, 62 +630, 63 +636, 64 +642, 65 +648, 66 +654, 67 +660, 68 +666, 69 +680, 70 +694, 71 +702, 72 +708, 73 +714, 74 +720, 75 +748, 77 +764, 78 +770, 79 +798, 81 diff --git a/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.rtc new file mode 100644 index 0000000..9266b3d Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/SCALING.rtc differ diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.AcfMlge b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.AcfMlge similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.AcfMlge rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.AcfMlge diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.stf b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.stf similarity index 73% rename from Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.stf rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.stf index e777cb3..efe2e8e 100644 --- a/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.stf +++ b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820/Scaling.stf @@ -59,6 +59,29 @@ IF GetPond4ScalingParams.success THEN GetPond4ScalingParams.highVolumeScalingParam, pond4Height); END_IF; + +IF cfgNumberOfPonds = 1 THEN + pondVolumeTotal := pond1Volume; + pond2Height := 0.0; + pond2Volume := 0.0; + pond3Height := 0.0; + pond3Volume := 0.0; + pond4Height := 0.0; + pond4Volume := 0.0; +ELSIF cfgNumberOfPonds = 2 THEN + pondVolumeTotal := pond1Volume + pond2Volume; + pond3Height := 0.0; + pond3Volume := 0.0; + pond4Height := 0.0; + pond4Volume := 0.0; +ELSIF cfgNumberOfPonds = 3 THEN + pondVolumeTotal := pond1Volume + pond2Volume + pond3Volume; + pond4Height := 0.0; + pond4Volume := 0.0; +ELSIF cfgNumberOfPonds = 4 THEN + pondVolumeTotal := pond1Volume + pond2Volume + pond3Volume + pond4Volume; +END_IF; + diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.rtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.rtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.rtc diff --git a/Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.xtc b/PLC/Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.xtc similarity index 100% rename from Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.xtc rename to PLC/Multi-Pond/Controller/Controller/Micro820/Micro820_NetworkConf.xtc diff --git a/Multi-Pond/Controller/Controller/NetworkConf.rtc b/PLC/Multi-Pond/Controller/Controller/NetworkConf.rtc similarity index 100% rename from Multi-Pond/Controller/Controller/NetworkConf.rtc rename to PLC/Multi-Pond/Controller/Controller/NetworkConf.rtc diff --git a/Multi-Pond/Controller/Controller/NetworkConf.xtc b/PLC/Multi-Pond/Controller/Controller/NetworkConf.xtc similarity index 100% rename from Multi-Pond/Controller/Controller/NetworkConf.xtc rename to PLC/Multi-Pond/Controller/Controller/NetworkConf.xtc diff --git a/Multi-Pond/Controller/Controller/PrjLibrary.mdb b/PLC/Multi-Pond/Controller/Controller/PrjLibrary.mdb similarity index 99% rename from Multi-Pond/Controller/Controller/PrjLibrary.mdb rename to PLC/Multi-Pond/Controller/Controller/PrjLibrary.mdb index b6a99c2..1a8ff14 100644 Binary files a/Multi-Pond/Controller/Controller/PrjLibrary.mdb and b/PLC/Multi-Pond/Controller/Controller/PrjLibrary.mdb differ diff --git a/Multi-Pond/Controller/Controller/RMD.info b/PLC/Multi-Pond/Controller/Controller/RMD.info similarity index 100% rename from Multi-Pond/Controller/Controller/RMD.info rename to PLC/Multi-Pond/Controller/Controller/RMD.info diff --git a/Multi-Pond/Controller/Controller/RcpCfg.xml b/PLC/Multi-Pond/Controller/Controller/RcpCfg.xml similarity index 100% rename from Multi-Pond/Controller/Controller/RcpCfg.xml rename to PLC/Multi-Pond/Controller/Controller/RcpCfg.xml diff --git a/Multi-Pond/Controller/Controller/SymbolTable/HabDts.ini.local b/PLC/Multi-Pond/Controller/Controller/SymbolTable/HabDts.ini.local similarity index 100% rename from Multi-Pond/Controller/Controller/SymbolTable/HabDts.ini.local rename to PLC/Multi-Pond/Controller/Controller/SymbolTable/HabDts.ini.local diff --git a/Multi-Pond/Controller/Controller/persist.ccwx b/PLC/Multi-Pond/Controller/Controller/persist.ccwx similarity index 93% rename from Multi-Pond/Controller/Controller/persist.ccwx rename to PLC/Multi-Pond/Controller/Controller/persist.ccwx index c8965cd..8fcbba2 100644 Binary files a/Multi-Pond/Controller/Controller/persist.ccwx and b/PLC/Multi-Pond/Controller/Controller/persist.ccwx differ diff --git a/Multi-Pond/Controller/Controller/project.gpm b/PLC/Multi-Pond/Controller/Controller/project.gpm similarity index 100% rename from Multi-Pond/Controller/Controller/project.gpm rename to PLC/Multi-Pond/Controller/Controller/project.gpm diff --git a/PLC/Multi-Pond/Controller/Controller_Backup.zip b/PLC/Multi-Pond/Controller/Controller_Backup.zip new file mode 100644 index 0000000..5ecedb1 Binary files /dev/null and b/PLC/Multi-Pond/Controller/Controller_Backup.zip differ diff --git a/Multi-Pond/Controller/Embedded/ExtendedInfo.xml b/PLC/Multi-Pond/Controller/Embedded/ExtendedInfo.xml similarity index 100% rename from Multi-Pond/Controller/Embedded/ExtendedInfo.xml rename to PLC/Multi-Pond/Controller/Embedded/ExtendedInfo.xml diff --git a/Multi-Pond/Controller/LogicalValues/ExtendedInfo.xml b/PLC/Multi-Pond/Controller/LogicalValues/ExtendedInfo.xml similarity index 100% rename from Multi-Pond/Controller/LogicalValues/ExtendedInfo.xml rename to PLC/Multi-Pond/Controller/LogicalValues/ExtendedInfo.xml diff --git a/Multi-Pond/Controller/MLGE/ExtendedInfo.xml b/PLC/Multi-Pond/Controller/MLGE/ExtendedInfo.xml similarity index 100% rename from Multi-Pond/Controller/MLGE/ExtendedInfo.xml rename to PLC/Multi-Pond/Controller/MLGE/ExtendedInfo.xml diff --git a/Multi-Pond/Multi-Pond.ccwsln b/PLC/Multi-Pond/Multi-Pond.ccwsln similarity index 100% rename from Multi-Pond/Multi-Pond.ccwsln rename to PLC/Multi-Pond/Multi-Pond.ccwsln diff --git a/PLC/Multi-Pond/Multi-Pond.v12.ccwsuo b/PLC/Multi-Pond/Multi-Pond.v12.ccwsuo new file mode 100644 index 0000000..ec40414 Binary files /dev/null and b/PLC/Multi-Pond/Multi-Pond.v12.ccwsuo differ diff --git a/PLC/Multi-Pond/UserAccess.CCW.tmp b/PLC/Multi-Pond/UserAccess.CCW.tmp new file mode 100644 index 0000000..e69de29 diff --git a/plcpond/html-templates/Alarm Setpoints.html b/plcpond/html-templates/Alarm Setpoints.html new file mode 100644 index 0000000..7bb97f9 --- /dev/null +++ b/plcpond/html-templates/Alarm Setpoints.html @@ -0,0 +1,240 @@ +
+
+

Pond 1

+
+ +
+ +
+
+
+ +
+ +
+
+ +
+

Pond 2

+
+ +
+ +
+
+
+ +
+ +
+
+ +
+

Pond 3

+
+ +
+ +
+
+
+ +
+ +
+
+ +
+

Pond 4

+
+ +
+
+
+
+ +
+ +
+
+
+ + diff --git a/plcpond/html-templates/Alerts.html b/plcpond/html-templates/Alerts.html new file mode 100644 index 0000000..2971cab --- /dev/null +++ b/plcpond/html-templates/Alerts.html @@ -0,0 +1 @@ +Alerts diff --git a/plcpond/html-templates/Calibration.html b/plcpond/html-templates/Calibration.html new file mode 100644 index 0000000..ab0bbc0 --- /dev/null +++ b/plcpond/html-templates/Calibration.html @@ -0,0 +1,180 @@ +
+
+
+ +
+
+
+ +
+
+

Pond 1 Calibration

+ + + + + + + + + +
Level (Ft.)Volume
+
+ +
+

Pond 2 Calibration

+ + + + + + + + + +
Level (Ft.)Volume
+
+
+ +
+
+

Pond 3 Calibration

+ + + + + + + + + +
Level (Ft.)Volume
+
+ +
+

Pond 4 Calibration

+ + + + + + + + + +
Level (Ft.)Volume
+
+
+ + +
+
+

Add a new Calibration Point

+
+
+ + +
+
+ + +
+ +
+ + +
+ + " + data-techname="<%=channels["plcpond.addcalibrationpoint"].techName %>" + data-name="<%= channels["plcpond.addcalibrationpoint"].name%>" + data-nodechannelcurrentId="<%= channels["plcpond.addcalibrationpoint"].nodechannelcurrentId %>" + id="<%= channels["plcpond.addcalibrationpoint"].channelId %>" + class="btn btn-large btn-theme animated setstatic material-icons">send +
+
+
+ + diff --git a/plcpond/html-templates/Device.html b/plcpond/html-templates/Device.html new file mode 100644 index 0000000..8857008 --- /dev/null +++ b/plcpond/html-templates/Device.html @@ -0,0 +1,42 @@ +
+
+

Public IP Address

+

<%= channels["plcpond.public_ip_address"].value %>

+

+
+ + diff --git a/plcpond/html-templates/NodeDetailHeader.html b/plcpond/html-templates/NodeDetailHeader.html new file mode 100644 index 0000000..28262a3 --- /dev/null +++ b/plcpond/html-templates/NodeDetailHeader.html @@ -0,0 +1,6 @@ +
+
+
+
+

<%= node.vanityname %>

+
diff --git a/plcpond/html-templates/Nodelist.html b/plcpond/html-templates/Nodelist.html new file mode 100644 index 0000000..756a869 --- /dev/null +++ b/plcpond/html-templates/Nodelist.html @@ -0,0 +1,31 @@ + + +
+
+
+
+ +
+ +
+ +
+

<%= node.vanityname %>

+
+
diff --git a/plcpond/html-templates/Overview.html b/plcpond/html-templates/Overview.html new file mode 100644 index 0000000..3718668 --- /dev/null +++ b/plcpond/html-templates/Overview.html @@ -0,0 +1,265 @@ +
+
+
+

Level

+
+
+
+
+ <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 2) { %> +
+ <% }%> + + <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 3) { %> +
+ <% }%> + + <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 4) { %> +
+ <% }%> +
+
+ + +
+
+
+

Volume

+
+
+
+
+ <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 2) { %> +
+ <% }%> + + <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 3) { %> +
+ <% }%> + + <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 4) { %> +
+ <% }%> + + <% if (parseInt(channels['plcpond.cfgnumberofponds'].value) >= 2) { %> +
+ <% }%> +
+
+ + + + + diff --git a/plcpond/html-templates/Rules-Message Template.txt b/plcpond/html-templates/Rules-Message Template.txt new file mode 100644 index 0000000..b909743 --- /dev/null +++ b/plcpond/html-templates/Rules-Message Template.txt @@ -0,0 +1,34 @@ +$problem.Node.vanityname$ $problem.Problemstatus.message$ Alert + + + +Issue Recorded: $problem.Problemstatus.message$ +
+System Name: $problem.Node.vanityname$ +

+ +Pond 1 Level: $plcpond.pond1height$ +
+Pond 1 Volume: $plcpond.pond1volume$ +

+ +Pond 2 Level: $plcpond.pond2height$ +
+Pond 2 Volume: $plcpond.pond2volume$ +

+ + +Pond 3 Level: $plcpond.pond3height$ +
+Pond 3 Volume: $plcpond.pond3volume$ +

+ + +Pond 4 Level: $plcpond.pond4height$ +
+Pond 4 Volume: $plcpond.pond4volume$ +

+ + + +$problem.Node.vanityname$ $problem.Problemstatus.message$ ($plcpond.pond4height$ @ $plcpond.pond4height.timestamp$) diff --git a/plcpond/html-templates/Sidebar.html b/plcpond/html-templates/Sidebar.html new file mode 100644 index 0000000..8d3fe0b --- /dev/null +++ b/plcpond/html-templates/Sidebar.html @@ -0,0 +1,15 @@ +" + class="data-table btn-block btn btn-theme animated" + title="Device Log"> Device Log + +" + data-techname="<%=channels["plcpond.sync"].techName %>" + data-name="<%= channels["plcpond.sync"].name%>" + data-nodechannelcurrentId="<%= channels["plcpond.sync"].nodechannelcurrentId %>" + id="<%= channels["plcpond.sync"].channelId %>" + class="btn btn-large btn-block btn-theme animated setstatic mqtt"> + Sync All Data diff --git a/plcpond/html-templates/Trends.html b/plcpond/html-templates/Trends.html new file mode 100644 index 0000000..43c6e02 --- /dev/null +++ b/plcpond/html-templates/Trends.html @@ -0,0 +1,37 @@ +
+
+ + to + + + Run + +
+
+
+
+
+ diff --git a/plcpond/python-driver/Channel.py b/plcpond/python-driver/Channel.py new file mode 100644 index 0000000..c554ab6 --- /dev/null +++ b/plcpond/python-driver/Channel.py @@ -0,0 +1,296 @@ +"""Define Meshify channel class.""" +import time +from pycomm.ab_comm.clx import Driver as ClxDriver +from pycomm.cip.cip_base import CommError, DataError + +TAG_DATAERROR_SLEEPTIME = 5 + + +def binarray(intval): + """Split an integer into its bits.""" + bin_string = '{0:08b}'.format(intval) + bin_arr = [i for i in bin_string] + bin_arr.reverse() + return bin_arr + + +def read_tag(addr, tag, plc_type="CLX"): + """Read a tag from the PLC.""" + direct = plc_type == "Micro800" + addr = str(addr) + tag = str(tag) + c = ClxDriver() + try: + if c.open(addr, direct_connection=direct): + try: + v = c.read_tag(tag) + return v + except DataError as e: + c.close() + time.sleep(TAG_DATAERROR_SLEEPTIME) + print("Data Error during readTag({}, {}, plc_type='{}'): {}".format(addr, tag, plc_type, e)) + else: + raise DataError("no data") + + except CommError: + # err = c.get_status() + c.close() + print("Could not connect during readTag({}, {})".format(addr, tag)) + # print err + except AttributeError as e: + c.close() + print("AttributeError during readTag({}, {}): \n{}".format(addr, tag, e)) + c.close() + + +def read_array(addr, tag, start, end, plc_type="CLX"): + """Read an array from the PLC.""" + direct = plc_type == "Micro800" + c = ClxDriver() + if c.open(addr, direct_connection=direct): + arr_vals = [] + try: + for i in range(start, end): + tag_w_index = tag + "[{}]".format(i) + v = c.read_tag(tag_w_index) + # print('{} - {}'.format(tag_w_index, v)) + arr_vals.append(round(v[0], 4)) + # print(v) + if arr_vals: + return arr_vals + print("No length for {}".format(addr)) + return False + except Exception: + print("Error during readArray({}, {}, {}, {})".format(addr, tag, start, end)) + err = c.get_status() + c.close() + print(err) + return False + c.close() + return False + + +def write_tag(addr, tag, val, plc_type="CLX"): + """Write a tag value to the PLC.""" + direct = plc_type == "Micro800" + clx = ClxDriver() + if clx.open(addr, direct_connection=direct): + try: + prevval = clx.read_tag(tag) + if direct: + time.sleep(1) + write_result = clx.write_tag(tag, val, prevval[1]) + return write_result + except Exception: + print("Error during writeTag({}, {}, {})".format(addr, tag, val)) + err = clx.get_status() + clx.close() + print(err) + return False + clx.close() + return False + +class Channel(object): + """Holds the configuration for a Meshify channel.""" + + def __init__(self, mesh_name, data_type, chg_threshold, guarantee_sec, map_=False, write_enabled=False): + """Initialize the channel.""" + self.mesh_name = mesh_name + self.data_type = data_type + self.last_value = None + self.value = None + self.last_send_time = 0 + self.chg_threshold = chg_threshold + self.guarantee_sec = guarantee_sec + self.map_ = map_ + self.write_enabled = write_enabled + + def __str__(self): + """Create a string for the channel.""" + return "{}\nvalue: {}, last_send_time: {}".format(self.mesh_name, self.value, self.last_send_time) + + def check(self, new_value, force_send=False): + """Check to see if the new_value needs to be stored.""" + send_needed = False + send_reason = "" + if self.data_type == 'BOOL' or self.data_type == 'STRING': + if self.last_send_time == 0: + send_needed = True + send_reason = "no send time" + elif self.value is None: + send_needed = True + send_reason = "no value" + elif not (self.value == new_value): + if self.map_: + if not self.value == self.map_[new_value]: + send_needed = True + send_reason = "value change" + else: + send_needed = True + send_reason = "value change" + elif (time.time() - self.last_send_time) > self.guarantee_sec: + send_needed = True + send_reason = "guarantee sec" + elif force_send: + send_needed = True + send_reason = "forced" + else: + if self.last_send_time == 0: + send_needed = True + send_reason = "no send time" + elif self.value is None: + send_needed = True + send_reason = "no value" + elif abs(self.value - new_value) > self.chg_threshold: + send_needed = True + send_reason = "change threshold" + elif (time.time() - self.last_send_time) > self.guarantee_sec: + send_needed = True + send_reason = "guarantee sec" + elif force_send: + send_needed = True + send_reason = "forced" + if send_needed: + self.last_value = self.value + if self.map_: + try: + self.value = self.map_[new_value] + except KeyError: + print("Cannot find a map value for {} in {} for {}".format(new_value, self.map_, self.mesh_name)) + self.value = new_value + else: + self.value = new_value + self.last_send_time = time.time() + print("Sending {} for {} - {}".format(self.value, self.mesh_name, send_reason)) + return send_needed + + def read(self): + """Read the value.""" + pass + + +def identity(sent): + """Return exactly what was sent to it.""" + return sent + + +class ModbusChannel(Channel): + """Modbus channel object.""" + + def __init__(self, mesh_name, register_number, data_type, chg_threshold, guarantee_sec, channel_size=1, map_=False, write_enabled=False, transformFn=identity): + """Initialize the channel.""" + super(ModbusChannel, self).__init__(mesh_name, data_type, chg_threshold, guarantee_sec, map_, write_enabled) + self.mesh_name = mesh_name + self.register_number = register_number + self.channel_size = channel_size + self.data_type = data_type + self.last_value = None + self.value = None + self.last_send_time = 0 + self.chg_threshold = chg_threshold + self.guarantee_sec = guarantee_sec + self.map_ = map_ + self.write_enabled = write_enabled + self.transformFn = transformFn + + def read(self, mbsvalue): + """Return the transformed read value.""" + return self.transformFn(mbsvalue) + + +class PLCChannel(Channel): + """PLC Channel Object.""" + + def __init__(self, ip, mesh_name, plc_tag, data_type, chg_threshold, guarantee_sec, map_=False, write_enabled=False, plc_type='CLX'): + """Initialize the channel.""" + super(PLCChannel, self).__init__(mesh_name, data_type, chg_threshold, guarantee_sec, map_, write_enabled) + self.plc_ip = ip + self.mesh_name = mesh_name + self.plc_tag = plc_tag + self.data_type = data_type + self.last_value = None + self.value = None + self.last_send_time = 0 + self.chg_threshold = chg_threshold + self.guarantee_sec = guarantee_sec + self.map_ = map_ + self.write_enabled = write_enabled + self.plc_type = plc_type + + def read(self): + """Read the value.""" + plc_value = None + if self.plc_tag and self.plc_ip: + read_value = read_tag(self.plc_ip, self.plc_tag, plc_type=self.plc_type) + if read_value: + plc_value = read_value[0] + + return plc_value + + +class BoolArrayChannels(Channel): + """Hold the configuration for a set of boolean array channels.""" + + def __init__(self, ip, mesh_name, plc_tag, data_type, chg_threshold, guarantee_sec, map_=False, write_enabled=False): + """Initialize the channel.""" + self.plc_ip = ip + self.mesh_name = mesh_name + self.plc_tag = plc_tag + self.data_type = data_type + self.last_value = None + self.value = None + self.last_send_time = 0 + self.chg_threshold = chg_threshold + self.guarantee_sec = guarantee_sec + self.map_ = map_ + self.write_enabled = write_enabled + + def compare_values(self, new_val_dict): + """Compare new values to old values to see if the values need storing.""" + send = False + for idx in new_val_dict: + try: + if new_val_dict[idx] != self.last_value[idx]: + send = True + except KeyError: + print("Key Error in self.compare_values for index {}".format(idx)) + send = True + return send + + def read(self, force_send=False): + """Read the value and check to see if needs to be stored.""" + send_needed = False + send_reason = "" + if self.plc_tag: + v = read_tag(self.plc_ip, self.plc_tag) + if v: + bool_arr = binarray(v[0]) + new_val = {} + for idx in self.map_: + try: + new_val[self.map_[idx]] = bool_arr[idx] + except KeyError: + print("Not able to get value for index {}".format(idx)) + + if self.last_send_time == 0: + send_needed = True + send_reason = "no send time" + elif self.value is None: + send_needed = True + send_reason = "no value" + elif self.compare_values(new_val): + send_needed = True + send_reason = "value change" + elif (time.time() - self.last_send_time) > self.guarantee_sec: + send_needed = True + send_reason = "guarantee sec" + elif force_send: + send_needed = True + send_reason = "forced" + + if send_needed: + self.value = new_val + self.last_value = self.value + self.last_send_time = time.time() + print("Sending {} for {} - {}".format(self.value, self.mesh_name, send_reason)) + return send_needed diff --git a/plcpond/python-driver/Channel.pyc b/plcpond/python-driver/Channel.pyc new file mode 100644 index 0000000..c41f58d Binary files /dev/null and b/plcpond/python-driver/Channel.pyc differ diff --git a/plcpond/python-driver/channels_plcpond.csv b/plcpond/python-driver/channels_plcpond.csv new file mode 100644 index 0000000..f325980 --- /dev/null +++ b/plcpond/python-driver/channels_plcpond.csv @@ -0,0 +1,28 @@ +id,name,deviceTypeId,fromMe,io,subTitle,helpExplanation,channelType,dataType,defaultValue,regex,regexErrMsg,units,min,max,change,guaranteedReportPeriod,minReportTime +13723,log,463,FALSE,readwrite,Log,Device Log,device,string,Created,,,,,,,, +,pond1height,463,FALSE,readonly,Pond 1 Height,in Ft,device,float,-99,,,,,,,, +,pond1volume,463,FALSE,readonly,Pond 1 Volume,in BBL,device,float,-99,,,,,,,, +,pond2height,463,FALSE,readonly,Pond 2 Height,in Ft,device,float,-99,,,,,,,, +,pond2volume,463,FALSE,readonly,Pond 2 Volume,in BBL,device,float,-99,,,,,,,, +,pond3height,463,FALSE,readonly,Pond 3 Height,in Ft,device,float,-99,,,,,,,, +,pond3volume,463,FALSE,readonly,Pond 3 Volume,in BBL,device,float,-99,,,,,,,, +,pond4height,463,FALSE,readonly,Pond 4 Height,in Ft,device,float,-99,,,,,,,, +,pond4volume,463,FALSE,readonly,Pond 4 Volume,in BBL,device,float,-99,,,,,,,, +,cfgnumberofponds,463,FALSE,readwrite,Number of Ponds Configured,4-Jan,device,integer,0,,,,,,,, +,public_ip_address,463,FALSE,readonly,Public IP Address,network device address,device,string,,,,,,,,, +,pondvolumetotal,463,FALSE,readonly,Total Pond Volume,in BBL,device,float,-99,,,,,,,, +,pond1calibration,463,FALSE,readonly,Pond 1 Calibration Table,JSON list of objects with height and volume props,device,string,[],,,,,,,, +,pond2calibration,463,FALSE,readonly,Pond 2 Calibration Table,JSON list of objects with height and volume props,device,string,[],,,,,,,, +,pond3calibration,463,FALSE,readonly,Pond 3 Calibration Table,JSON list of objects with height and volume props,device,string,[],,,,,,,, +,pond4calibration,463,FALSE,readonly,Pond 4 Calibration Table,JSON list of objects with height and volume props,device,string,[],,,,,,,, +,addcalibrationpoint,463,FALSE,readwrite,Add Calibration Point Command,JSON Object with pond and height and volume props,device,string,,,,,,,,, +,deletecalibrationpoint,463,FALSE,readwrite,Delete Calibration Point Command,JSON Object with pond and point properties,device,string,,,,,,,,, +,sync,463,FALSE,readwrite,Sync data,Synchronize command,device,string,,,,,,,,, +,pond1highalarmsetpoint,463,FALSE,readwrite,Pond 1 High Alarm Setpoint,in Ft,user input,float,50,,,,,,,, +,pond1lowalarmsetpoint,463,FALSE,readwrite,Pond 1 Low Alarm Setpoint,in Ft,user input,float,0,,,,,,,, +,pond2highalarmsetpoint,463,FALSE,readwrite,Pond 2 High Alarm Setpoint,in Ft,user input,float,50,,,,,,,, +,pond2lowalarmsetpoint,463,FALSE,readwrite,Pond 2 Low Alarm Setpoint,in Ft,user input,float,0,,,,,,,, +,pond3highalarmsetpoint,463,FALSE,readwrite,Pond 3 High Alarm Setpoint,in Ft,user input,float,50,,,,,,,, +,pond3lowalarmsetpoint,463,FALSE,readwrite,Pond 3 Low Alarm Setpoint,in Ft,user input,float,0,,,,,,,, +,pond4highalarmsetpoint,463,FALSE,readwrite,Pond 4 High Alarm Setpoint,in Ft,user input,float,50,,,,,,,, +,pond4lowalarmsetpoint,463,FALSE,readwrite,Pond 4 Low Alarm Setpoint,in Ft,user input,float,0,,,,,,,, \ No newline at end of file diff --git a/plcpond/python-driver/config.txt b/plcpond/python-driver/config.txt new file mode 100644 index 0000000..ff1b344 --- /dev/null +++ b/plcpond/python-driver/config.txt @@ -0,0 +1,11 @@ +{ + "driverFileName": "plcpond.py", + "deviceName": "plcpond", + "driverId": "0220", + "releaseVersion": "1", + "files": { + "file1": "plcpond.py", + "file2": "utilities.py", + "file3": "Channel.py" + } +} \ No newline at end of file diff --git a/plcpond/python-driver/device_base.py b/plcpond/python-driver/device_base.py new file mode 100644 index 0000000..edbd53d --- /dev/null +++ b/plcpond/python-driver/device_base.py @@ -0,0 +1,2 @@ +class deviceBase(object): + pass \ No newline at end of file diff --git a/plcpond/python-driver/driverConfig.json b/plcpond/python-driver/driverConfig.json new file mode 100644 index 0000000..e6569a8 --- /dev/null +++ b/plcpond/python-driver/driverConfig.json @@ -0,0 +1,11 @@ +{ + "name": "plcpond", + "driverFilename": "plcpond.py", + "driverId": "0000", + "additionalDriverFiles": [ + "utilities.py", + "Channel.py" + ], + "version": 1, + "s3BucketName": "plcpond" +} \ No newline at end of file diff --git a/plcpond/python-driver/plcpond.py b/plcpond/python-driver/plcpond.py new file mode 100644 index 0000000..1bb0d6c --- /dev/null +++ b/plcpond/python-driver/plcpond.py @@ -0,0 +1,247 @@ +"""Driver for plcpond""" + +import threading +import sys +import json +import time +import logging +from random import randint +from device_base import deviceBase +from Channel import PLCChannel, read_tag, write_tag, TAG_DATAERROR_SLEEPTIME +from utilities import get_public_ip_address + + +_ = None + +# LOGGING SETUP +from logging.handlers import RotatingFileHandler + +log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(funcName)s(%(lineno)d) %(message)s') +logFile = './plcpond.log' +my_handler = RotatingFileHandler(logFile, mode='a', maxBytes=500*1024, backupCount=2, encoding=None, delay=0) +my_handler.setFormatter(log_formatter) +my_handler.setLevel(logging.INFO) +logger = logging.getLogger('plcpond') +logger.setLevel(logging.INFO) +logger.addHandler(my_handler) + +console_out = logging.StreamHandler(sys.stdout) +console_out.setFormatter(log_formatter) +logger.addHandler(console_out) + +logger.info("plcpond startup") + +# GLOBAL VARIABLES +WATCHDOG_SEND_PERIOD = 3600 # Seconds, the longest amount of time before sending the watchdog status +PLC_IP_ADDRESS = "192.168.1.12" +CHANNELS = [ + PLCChannel(PLC_IP_ADDRESS, "cfgnumberofponds", "cfgNumberOfPonds", "REAL", 0.5, 600, map_=False, write_enabled=False, plc_type='Micro800'), + + PLCChannel(PLC_IP_ADDRESS, "pond1height", "pond1Height", "REAL", 0.5, 600, map_=False, write_enabled=False, plc_type='Micro800'), + PLCChannel(PLC_IP_ADDRESS, "pond2height", "pond2Height", "REAL", 0.5, 600, map_=False, write_enabled=False, plc_type='Micro800'), + PLCChannel(PLC_IP_ADDRESS, "pond3height", "pond3Height", "REAL", 0.5, 600, map_=False, write_enabled=False, plc_type='Micro800'), + PLCChannel(PLC_IP_ADDRESS, "pond4height", "pond4Height", "REAL", 0.5, 600, map_=False, write_enabled=False, plc_type='Micro800'), + + PLCChannel(PLC_IP_ADDRESS, "pond1volume", "pond1Volume", "REAL", 500.0, 600, map_=False, write_enabled=False, plc_type='Micro800'), + PLCChannel(PLC_IP_ADDRESS, "pond2volume", "pond2Volume", "REAL", 500.0, 600, map_=False, write_enabled=False, plc_type='Micro800'), + PLCChannel(PLC_IP_ADDRESS, "pond3volume", "pond3Volume", "REAL", 500.0, 600, map_=False, write_enabled=False, plc_type='Micro800'), + PLCChannel(PLC_IP_ADDRESS, "pond4volume", "pond4Volume", "REAL", 500.0, 600, map_=False, write_enabled=False, plc_type='Micro800'), + + PLCChannel(PLC_IP_ADDRESS, "pondvolumetotal", "pondVolumeTotal", "REAL", 500.0, 600, map_=False, write_enabled=False, plc_type='Micro800') +] + +CALIBRATION_TABLES = [[],[], [], [], []] # position 0 is a dummy table + + + + +class start(threading.Thread, deviceBase): + """Start class required by Meshify.""" + + def __init__(self, name=None, number=None, mac=None, Q=None, mcu=None, companyId=None, offset=None, mqtt=None, Nodes=None): + """Initialize the driver.""" + threading.Thread.__init__(self) + deviceBase.__init__(self, name=name, number=number, mac=mac, Q=Q, mcu=mcu, companyId=companyId, offset=offset, mqtt=mqtt, Nodes=Nodes) + + self.daemon = True + self.version = "1" + self.finished = threading.Event() + self.force_send = False + threading.Thread.start(self) + + # this is a required function for all drivers, its goal is to upload some piece of data + # about your device so it can be seen on the web + def register(self): + """Register the driver.""" + # self.sendtodb("log", "BOOM! Booted.", 0) + pass + + def run(self): + """Actually run the driver.""" + wait_sec = 15 + for i in range(0, wait_sec): + print("plcpond driver will start in {} seconds".format(wait_sec - i)) + time.sleep(1) + logger.info("BOOM! Starting plcpond driver...") + + public_ip_address = get_public_ip_address() + self.sendtodbDev(1, 'public_ip_address', public_ip_address, 0, 'plcpond') + watchdog = self.plcpond_watchdog() + self.sendtodbDev(1, 'watchdog', watchdog, 0, 'plcpond') + watchdog_send_timestamp = time.time() + + self.nodes["plcpond_0199"] = self + + send_loops = 0 + watchdog_loops = 0 + watchdog_check_after = 5000 + while True: + if self.force_send: + logger.warning("FORCE SEND: TRUE") + + for c in CHANNELS: + v = c.read() + if v is not None: # read returns None if it fails + if c.check(v, self.force_send): + self.sendtodbDev(1, c.mesh_name, c.value, 0, 'plcpond') + time.sleep(TAG_DATAERROR_SLEEPTIME) # sleep to allow Micro800 to handle ENET requests + + for pond_index in range(1, 5): + self.read_pond_calibration(pond_index) + + # print("plcpond driver still alive...") + if self.force_send: + if send_loops > 2: + logger.warning("Turning off force_send") + self.force_send = False + send_loops = 0 + else: + send_loops += 1 + + watchdog_loops += 1 + if watchdog_loops >= watchdog_check_after: + test_watchdog = self.plcpond_watchdog() + if not test_watchdog == watchdog or (time.time() - watchdog_send_timestamp) > WATCHDOG_SEND_PERIOD: + self.sendtodbDev(1, 'watchdog', test_watchdog, 0, 'plcpond') + watchdog = test_watchdog + + test_public_ip = get_public_ip_address() + if not test_public_ip == public_ip_address: + self.sendtodbDev(1, 'public_ip_address', test_public_ip, 0, 'plcpond') + public_ip_address = test_public_ip + watchdog_loops = 0 + + + def read_pond_calibration(self, pond_number): + """Read all calibration values for a specific pond.""" + last_read_height = -1.0 + cal_values = [] + cal_index = 1 + while last_read_height != 0 and cal_index <=10: + cal_tag_height = "pond{}CalibrationHeight[{}]".format(pond_number, cal_index) + cal_tag_volume = "pond{}CalibrationVolume[{}]".format(pond_number, cal_index) + read_height = read_tag(PLC_IP_ADDRESS, cal_tag_height, plc_type="Micro800") + time.sleep(2) + read_volume = read_tag(PLC_IP_ADDRESS, cal_tag_volume, plc_type="Micro800") + time.sleep(2) + if read_height and read_volume: + if read_height[0] > 0.0: + cal_values.append({"height": read_height[0], "volume": read_volume[0]}) + last_read_height = read_height[0] + cal_index += 1 + + if cal_values != CALIBRATION_TABLES[pond_number] or self.force_send: + calibration_channel = "pond{}calibration".format(pond_number) + calibration_string = json.dumps(cal_values).replace('"', "'") + self.sendtodbDev(1, calibration_channel, calibration_string, 0, 'plcpond') + CALIBRATION_TABLES[pond_number] = cal_values + + def plcpond_watchdog(self): + """Write a random integer to the PLC and then 1 seconds later check that it has been decremented by 1.""" + randval = randint(0, 32767) + write_tag(str(PLC_IP_ADDRESS), 'watchdog_INT', randval, plc_type="Micro800") + time.sleep(1) + watchdog_val = read_tag(str(PLC_IP_ADDRESS), 'watchdog_INT', plc_type="Micro800") + try: + return (randval - 1) == watchdog_val[0] + except (KeyError, TypeError): + return False + + def plcpond_sync(self, name, value): + """Sync all data from the driver.""" + self.force_send = True + # self.sendtodb("log", "synced", 0) + return True + + def plcpond_deletecalibrationpoint(self, name, value): + """Delete a calibration point from a calibration table""" + # {"pond": int, "point": int} + value = value.replace("'", '"') + parsed = json.loads(value) + try: + pond_number = int(parsed['pond']) + point_number = int(parsed['point']) + write_pond = write_tag(PLC_IP_ADDRESS, "inpPondNumber", pond_number, plc_type="Micro800") + time.sleep(2) + write_point = write_tag(PLC_IP_ADDRESS, "inpDeletePointIndex", point_number, plc_type="Micro800") + time.sleep(2) + if write_pond and write_point: + write_cmd = write_tag(PLC_IP_ADDRESS, "cmdDeleteCalibrationPoint", 1, plc_type="Micro800") + time.sleep(2) + if write_cmd: + read_val = read_tag(PLC_IP_ADDRESS, "deleteSuccess", plc_type="Micro800") + if read_val[0] == 1: + self.read_pond_calibration(pond_number) + return True + return "Wrote everything successfully, but delete didn't succeed (Check pond and point values)." + return "Didn't write delete command correctly." + return "Didn't write pond or point correctly." + except KeyError as e: + return "Couldn't parse input value: {} -- {}".format(value, e) + + def plcpond_cfgnumberofponds(self, name, value): + """Write the number of ponds to the plc.""" + value = int(value) + return write_tag(PLC_IP_ADDRESS, "cfgNumberOfPonds", value, plc_type="Micro800") + + def plcpond_addcalibrationpoint(self, name, value): + """Add a calibration point to the calibration table""" + # value = {"pond": int, "height": float, "volume": float} + value = value.replace("'", '"') + parsed = json.loads(value) + try: + # parse json values, throw an error if one is missing + pond_number = int(parsed['pond']) + height = float(parsed['height']) + volume = float(parsed['volume']) + # write values to the tags + write_pond = write_tag(PLC_IP_ADDRESS, "inpPondNumber", pond_number, plc_type="Micro800") + time.sleep(2) + write_height = write_tag(PLC_IP_ADDRESS, "inpPondHeight", height, plc_type="Micro800") + time.sleep(2) + write_volume= write_tag(PLC_IP_ADDRESS, "inpPondVolume", volume, plc_type="Micro800") + time.sleep(2) + if write_pond and write_height and write_volume: + write_cmd = write_tag(PLC_IP_ADDRESS, "cmdAddCalibrationPoint", 1, plc_type="Micro800") + time.sleep(2) + if write_cmd: + read_val = read_tag(PLC_IP_ADDRESS, "addSuccess", plc_type="Micro800") + if read_val[0] == 1: + self.read_pond_calibration(pond_number) + return True + return "Wrote everything successfully, but delete didn't succeed (Check pond and point values)." + return "Didn't write delete command correctly." + return "Didn't write pond or point correctly." + except KeyError as e: + return "Couldn't parse input value: {} -- {}".format(value, e) + + def plcpond_writeplctag(self, name, value): + """Write a value to the PLC.""" + new_val = json.loads(str(value).replace("'", '"')) + tag_n = str(new_val['tag']) # "cmd_Start" + val_n = new_val['val'] + w = write_tag(str(PLC_IP_ADDRESS), tag_n, val_n) + print("Result of plcpond_writeplctag(self, {}, {}) = {}".format(name, value, w)) + if w is None: + w = "Error writing to PLC..." + return w diff --git a/plcpond/python-driver/test.py b/plcpond/python-driver/test.py new file mode 100644 index 0000000..935f17a --- /dev/null +++ b/plcpond/python-driver/test.py @@ -0,0 +1,26 @@ +import json +import time +from Channel import read_tag, write_tag + +PLC_IP_ADDRESS = "192.168.1.12" + +def read_pond_calibration(pond_number): + """Read all calibration values for a specific pond.""" + last_read_height = -1.0 + cal_values = [] + cal_index = 1 + while last_read_height != 0 and cal_index <=10: + cal_tag_height = "pond{}CalibrationHeight[{}]".format(pond_number, cal_index) + cal_tag_volume = "pond{}CalibrationVolume[{}]".format(pond_number, cal_index) + print(cal_tag_height, cal_tag_volume) + read_height = read_tag(PLC_IP_ADDRESS, cal_tag_height, plc_type="Micro800") + time.sleep(2) + read_volume = read_tag(PLC_IP_ADDRESS, cal_tag_volume, plc_type="Micro800") + time.sleep(2) + print(read_height, read_volume) + if read_height and read_volume: + if read_height[0] > 0.0: + cal_values.append({"height": read_height[0], "volume": read_volume[0]}) + last_read_height = read_height[0] + cal_index += 1 + return cal_values diff --git a/plcpond/python-driver/utilities.py b/plcpond/python-driver/utilities.py new file mode 100644 index 0000000..58c7ab0 --- /dev/null +++ b/plcpond/python-driver/utilities.py @@ -0,0 +1,51 @@ +"""Utility functions for the driver.""" +import socket +import struct + + +def get_public_ip_address(): + """Find the public IP Address of the host device.""" + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(("8.8.8.8", 80)) + ip = s.getsockname()[0] + s.close() + return ip + + +def int_to_float16(int_to_convert): + """Convert integer into float16 representation.""" + bin_rep = ('0' * 16 + '{0:b}'.format(int_to_convert))[-16:] + sign = 1.0 + if int(bin_rep[0]) == 1: + sign = -1.0 + exponent = float(int(bin_rep[1:6], 2)) + fraction = float(int(bin_rep[6:17], 2)) + + if exponent == float(0b00000): + return sign * 2 ** -14 * fraction / (2.0 ** 10.0) + elif exponent == float(0b11111): + if fraction == 0: + return sign * float("inf") + else: + return float("NaN") + else: + frac_part = 1.0 + fraction / (2.0 ** 10.0) + return sign * (2 ** (exponent - 15)) * frac_part + + +def ints_to_float(int1, int2): + """Convert 2 registers into a floating point number.""" + mypack = struct.pack('>HH', int1, int2) + f = struct.unpack('>f', mypack) + print("[{}, {}] >> {}".format(int1, int2, f[0])) + return f[0] + + +def degf_to_degc(temp_f): + """Convert deg F to deg C.""" + return (temp_f - 32.0) * (5.0/9.0) + + +def degc_to_degf(temp_c): + """Convert deg C to deg F.""" + return temp_c * 1.8 + 32.0