From 2d36ca07a6b43cf997aea3a987ed97cd3afcb655 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 27 Oct 2020 12:04:23 +0200 Subject: fix flash writing (parameters. now causes reset!), improve logs saving on errfile.txt, prevent motor alarms after hw configuration --- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 10 +++++++--- .../Embedded/Modules/AlarmHandling/AlarmHandling.h | 2 ++ .../Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 16 ++++++++-------- Software/Embedded_SW/Embedded/Modules/Control/control.c | 2 ++ .../Embedded/Modules/General/GeneralHardware.c | 1 + Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 9 +++++---- .../Embedded/Modules/Stubs_Handler/Progress.c | 4 ++++ .../Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 2 +- 8 files changed, 30 insertions(+), 16 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 42f60a151..6df2c27c6 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -73,6 +73,7 @@ bool AlarmHandlingActive = false; uint32_t AlarmHandlingControlId = 0xFF; uint32_t AlarmHandlingTick = 0; +int MotorConfiguredTimeout = 100; double CurrentAlarmHighLimit ,CurrentAlarmLowLimit; bool CheckHardLimitAlarms = false,CheckCurrentAlarms = false,CheckTamperAlarms = false,CheckMotorAlarms = false; uint8_t alarm_response_buffer[500]; @@ -504,7 +505,7 @@ uint32_t AlarmHandlingLoadFile(void) if (F_count == 4) { - ReportWithPackageFilter(AlarmFilter,"Writing four alarms", __FILE__,AlarmPtr,F_count, RpMessage, p_size, 0); + //ReportWithPackageFilter(AlarmFilter,"Writing four alarms", __FILE__,AlarmPtr,F_count, RpMessage, p_size, 0); F_count = 0; ReadAppAndProgram(AlarmPtr, p_size,FileAlarmItem); AlarmPtr+=p_size; @@ -976,7 +977,7 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) if ((IFS_Availability[1] == IFS_RECOGNIZED_INIT_PASSED)&&(IFS_Availability[2] == IFS_RECOGNIZED_INIT_PASSED)) //ifs installed -check cartridges { - tempFoundReason = Waste_Prepare(); + tempFoundReason = Waste_CheckState(); if (tempFoundReason!=JOB_OK) { FoundReason = tempFoundReason; @@ -1192,6 +1193,9 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (AlarmItem == NULL) return ERROR; int AlarmCounter=0; + if (MotorConfiguredTimeout) + MotorConfiguredTimeout--; + for (Alarm_i = 0;Alarm_i < NumOfSystemAlarms;Alarm_i++) { Status = false; @@ -1368,7 +1372,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) case ALARM_SOURCE_TYPE__MotorAlarm: if (CheckMotorAlarms) { - if ((FPGA_WD_Occurred == true)||(MachineReadyForHeating == false)) + if ((FPGA_WD_Occurred == true)||(MotorConfiguredTimeout > 0)) { Status = false; } diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h index 3b39370bf..0ce6d4816 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h @@ -10,6 +10,8 @@ #include "StateMachines/Printing/PrintingSTM.h" #include +extern int MotorConfiguredTimeout; + uint32_t AlarmHandlingFlashLoad(void); uint32_t AlarmHandlingLoadFile(void); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 8a14a1d67..689219583 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -822,14 +822,6 @@ uint32_t MillisecLowLoop(uint32_t tick) } if (Tensecond_Tick) { - #ifndef RUN_AS_MAIN_JIG - //Trigger_MidTank_Pressure_Read(); - for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) - { - Read_MidTank_Pressure_Sensor(Disp_i); - } - #endif - } if (OneMinute_Tick) { @@ -864,6 +856,14 @@ uint32_t MillisecLowLoop(uint32_t tick) { Shinko_Cycle_Comm(); } +#ifndef RUN_AS_MAIN_JIG + //Trigger_MidTank_Pressure_Read(); + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + Read_MidTank_Pressure_Sensor(Disp_i); + } +#endif + } if (OneHourTick) { diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 14275533e..2047e9910 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -198,6 +198,8 @@ uint32_t ControlActivityLed( uint32_t Parameter1) ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0); ACTIVITY_GREEN_LED_ON; + MotorConfiguredTimeout = 100; + FPGA_SetMotorsInit(); Motor_ReconfigAllMotors(); } diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 2f9088cf1..90c18caa0 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -467,6 +467,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) //if (request->n_winders == 1) // status += InternalWinderConfigMessage(request->winders); + MotorConfiguredTimeout = 100; status += MotorsInit(); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 4fe32e7cd..2c2ebfd07 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -84,7 +84,7 @@ uint32_t InitialDispenserSpeed = INITIAL_DISPENSER_SPEED; uint32_t ControlIdtoInactiveDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; -uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t deviceID); +//uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t deviceID); AutoHoming_Config_enum AutoHoming_Config = AutoHoming_off; void IDS_Dispenser_SetAutoHoming_Config(AutoHoming_Config_enum Config) @@ -350,6 +350,7 @@ uint32_t IDS_StopHomeDispenser (uint32_t DispenserId) CurrentDispenserSpeed[DispenserId] = 0; return OK; } +/* uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId) { assert(DispenserId < MAX_SYSTEM_DISPENSERS); @@ -380,7 +381,7 @@ uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId) } // HomingActive[DispenserId]= false; ReportWithPackageFilter(IDSFilter,"End homing for job start",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0); - /* else + /`* else { ReportWithPackageFilter(IDSFilter,"homing aborted,start backlash",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0); DispenserHomingControlId[DispenserId] = AddControlCallback( IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 ); @@ -389,12 +390,12 @@ uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId) Task_sleep(10); MotorSetSpeed(motorId, 1000); CurrentDispenserSpeed[DispenserId] = 1000; - }*/ + }*`/ //IDS_Dispenser_RefillEnded ( DispenserId, MotorsCfg[motorId].microstep); return OK; } - +*/ uint32_t IDS_CheckDispenserLimitSwitch (LimitSwitchAlarms LS_Id) { int DispenserId; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index fb8e97898..0d5d60af0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -948,7 +948,11 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) if((request->amount == 0x0CD) && (request->delay == 0x0CD)) //Get Gas Sensor { LOG_ERROR(request->delay,"Load embedded parameters from file and restart"); + base_flashErased = false; LoadConfigurationParamsFromFile(true); + LOG_ERROR(255,"Update successful, Rebooting in 5 seconds"); + Task_sleep (eOneSecond*5); + Power_Reset(); response.progress = (double)OK; response.has_progress = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 1de7f1319..8043f76a9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -36,7 +36,7 @@ bool DoorState = OPEN; uint32_t timeout_counter = 0; int wasteLevel = 0; WasteCartridgeEnum SelectedCard = MaxWasteCartridges; -CartridgeStateEnum CartState[MaxWasteCartridges]; +CartridgeStateEnum CartState[MaxWasteCartridges];// = {CartridgeStateOUT,CartridgeStateOUT,CartridgeStateOUT}; uint32_t Cartridge_Cover_Control; button *CartLed[MaxWasteCartridges] = {0, &cart2, &cart3}; WasteTankStateEnum WasteTankState = WasteTankStateIdle; -- cgit v1.3.1 From fba4984f4d08397f7f1b897953d5d8cb068ee2bc Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Tue, 27 Oct 2020 14:38:11 +0200 Subject: cartridge state update --- Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 26 +++++++++++++++------- .../Embedded/Modules/Waste/Waste_maint.c | 14 +++++++++++- 2 files changed, 31 insertions(+), 9 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index d62ad3a43..b8b1915c4 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -28,6 +28,7 @@ #include "drivers/Valves/Valve.h" #include "../control/control.h" #include "Modules/General/buttons.h" +#include "Modules/General/MachineStatus.h" #define CARTRIDGE_EMPTY_QUANTITY_LIMIT 10 #define CARTRIDGE_EMPTY_CALCULATION_TIME 12 @@ -154,6 +155,14 @@ bool CartridgeInkFull() } #endif +int GetCartridgeFillPercent() +{ + double MidTank_Pressure = 0; + + MidTank_Pressure = Read_MidTank_Pressure_Sensor(midTankCartColor); + return (((MidTank_Pressure - midTankCapacity)* 100) / CARTRIDGE_CAPATICY); +} + bool midTankCart_door() { bool door; @@ -276,7 +285,7 @@ void midTankStateMachine(void) break; } //check RFID? (TBD) - //IFS_State = CARTRIDGE_STATE__Inserted; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Inserted, 0); // send request for validation to ppc inkAuthenticationPass = 2; //not defined @@ -298,13 +307,13 @@ void midTankStateMachine(void) Report("MidTank Cartridge authentication wait...", __FILE__, __LINE__, authenticationTimeOutCounter, RpMessage, 0, 0); if (authenticationTimeOutCounter > 60) { midTankState = MidTankStateIdle; - //IFS_State = CARTRIDGE_STATE__Error; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, 0); } break; } if (inkAuthenticationPass == false) { Report("MidTank Cartridge authentication fail", __FILE__, __LINE__, 0, RpMessage, 0, 0); - //IFS_State = CARTRIDGE_STATE__Error; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, 0); midTankState = MidTankStateIdle; break; } @@ -316,13 +325,13 @@ void midTankStateMachine(void) cart1.color = fastBILNK; Report("Mid-tank not empty", __FILE__, __LINE__, midTankCapacity, RpMessage, MidTankEmptyLimit, 0); midTankState = MidTankStateIdle; - //IFS_State = CARTRIDGE_STATE__Exists; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, 0); break; } Report("Mid-tank filling in process", __FILE__,__LINE__,(int)(MidTankEmptyLimit*1000), RpMessage, (int)(midTankCapacity*1000), 0); Pannel_Leds(CART_1, MODE_ON); cart1.color = BLINK; - //IFS_State = CARTRIDGE_STATE__Filling; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Filling, 0); if (midTankCartColor == MIDTANK_8) { @@ -347,7 +356,7 @@ void midTankStateMachine(void) Report("Cartridge extracted during filling!!!", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); Report("Mid-tank # filling fail", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; - //IFS_State = CARTRIDGE_STATE__Absent; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Absent, GetCartridgeFillPercent()); } // if time out or emptying done - idle if (midTankTimeoutCounter++ > CartridgeInkTimeout) { @@ -357,7 +366,7 @@ void midTankStateMachine(void) MidTankValvesAction(Cartridge_MidTank_OFF); Report("Mid-tank # filling fail", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); Report("Call customer support", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); - //IFS_State = CARTRIDGE_STATE__Error; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, GetCartridgeFillPercent()); midTankState = MidTankStateIdle; } else if (CartridgeInkFull()) { midTankTimeoutCounter = 0; @@ -366,8 +375,9 @@ void midTankStateMachine(void) MidTankValvesAction(Cartridge_MidTank_OFF); Report("Mid-tank # filling done", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; - //IFS_State = CARTRIDGE_STATE__FillingCompleted; + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__FillingCompleted, GetCartridgeFillPercent()); } + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Filling, GetCartridgeFillPercent()); break; default: Report("wrong state", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 1de7f1319..d552c444e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -22,6 +22,7 @@ #include "CartridgeValidationResponse.pb-c.h" #include "Modules/General/buttons.h" #include "modules/General/process.h" +#include "Modules/General/MachineStatus.h" #include "Modules/IFS/ifs.h" #include #include @@ -259,6 +260,10 @@ bool RdWasteTankOverFlowSensor() return 0; } +int WHS_GetCartridgeFillPercent() +{ + return (((wasteLevel - wasteLevelEmpty) * 100) / WASTE_CARTRIDGE_SIZE); +} bool WHS_IsContainerFull() { return RdWasteTankFullSensor(); @@ -343,6 +348,7 @@ void Waste_StateMachine_OneSecond_Call(void) if ((Is_Cartridge_Present(CART_2) != cartGetPresence(WasteCartridge_middle)) || (init)) { if (Is_Cartridge_Present(CART_2)) { cartCART_INSERTED(WasteCartridge_middle); + CartridgeStateUpdate(CARTRIDGE_SLOT__WasteMiddle, CARTRIDGE_STATE__Inserted, 0); } else { cartCART_EXTRACTED(WasteCartridge_middle); } @@ -350,6 +356,7 @@ void Waste_StateMachine_OneSecond_Call(void) if ((Is_Cartridge_Present(CART_3) != cartGetPresence(WasteCartridge_lower)) || (init)) { if (Is_Cartridge_Present(CART_3)) { cartCART_INSERTED(WasteCartridge_lower); + CartridgeStateUpdate(CARTRIDGE_SLOT__WasteLower, CARTRIDGE_STATE__Inserted, 0); } else { cartCART_EXTRACTED(WasteCartridge_lower); } @@ -451,15 +458,18 @@ void Waste_StateMachine(void) //start emptying WasteTankState = WasteTankStateEmptying; + CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Emptying, 0); break; case WasteTankStateEmptying: // if time out or emptying done - idle + activeCart = cartGetActiveCart(); if (timeout_counter++ > WASTE_EMPTING_TIMEOUT) { SetWastePump(CLOSE); cartFILLING_END(); // RFID change status - TBD WasteTankState = WasteTankStateIdle; Report("WasteTankStateEmptying TimeOut", __FILE__, __LINE__, 0, RpMessage, 0, 0); + CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); AlarmHandlingSetAlarm( EVENT_TYPE__WASTE_CONTAINER_EMPTYING_TIMEOUT, true); RemoveControlCallback(Cartridge_Cover_Control, Waste_DoorOpenDuringEmptying); timeout_counter = 0; @@ -473,8 +483,10 @@ void Waste_StateMachine(void) //if (cartNotAllFull() == false) AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); Report("WasteTankStateEmptying done", __FILE__, __LINE__, 0, RpMessage, 0, 0); + CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__EmptyingCompleted, WHS_GetCartridgeFillPercent()); timeout_counter = 0; } + CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Emptying, WHS_GetCartridgeFillPercent()); #ifdef WHS_DEBUG wasteLevel -= 100; timeout_counter += 10; @@ -495,7 +507,7 @@ void Waste_StateMachine(void) AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); Report("WasteTankStatePaused done", __FILE__, __LINE__, 0, RpMessage, 0, 0); timeout_counter = 0; - + CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); } break; default: -- cgit v1.3.1 From d41189e4e9c1ff00819d15eee5733ff9b469c42a Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 27 Oct 2020 18:05:27 +0200 Subject: small changes --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 7 +++++++ Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 2 +- Software/Stubs Collection/Procedures/Winder Calibration.pproj | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index d78b5114f..de4c31ed1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -429,6 +429,13 @@ void LoadChillerState(HeaterType HeaterType,HeaterState *HeaterState) HeaterState->setpoint = (float)(ShinkoTempDeg.Read_Setup); HeaterState->has_currentvalue = true; HeaterState->currentvalue = (float)(ShinkoTempDeg.Read_value); + HeaterState->has_isactive = true; + HeaterState->isactive = false; + HeaterState->has_isrampingup = true; + HeaterState->isrampingup = false; + HeaterState->has_isinsetpoint = true; + HeaterState->isinsetpoint = true; + return; } diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 8043f76a9..e90198bd3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -565,7 +565,7 @@ uint32_t Waste_PrepareCallbak(uint32_t IfIndex, uint32_t ReadValue) Report("Module waste HeadOut_FlowReady ready", __FILE__, __LINE__, (int)(HeadOut_Flow*100), RpMessage, WHS_FlowReady, 0); HeadOut_FlowReady = true; } - if (Head_Type (\"Initial Offset\");\r\n\r\n\t\tStubMotorMovRequest stubMotorMovRequest = new StubMotorMovRequest();\r\n\t\tstubMotorMovRequest.MotorID = SCREW_MOTOR;\r\n\t\tstubMotorMovRequest.Direction = true;\r\n\t\twhile (Located == false)\r\n\t\t{\r\n\t\t\tcontext.Send(motorHomingRequest);\r\n\t\t\tThread.Sleep(3000);\r\n\t\t\tstubMotorMovRequest.Position = (uint)(offset + Calibration_Offset)*8;\r\n\t\t\tcontext.Send(stubMotorMovRequest);\r\n\t\t\tThread.Sleep(3000);\r\n\r\n \tLocated =\tcontext.RequestUserInputFor(Located,\"Is Winder located well?\",\"Please fill in the form\");\r\n\r\n\t\t\t\r\n\t\t\tif (Located == false)\r\n\t\t\t{\r\n\t\t\t\toffset = context.RequestUserInputFor(Offset,\"Enter new value for calibration offset\",\" (15 steps = 1mm. minus - toward the machine\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tProgressRequest progressRequest = new ProgressRequest();\r\n\t\tprogressRequest.Amount = 0xB20;\r\n\t\tprogressRequest.Delay = Calibration_Offset;\r\n\t\tcontext.Send(progressRequest);\r\n\t\tbox_msg = \"Writing new winder offset \" + Calibration_Offset+ \"to the main card EEPROM\";\r\n\t\tMessageBox.Show(box_msg);\r\n\r\n }\r\n}","Name":"Program.csx","IsEntryPoint":true},{"$id":"4","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Service\r\n{\r\n public double Calc(double a, double b)\r\n {\r\n return a + b;\r\n }\r\n}","Name":"Service.csx","IsEntryPoint":false}]},"Inputs":{"$id":"5","$values":[{"$id":"6","Type":"Default","SelectionInputs":{"$id":"7","$values":[{"$id":"8","Name":"Enable Tamper Check","Value":"1.0"},{"$id":"9","Name":"Disable Tamper Check","Value":"0.0"}]},"DisplayName":"Initial offset","Description":"Initial offset for the winder arm","Key":"Initial Offset","Value":"200"},{"$id":"10","Type":"Boolean","SelectionInputs":{"$id":"11","$values":[]},"DisplayName":"Located","Description":"is winder located correctly?","Key":"Located","Value":"0"},{"$id":"12","Type":"Default","SelectionInputs":{"$id":"13","$values":[]},"DisplayName":"Calibration offset","Description":"Controls the 3 parameter.","Key":"Offset","Value":"0"}]},"Variables":{"$id":"14","$values":[]},"ReferenceAssemblies":{"$id":"15","$values":[{"$id":"16","File":"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","HintType":"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"17","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","HintType":"System.Linq.Enumerable, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"18","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Windows.Forms\\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll","HintType":"System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"19","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Procedures.dll","HintType":"Tango.FSE.Procedures.ProcedureProject, Tango.FSE.Procedures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"20","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Common.dll","HintType":"Tango.FSE.Common.Diagnostics.IDiagnosticsProvider, Tango.FSE.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"21","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.BL.dll","HintType":"Tango.BL.Enumerations.TechMonitors, Tango.BL, Version=2.0.36.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"22","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.PMR.dll","HintType":"Tango.PMR.Common.MessageType, Tango.PMR, Version=2.0.40.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"23","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Transport.dll","HintType":"Tango.Transport.ITransporter, Tango.Transport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"24","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Integration.dll","HintType":"Tango.Integration.Operation.IMachineOperator, Tango.Integration, Version=2.0.31.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"25","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Google.Protobuf.dll","HintType":"Google.Protobuf.IMessage, Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604"},{"$id":"26","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll","HintType":"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}]},"Resources":{"$id":"27","$values":[]},"Dialogs":{"$id":"28","$values":[]},"ID":"2bd29884-5eb9-4d27-be4e-6cfa31dc9f66","ApartmentState":"MTA"} \ No newline at end of file +{"$id":"1","Name":"Winder Calibration","Visibility":"Public","Description":"This procedure lets the FSE to set the correct location for the winder arm.","Scripts":{"$id":"2","$values":[{"$id":"3","Name":"Program.csx","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing System.IO;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.PMR.IO;\r\nusing Tango.FSE.Procedures;\r\nusing System.IO;\r\nusing System.Windows.Forms;\r\n\r\n\r\n\r\npublic class Program\r\n{\r\n public void OnExecute(IProcedureContext context)\r\n {\r\n\t\tuint SCREW_MOTOR = 14;\r\n\t\tint offset = 200;\r\n\t\tint Calibration_Offset = 0;\r\n\t\tbool Located = false;\r\n\t\tstring box_msg = \"Keep your hands away from the winder\";\r\n\t\tMessageBox.Show(box_msg);\r\n\t\tMotorHomingRequest motorHomingRequest = new MotorHomingRequest();\r\n\t\tmotorHomingRequest.MotorType = Tango.PMR.Hardware.HardwareMotorType.MotoScrew;\r\n\t\tmotorHomingRequest.Speed = 800;\r\n\t\tmotorHomingRequest.Direction = Tango.PMR.Diagnostics.MotorDirection.Forward;\r\n\t\t\r\n \toffset = context.GetInput(\"Initial Offset\");\r\n\r\n\t\tStubMotorMovRequest stubMotorMovRequest = new StubMotorMovRequest();\r\n\t\tstubMotorMovRequest.MotorID = SCREW_MOTOR;\r\n\t\tstubMotorMovRequest.Direction = true;\r\n\t\twhile (Located == false)\r\n\t\t{\r\n\t\t\tcontext.Send(motorHomingRequest);\r\n\t\t\tThread.Sleep(3000);\r\n\t\t\tstubMotorMovRequest.Position = (uint)(offset + Calibration_Offset)*8;\r\n\t\t\tcontext.Send(stubMotorMovRequest);\r\n\t\t\tThread.Sleep(3000);\r\n\r\n \tLocated =\tcontext.RequestUserInputFor(Located,\"Is Winder located well?\",\"Please fill in the form\");\r\n\r\n\t\t\t\r\n\t\t\tif (Located == false)\r\n\t\t\t{\r\n\t\t\t\toffset = context.RequestUserInputFor(offset,\"Enter new value for calibration offset\",\" (15 steps = 1mm. minus - toward the machine\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tProgressRequest progressRequest = new ProgressRequest();\r\n\t\tprogressRequest.Amount = 0xB20;\r\n\t\tprogressRequest.Delay = Calibration_Offset;\r\n\t\tcontext.Send(progressRequest);\r\n\t\tbox_msg = \"Writing new winder offset \" + Calibration_Offset+ \"to the main card EEPROM\";\r\n\t\tMessageBox.Show(box_msg);\r\n\r\n }\r\n}","IsEntryPoint":true},{"$id":"4","Name":"Service.csx","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Service\r\n{\r\n public double Calc(double a, double b)\r\n {\r\n return a + b;\r\n }\r\n}","IsEntryPoint":false}]},"Inputs":{"$id":"5","$values":[{"$id":"6","Type":"Default","SelectionInputs":{"$id":"7","$values":[{"$id":"8","Name":"Enable Tamper Check","Value":"1.0"},{"$id":"9","Name":"Disable Tamper Check","Value":"0.0"}]},"DisplayName":"Initial offset","Description":"Initial offset for the winder arm","Key":"Initial Offset","Value":"200"},{"$id":"10","Type":"Boolean","SelectionInputs":{"$id":"11","$values":[]},"DisplayName":"Located","Description":"is winder located correctly?","Key":"Located","Value":"0"},{"$id":"12","Type":"Default","SelectionInputs":{"$id":"13","$values":[]},"DisplayName":"Calibration offset","Description":"Controls the 3 parameter.","Key":"Offset","Value":"0"}]},"Variables":{"$id":"14","$values":[]},"ReferenceAssemblies":{"$id":"15","$values":[{"$id":"16","File":"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","HintType":"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"17","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","HintType":"System.Linq.Enumerable, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"18","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Windows.Forms\\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll","HintType":"System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"19","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Procedures.dll","HintType":"Tango.FSE.Procedures.ProcedureProject, Tango.FSE.Procedures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"20","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Common.dll","HintType":"Tango.FSE.Common.Diagnostics.IDiagnosticsProvider, Tango.FSE.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"21","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.BL.dll","HintType":"Tango.BL.Enumerations.TechMonitors, Tango.BL, Version=2.0.36.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"22","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.PMR.dll","HintType":"Tango.PMR.Common.MessageType, Tango.PMR, Version=2.0.40.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"23","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Transport.dll","HintType":"Tango.Transport.ITransporter, Tango.Transport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"24","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Integration.dll","HintType":"Tango.Integration.Operation.IMachineOperator, Tango.Integration, Version=2.0.31.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"25","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Google.Protobuf.dll","HintType":"Google.Protobuf.IMessage, Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604"},{"$id":"26","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll","HintType":"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}]},"Resources":{"$id":"27","$values":[]},"Dialogs":{"$id":"28","$values":[]},"ID":"2bd29884-5eb9-4d27-be4e-6cfa31dc9f66","ApartmentState":"MTA"} \ No newline at end of file -- cgit v1.3.1 From 10fa9ada3ea5299b7320e51adde3b6e460f2b026 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 27 Oct 2020 22:54:07 +0200 Subject: bug fix: alarm Id from the waste alarm testing function --- Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c | 2 +- Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h | 2 +- Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 4 +++- .../Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 6df2c27c6..53394f4c0 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -977,7 +977,7 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) if ((IFS_Availability[1] == IFS_RECOGNIZED_INIT_PASSED)&&(IFS_Availability[2] == IFS_RECOGNIZED_INIT_PASSED)) //ifs installed -check cartridges { - tempFoundReason = Waste_CheckState(); + tempFoundReason = Waste_CheckState(&AlarmId); if (tempFoundReason!=JOB_OK) { FoundReason = tempFoundReason; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h index 8a075bfd4..db15a9ffd 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h @@ -44,7 +44,7 @@ bool WHS_IsContainerFull(); bool WHS_WasteCartridgeLowerPresent(); bool WHS_WasteCartridgeMiddlePresent(); bool WHS_IsEmptying(); -uint32_t Waste_CheckState(void); +uint32_t Waste_CheckState(int *AlarmId); uint32_t Waste_Prepare(void); bool WHS_IsVocPpmOverAlarmLimit(); void setWastePrepareValues(float HeadLimit,float WasteLimit); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index c2f92d9fd..1e3d4f79a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -515,7 +515,7 @@ void Waste_StateMachine(void) break; } } -uint32_t Waste_CheckState(void) +uint32_t Waste_CheckState(int *AlarmId) { //check if the waste is ready to run - waste level not above overflow level and no cartridge in the slots if (wasteLevel > wasteLevelOverflow) @@ -524,6 +524,7 @@ uint32_t Waste_CheckState(void) JobEndReason = JOB_SAFETY_CRITICAL_ALARM; usnprintf(AlarmReasonStr, 100, "cannot start a job with waste tank overflow"); AlarmHandlingSetAlarm( EVENT_TYPE__WASTE_CONTAINER_OVERFLOW, true); + *AlarmId = EVENT_TYPE__WASTE_CONTAINER_OVERFLOW; //PrepareReady(Module_Waste,ModuleFail); return JOB_SAFETY_CRITICAL_ALARM; } @@ -537,6 +538,7 @@ uint32_t Waste_CheckState(void) Report("cannot start a job with cartridges in the IFS", __FILE__, __LINE__, wasteLevel, RpMessage, wasteLevelOverflow, 0); JobEndReason = JOB_WASTE_HANDLING_PROBLEM; AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); + *AlarmId = EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL; usnprintf(AlarmReasonStr, 100, "cannot start a job with cartridges in the IFS"); //PrepareReady(Module_Waste,ModuleFail); return JOB_WASTE_HANDLING_PROBLEM; diff --git a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs index 6627a4d60..7319b8f41 100644 --- a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs +++ b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs @@ -137,11 +137,11 @@ SetAutoFill = 3.0; configurationParameters.GeneralParameters.Add(SetAutoFill); double PowerOffDisableCleaning = new Double(); -PowerOffDisableCleaning = 0.0 +PowerOffDisableCleaning = 0.0; configurationParameters.GeneralParameters.Add(PowerOffDisableCleaning); double SublimationBlowTime = new Double(); -SublimationBlowTime = 30.0 +SublimationBlowTime = 30.0; configurationParameters.GeneralParameters.Add(SublimationBlowTime); double AllowedRangeForHeadBlowerDeviation = new Double(); @@ -149,7 +149,7 @@ AllowedRangeForHeadBlowerDeviation = 7; configurationParameters.GeneralParameters.Add(AllowedRangeForHeadBlowerDeviation); double AllowedRangeForWasteBlowerDeviation = new Double(); -AllowedRangeForWasteBlowerDeviation = 20; +AllowedRangeForWasteBlowerDeviation = 10; configurationParameters.GeneralParameters.Add(AllowedRangeForWasteBlowerDeviation); -- cgit v1.3.1 From 9cb2c024526e3690ac4b423beb876622a8106af1 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 27 Oct 2020 23:56:07 +0200 Subject: job error messages --- .../I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 2 ++ Software/Embedded_SW/Embedded/Modules/Control/control.c | 1 + Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 3 +++ Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 2 ++ Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 4 ++++ Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 1 + Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 7 +++++++ .../Embedded/StateMachines/Initialization/PowerOffSequence.c | 1 + Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 7 +++++-- Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c | 4 ++++ 10 files changed, 30 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index ce6b34dd9..57ccd0747 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -439,9 +439,11 @@ void SendLimitedBlowerControl(int mV) if (JobIsActive()) { JobEndReason = JOB_SAFETY_CRITICAL_ALARM; + usnprintf(AlarmReasonStr, 100, "Waste airflow Error %d",mV); SendJobProgress(0.0,0,false, "Waste airflow Error"); AbortJob("Waste airflow Error"); //SegmentReady(Module_Heaters,ModuleFail); + ReportWithPackageFilter(HeatersFilter, "Waste airflow Error",__FILE__,__LINE__,mV,RpError, 0,0); HeatersEnd(); return; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 2047e9910..ce4a91465 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -190,6 +190,7 @@ uint32_t ControlActivityLed( uint32_t Parameter1) if (JobIsActive()) { JobEndReason = JOB_MOTOR_ALARM; + usnprintf(AlarmReasonStr, 100, "Hardware Failure Error"); SendJobProgress(0.0,0,false, "Hardware Failure Error"); AbortJob("FPGA Watchdog Error"); } diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index d977fe3f3..56b46c98c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -399,6 +399,7 @@ uint32_t HeatersTestInternalAlarmsCBFunction(uint32_t IfIndex, uint32_t readValu if (JobIsActive()) { JobEndReason = JOB_TEMPERATURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Internal Temperature %d Error %d",index,readValue); SendJobProgress(0.0,0,false, "Internal Temperature Error"); AbortJob("Internal Over Temperature Error"); //SegmentReady(Module_Heaters,ModuleFail); @@ -1188,6 +1189,7 @@ uint32_t DcHeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) if (JobIsActive()&&(HeaterReady[index]==true)) { JobEndReason = JOB_TEMPERATURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Temperature %d Error %d",index,readValue); SendJobProgress(0.0,0,false, "Temperature Error"); AbortJob("Over Temperature Error"); //SegmentReady(Module_Heaters,ModuleFail); @@ -1239,6 +1241,7 @@ uint32_t DcHeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) if (JobIsActive()&&(HeaterReady[index]==true)) { JobEndReason = JOB_TEMPERATURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Temperature %d Error %d",index,readValue); SendJobProgress(0.0,0,false, "Temperature Error"); AbortJob("Under Temperature Error"); ReportWithPackageFilter(HeatersFilter, "Temperature Error",__FILE__,__LINE__,index,RpError, 0,0); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 2c2ebfd07..ab2062293 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -20,6 +20,7 @@ #include "drivers/FPGA/FPGA_SPI_Comm.h" #include "drivers/Motors/Motor.h" #include "drivers/Valves/Valve.h" +#include "Modules/AlarmHandling/AlarmHandling.h" FPGA_GPI_ENUM Dispenser_Id_to_LS_Id[MAX_SYSTEM_DISPENSERS] = { @@ -502,6 +503,7 @@ uint32_t IDS_Dispenser_Alarm_On (uint8_t DispenserId) status |= MotorStop(MotorId, Hard_Hiz); IDS_Dispenser_Init(DispenserId); JobEndReason = JOB_OUT_OF_DYE; + usnprintf(AlarmReasonStr, 100, "IDS_Dispenser_Alarm_On %d ",DispenserId); return status; } uint32_t IDS_Dispenser_Alarm_Off (uint8_t DispenserId) diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 462165ee7..9f8491aa1 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -643,6 +643,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl endOfPrepareWCF = true; result = ModuleFail; JobEndReason = JOB_PRESSURE_ALARM; + usnprintf(AlarmReasonStr, 100, "IDS pressure timeout %d ",DispenserPrepareTimeout); pressureReady = true; ReportWithPackageFilter(IDSFilter,"pressure timeout!",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)(DispenserPreparePressure*100),0); for (i = 0; i < MAX_DYE_DISPENSERS; i++) @@ -1357,6 +1358,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) { ReportWithPackageFilter(IDSFilter,"Error JobBrushStopId",__FILE__,__LINE__,(int)Segment->n_brushstops,RpError,(int)0,0); JobEndReason = JOB_OUT_OF_DYE; + usnprintf(AlarmReasonStr, 100, "IDS brushstop error %d above %d ",JobBrushStopId,Segment->n_brushstops); PreSegmentReady(Module_IDS,ModuleFail); return ERROR; } @@ -1449,6 +1451,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) { ReportWithPackageFilter(IDSFilter,"End run - BrushStopReadError",__FILE__,__LINE__,(int)FileBrushStop,RpError,(int)0,0); JobEndReason = JOB_OUT_OF_DYE; + usnprintf(AlarmReasonStr, 100, "IDS brushstop read error"); PreSegmentReady(Module_IDS,ModuleFail); } } @@ -1663,6 +1666,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) { Task_stat(Task_self(),&statbuf); ReportWithPackageFilter(IDSFilter,"BrushStopRead Error",__FILE__,statbuf.used,(int)statbuf.stackSize,RpWarning,(int)statbuf.stackHeap,0); + usnprintf(AlarmReasonStr, 100, "IDS brushstop error"); JobEndReason = JOB_OUT_OF_DYE; SegmentReady(Module_IDS,ModuleFail); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 0440d2241..a6cb25c45 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -167,6 +167,7 @@ uint32_t Winder_Prepare(void *JobDetails) if (IgnoreConeMissing == false) { JobEndReason = JOB_THREAD_BREAK; + usnprintf(AlarmReasonStr, 100, "No cone in winder"); PrepareReady(Module_Winder,ModuleFail); AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); return ERROR; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 94350f752..bc4e6cb8f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -459,6 +459,7 @@ uint32_t checkBreakSensor(uint32_t index) JobEndReason = JOB_THREAD_BREAK; ThreadControlActive = false; SendJobProgress(0.0,0,false, TMessage); + strcpy(AlarmReasonStr,TMessage); SendSegmentFail(); //AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,true); //EndState(CurrentJob,"ReadBreakSensor Error" ); @@ -482,6 +483,7 @@ uint32_t checkBreakSensor(uint32_t index) { //consider applying the debouce parameters later usnprintf(TMessage, 60, "thread speed too low"); + strcpy(AlarmReasonStr,TMessage); JobEndReason = JOB_THREAD_BREAK; ThreadControlActive = false; SendJobProgress(0.0,0,false, TMessage); @@ -685,6 +687,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) JobEndReason = JOB_WINDER_DANCER_FAIL+HARDWARE_DANCER_0; #endif SendJobProgress(0.0,0,false, TMessage); + strcpy(AlarmReasonStr,TMessage); //EndState(CurrentJob,TMessage ); SendSegmentFail(); /*switch (index) @@ -1115,6 +1118,7 @@ uint32_t ThreadPrepareState(void *JobDetails) { ReportWithPackageFilter(ThreadFilter,"Dyeing head is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpWarning,LIMIT,0); //JobEndReason = JOB_LIDS_OPEN; + // usnprintf(AlarmReasonStr, 100, "Dyeing head is open!!!"); //PrepareReady(Module_Thread,ModuleFail); //return ERROR; } @@ -1122,6 +1126,7 @@ uint32_t ThreadPrepareState(void *JobDetails) { ReportWithPackageFilter(ThreadFilter,"Dryer lid is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpWarning,LIMIT,0); //JobEndReason = JOB_LIDS_OPEN; + // usnprintf(AlarmReasonStr, 100, "Dyeing head is open!!!"); //PrepareReady(Module_Thread,ModuleFail); //return ERROR; }*/ @@ -1135,6 +1140,7 @@ uint32_t ThreadPrepareState(void *JobDetails) if (SkipOpenLids == false) { JobEndReason = JOB_LIDS_OPEN; + usnprintf(AlarmReasonStr, 100, "Dyeing head is open!!!"); PrepareReady(Module_Thread,ModuleFail); return ERROR; } @@ -1155,6 +1161,7 @@ uint32_t ThreadPrepareState(void *JobDetails) if (SkipOpenLids == false) { JobEndReason = JOB_LIDS_OPEN; + usnprintf(AlarmReasonStr, 100, "Dryer lid is open!!!"); PrepareReady(Module_Thread,ModuleFail); return ERROR; } diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index dc7c09499..3a0c94e27 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -363,6 +363,7 @@ uint32_t PowerOffStopRunningJob(void) { REPORT_MSG (PowerOffMachineState, "Stop running job"); JobEndReason = JOB_ABORTED_BY_USER; + usnprintf(AlarmReasonStr, 100, "Power off pressed"); AbortJob("Power off pressed"); } PowerOffMachineState++; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 39afcb954..0a176c2cb 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -1155,14 +1155,14 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes { responseContainer.has_error = true; responseContainer.error = JobError_to_ErrorCode[JobEndReason]; + if (strlen(ErrorMsg)) + responseContainer.errormessage = ErrorMsg; } if (JobAbortedByUser == true) { JobAbortedByUser = false; responseContainer.has_error = true; responseContainer.error = ERROR_CODE__CONTINUOUS_RESPONSE_ABORTED; - if (strlen(ErrorMsg)) - responseContainer.errormessage = ErrorMsg; } } container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -1206,6 +1206,9 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes default: break; } + if (strlen(AlarmReasonStr)) + strncpy(ErrorMsg,AlarmReasonStr,100); + } JobMessageStruc JobMessage; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index 3b0844934..9e43bfb07 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -28,6 +28,7 @@ #include "modules/Heaters/Heaters_ex.h" #include "modules/Diagnostics/Diagnostics.h" #include "modules/ids/ids_ex.h" +#include "Modules/AlarmHandling/AlarmHandling.h" #include "PMR/Hardware/UploadHardWareConfigurationRequest.pb-c.h" #include "PMR/Hardware/HardwareMotorType.pb-c.h" @@ -756,6 +757,7 @@ void PrintSTMMsgHandler(void * msg) if (RewindJobFile() != FR_OK) { JobEndReason = JOB_FILE_PROBLEM; + usnprintf(AlarmReasonStr, 100, "Job file processing error"); if (dryerbufferlength <= 0.1) EndState(CurrentJob, "Job Ended"); else @@ -795,6 +797,7 @@ void PrintSTMMsgHandler(void * msg) else { JobEndReason = JOB_FILE_PROBLEM; + usnprintf(AlarmReasonStr, 100, "Job file processing error"); if (dryerbufferlength <= 0.1) EndState(CurrentJob, "Job Ended"); else @@ -814,6 +817,7 @@ void PrintSTMMsgHandler(void * msg) { Report("SegmentLoading failed",__FILE__,__LINE__, Segment,RpMessage,(int)(Segment->length*100),0); JobEndReason = JOB_FILE_PROBLEM; + usnprintf(AlarmReasonStr, 100, "Job file processing error"); if (dryerbufferlength <= 0.1) EndState(CurrentJob, "Job Ended"); else -- cgit v1.3.1 From c600f59c302364dfa26eb714b12d1fe18aa1b18f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 09:58:18 +0200 Subject: ifs percentage --- Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index b8b1915c4..b450d58db 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -375,7 +375,7 @@ void midTankStateMachine(void) MidTankValvesAction(Cartridge_MidTank_OFF); Report("Mid-tank # filling done", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__FillingCompleted, GetCartridgeFillPercent()); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__FillingCompleted, 100.0); } CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Filling, GetCartridgeFillPercent()); break; -- cgit v1.3.1 From 110bb042f060516a18e0b1bf64fb544dc69687e2 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 12:11:58 +0200 Subject: waste block actions on LP machine. VOC logs --- .../I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 2 ++ Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 1 + 2 files changed, 3 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index 57ccd0747..aef2be5fe 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -594,6 +594,8 @@ void WHS_Start_Blower_Control_Closed_Loop () return; //do not start before controller is initialized and running if (EnableControlLoop == false) return; //do not start loop + if (WHS_Type == WHS_TYPE_NEW) + return; //do not start loop if (count == close_loop_time) { diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 1e3d4f79a..75cd2fcb2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -623,6 +623,7 @@ bool WHS_IsVocPpmOverAlarmLimit() if( ( Latest_Gas_Sens_PPM > VocPpmAlarmLimit ) || //PPM ( (Latest_Gas_Sens_PPM > VocPpmAlarmLimit90Percent) && (ReadingVocEverySec == true) ) ) //Hysteresis { + Report("VOC nearing alarm state", __FILE__, (int)(Latest_Gas_Sens_PPM*100), VocPpmAlarmLimit, RpMessage, counter, 0); //reading every sec ReadingVocEverySec = true; if(counter < 0xFF) -- cgit v1.3.1 From 3ca8992ee4e193b2599d787c4bc623d5df2d9407 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 12:31:08 +0200 Subject: cancel VOC alarms --- .../Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c | 8 ++++---- Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c index e6a20904e..6ffb9949f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c +++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c @@ -46,13 +46,13 @@ void CalculateVOCAlarms(void) if ((slope1>0)&&(slope1 > VOC_Slope)) { slopeindex++; - if (slopeindex>=VOC_Slope_Time) + /*if (slopeindex>=VOC_Slope_Time) { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,true); Report("CalculateVOCAlarms slope on",__FILE__,__LINE__,(int)slope1,RpWarning,slopeindex,0); alarmstate = true; VOC_SlopeAlarm = true; - } + }*/ } else { @@ -67,7 +67,7 @@ void CalculateVOCAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,false); } - if (a/MAX_VOC_SAMPLES > VOC_AverageLimit) + /*if (a/MAX_VOC_SAMPLES > VOC_AverageLimit) { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_TIME,true); Report("CalculateVOCAlarms time on",__FILE__,__LINE__,(int)a,RpWarning,VOC_AverageLimit,0); @@ -75,7 +75,7 @@ void CalculateVOCAlarms(void) else if (VOC_TimeAlarm == true) { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_TIME,false); - } + }*/ } diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 75cd2fcb2..6c2709fcd 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -631,11 +631,11 @@ bool WHS_IsVocPpmOverAlarmLimit() counter++; } - if(counter > VocPpmLimitForXSec)//Sec + /*if(counter > VocPpmLimitForXSec)//Sec { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,true); return true;//Buzzer ON if defined - } + }*/ } else { -- cgit v1.3.1 From 0a832457d2bc796f8d2b8b2c6e2d43b4b86bc1c6 Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Wed, 28 Oct 2020 12:31:11 +0200 Subject: waste led fix --- Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 1e3d4f79a..1a95cfefe 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -66,6 +66,7 @@ void cartCART_INSERTED (WasteCartridgeEnum CartId) if (CartState[CartId] != CartridgeStateOUT) Report("Cartridges Cart inserted wrong state", __FILE__, __LINE__, CartId, RpMessage, CartState[CartId], 0); CartState[CartId] = CartridgeStateIN; + Pannel_Leds((CartId == WasteCartridge_middle)?CART_2:CART_3, MODE_ON); CartLed[CartId]->color = colorON; Report("Cartridges Cart inserted", __FILE__, __LINE__, CartId, RpMessage, CartState[CartId], 0); @@ -78,6 +79,7 @@ void cartCART_EXTRACTED(WasteCartridgeEnum CartId) //{called from polling functi Report("Cartridges Cart extracted", __FILE__, __LINE__, CartId, RpMessage, CartState[CartId], 0); CartState[CartId] = CartridgeStateOUT; + Pannel_Leds((CartId == WasteCartridge_middle)?CART_2:CART_3, MODE_OFF); CartLed[CartId]->color = colorOFF; if (init==0) WHS_Set_IFS_Clearing_Suction(NUM_OF_MIDTANKS); -- cgit v1.3.1 From 623cfa22f3de60869b9679219fe2c6ca1fad10cb Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 12:49:18 +0200 Subject: Version 1.5.1.1 remove VOC alarm until end of mechanic testing. remove old VOC code --- Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c | 10 +++++----- .../Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h | 4 ++-- .../Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c | 17 +++++++++-------- .../Embedded/Modules/Stubs_Handler/Progress.c | 8 ++++---- 5 files changed, 21 insertions(+), 20 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index a18588c72..08dc68781 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,5,1,0}; +TangoVersion_t _gTangoVersion = {1,5,1,1}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c index 627ad45b9..f9092c889 100644 --- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c +++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c @@ -430,14 +430,14 @@ void ADCAcquireStop(void) double VPressure_0 = 0; double A_offset =-2.429, B_slope_coefficient = 0.267;//A - offset, B - slope coefficient -double Calculate_Pitot_Pressure(bool flow ) // WHS - AN_AIRPRESS_1 +/*double Calculate_Pitot_Pressure(bool flow ) // WHS - AN_AIRPRESS_1 { //MPXV7002 (NXP) uint32_t VsampleInBits; - double Pressure = 0.0, temp, /*PKpa,PBar,*/VADC = 0.0 ,VSensor/*,PMicroBar*/; + double Pressure = 0.0, temp, /`*PKpa,PBar,*`/VADC = 0.0 ,VSensor/`*,PMicroBar*`/; VsampleInBits = ADC_GetReading(ADC_AIR_PRESSURE_1); @@ -465,18 +465,18 @@ double Calculate_Pitot_Pressure(bool flow ) // WHS - AN_AIRPRESS_1 { Pressure = A_offset + B_slope_coefficient * (sqrt(VSensor - VPressure_0)); - /* + /`* PKpa = 5 * VSensor; // ---- P[Kpa] -> BAR ---- PBar = PKpa / 100.0; PMicroBar = PBar/1000; - Pressure = PMicroBar;*/ + Pressure = PMicroBar;*`/ return Pressure; } -} +}*/ uint32_t Read_Dryer_Heaters_Current(HEATERS_CURRENT Heater_ID) // { diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h index d7efd45d4..0dc1523fa 100644 --- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h +++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h @@ -60,8 +60,8 @@ void ADCAcquireStop(void); void ADC0SS0Handler(void); -double Calculate_Pitot_Pressure(bool flow ) ; -uint8_t Calculate_Gas_Power_Consumption(); +//double Calculate_Pitot_Pressure(bool flow ) ; +//uint8_t Calculate_Gas_Power_Consumption(); uint32_t Read_Dryer_Heaters_Current(HEATERS_CURRENT Heater_ID); void CheckAcInputVoltage(); diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c index 6ffb9949f..ea2f5a050 100644 --- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c +++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c @@ -31,9 +31,9 @@ void VOCAlarmsInit(void) memset(Gas_PPM,0,sizeof(Gas_PPM)); } -void CalculateVOCAlarms(void) +/*void CalculateVOCAlarms(void) { - int i,slope1=0,/*slope2=0,*/slopeindex=0; + int i,slope1=0,/`*slope2=0,*`/slopeindex=0; double a; bool alarmstate = false; for (i = 0; i< MAX_VOC_SAMPLES; i++) @@ -46,13 +46,13 @@ void CalculateVOCAlarms(void) if ((slope1>0)&&(slope1 > VOC_Slope)) { slopeindex++; - /*if (slopeindex>=VOC_Slope_Time) + /`*if (slopeindex>=VOC_Slope_Time) { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,true); Report("CalculateVOCAlarms slope on",__FILE__,__LINE__,(int)slope1,RpWarning,slopeindex,0); alarmstate = true; VOC_SlopeAlarm = true; - }*/ + }*`/ } else { @@ -67,7 +67,7 @@ void CalculateVOCAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,false); } - /*if (a/MAX_VOC_SAMPLES > VOC_AverageLimit) + /`*if (a/MAX_VOC_SAMPLES > VOC_AverageLimit) { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_TIME,true); Report("CalculateVOCAlarms time on",__FILE__,__LINE__,(int)a,RpWarning,VOC_AverageLimit,0); @@ -75,7 +75,7 @@ void CalculateVOCAlarms(void) else if (VOC_TimeAlarm == true) { AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_TIME,false); - }*/ + }*`/ } @@ -84,14 +84,14 @@ uint8_t Calculate_Gas_Power_Consumption() // WHS // TGS 2602 (FIGARO) -/* Concentrtion Sensor +/`* Concentrtion Sensor [ppm] [v] 0 0.353 18 0.438 33 2.919 100 4.196 316 4.571 -*/ +*`/ double VOC_Vsensor[] = { @@ -182,3 +182,4 @@ uint8_t Calculate_Gas_Power_Consumption() // WHS return 0xFF;//out of scale } +*/ diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 0d5d60af0..959f69ca4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -559,7 +559,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.progress = Power_Step_01_Mode(((request->delay &0x00FF00)>>8), request->delay &0x0000FF); response.has_progress = true; } - else + /*else if((request->amount == 0xAB) && (request->delay == 0xAB)) //Get pressure with flow (orifice flow meter) { response.progress = Calculate_Pitot_Pressure(true); @@ -572,7 +572,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.progress = Calculate_Pitot_Pressure(false); response.has_progress = true; - } + }*/ else if((request->amount == 0xAC) && (request->delay == 0xAC)) //VAC { @@ -918,13 +918,13 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) ROM_WatchdogReloadSet(WATCHDOG0_BASE, timeout); #endif } - else + /*else if((request->amount == 0x0C) && (request->delay == 0x0C)) //Get Gas Sensor { response.progress = (double)Calculate_Gas_Power_Consumption(); response.has_progress = true; - } + }*/ else if((request->amount == 0xDD) && (request->delay == 0xDD)) //Read Input Voltage { -- cgit v1.3.1 From 43d60f6cbcef7a9d8904c2495f6f672c3a4c1b38 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 13:12:11 +0200 Subject: thread load led fix --- Software/Embedded_SW/Embedded/Modules/General/buttons.c | 6 ++++++ Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 2 ++ 2 files changed, 8 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c index c03f7d913..0dda71d16 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c @@ -416,9 +416,15 @@ uint32_t ButtonLoadCBFunction(uint32_t IfIndex, uint32_t ReadValue) if (ThreadLoadingActive() == false) { if (JobIsActive()) + { load.color = colorOFF; + Pannel_Leds(THREAD_LOAD, MODE_OFF); + } else + { load.color = colorON; + Pannel_Leds(THREAD_LOAD, MODE_ON); + } } break; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index f7ed9065f..63072e4d8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -339,6 +339,7 @@ else { load.color = colorON; + Pannel_Leds(THREAD_LOAD, MODE_ON); ThreadLoadingReport(); } } @@ -852,6 +853,7 @@ LoadStages = THREAD_LOAD_INIT; load.color = colorON; + Pannel_Leds(THREAD_LOAD, MODE_ON); return OK; } uint32_t Thread_Load_switchCallback(uint32_t deviceID, uint32_t BusyFlag) -- cgit v1.3.1 From 8efe188632bc4ac542b34fa9cfb18996179410b8 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 13:22:16 +0200 Subject: fix leds handling --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index ce4a91465..0a092821e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -209,6 +209,20 @@ uint32_t ControlActivityLed( uint32_t Parameter1) else ACTIVITY_GREEN_LED_OFF; + if(power.color == colorOFF) Pannel_Leds(POWER_ON_OFF,MODE_OFF); + if(jog.color == colorOFF) Pannel_Leds(THREAD_JOGGING,MODE_OFF); + if(load.color == colorOFF) Pannel_Leds(THREAD_JOGGING,MODE_OFF); + if(cart1.color == colorOFF) Pannel_Leds(CART_1,MODE_OFF); + if(cart2.color == colorOFF) Pannel_Leds(CART_2,MODE_OFF); + if(cart3.color == colorOFF) Pannel_Leds(CART_3,MODE_OFF); + + if(power.color == colorON) Pannel_Leds(POWER_ON_OFF,MODE_ON); + if(jog.color == colorON) Pannel_Leds(THREAD_JOGGING,MODE_ON); + if(load.color == colorON) Pannel_Leds(THREAD_JOGGING,MODE_ON); + if(cart1.color == colorON) Pannel_Leds(CART_1,MODE_ON); + if(cart2.color == colorON) Pannel_Leds(CART_2,MODE_ON); + if(cart3.color == colorON) Pannel_Leds(CART_3,MODE_ON); + if(power.color == fastBILNK) Pannel_Leds(POWER_ON_OFF,MODE_OFF); else -- cgit v1.3.1 From 6d2c4fb1e5834a7a74bdd5399e9ba82f403a52eb Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 23:41:57 +0200 Subject: set screw max speed for the calibration procedure (0xb21) --- Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 959f69ca4..a3a0ff38e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -1218,6 +1218,14 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else + if(request->amount == 0xB21) //Set loading arm cycles + { + LOG_ERROR(request->delay,"Set screw max speed"); + + response.progress = (double)MotorSetMaxSpeed(HARDWARE_MOTOR_TYPE__MOTO_SCREW,request->delay); + response.has_progress = true; + } + else if(request->amount == 0xC3) //suspend I2C task { if (request->delay == 0) -- cgit v1.3.1