diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-02 13:13:03 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-02 13:13:03 +0200 |
| commit | 2bfca4fac0ca1b3d489d20ce7c4799e05876ecb5 (patch) | |
| tree | 1dd9b88877101f62d9222cd6e6706c17ffe10cd9 /Software/Embedded_SW/Embedded/Modules/Control | |
| parent | 78e42a1f21ce22e895a82628354aba64a0a2d66a (diff) | |
| parent | f83a99d14efab540c664a4bed826caf213e7074d (diff) | |
| download | Tango-2bfca4fac0ca1b3d489d20ce7c4799e05876ecb5.tar.gz Tango-2bfca4fac0ca1b3d489d20ce7c4799e05876ecb5.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
3 files changed, 34 insertions, 31 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 6ce453538..689219583 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -598,7 +598,6 @@ void setRapidPressureRead(bool value) if (GetDiagnosticMode() == Diagnostic_Extreme_Mode) RapidPressureRead = true; } -bool Shinko_Read = false; uint16_t PumpCounter = 0; uint16_t realtimetest[101]; uint32_t MillisecLowLoop(uint32_t tick) @@ -640,6 +639,7 @@ uint32_t MillisecLowLoop(uint32_t tick) //Screw_ENC_Velocity_to_DAC(); - for testing the screw enc if (Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD) StartPT100 = TEMP_SENSE_ANALOG_DRYER_TEMP1; + if (Ten_msTick) { //Speed_Data = Read_Speed_Sensor_TypeII(); @@ -738,26 +738,6 @@ uint32_t MillisecLowLoop(uint32_t tick) if (isMotorConfigured(Motor_i)) MotorGetStatusFromFPGA(Motor_i); } -#ifdef USE_SHINKO_AUTO_COMM - if ((WHS_Type == WHS_TYPE_NEW)&&(Shinko_Read == true)) - { - if(ShinkoTempDeg.Read_Setup == 0x00)//didn't read it yet - { - WHS_Shinko_Communication(R_SETUP); - } - else - /*if(0)//TBD - need stop condition to write only once (all the steps) , Read_Setup != setup, Read_Setup != 0, Read_Setup != Prev_Read_Setup - { - // option to wrte + read setup and stop when read = write - WHS_Shinko_Communication(W_SETUP); - } - else*/ - { - //finish reading the setup before start reading the value - WHS_Shinko_Communication(R_Value); // Reading every fourth cycle (Set HW, Request, Set HW, Response) - } - } -#endif } if ((O500Millisecond_Tick)&&(RapidPressureRead == false)) { @@ -820,6 +800,11 @@ uint32_t MillisecLowLoop(uint32_t tick) Whs_emptying_cycle++; } */ + + if(Shinko_first_read < 2)//read the two steps once and than in cycle every 10 minutes, also will be used to read after updating the temperature + { + Shinko_Cycle_Comm(); + } } if (Head_Type == HEAD_TYPE_ARC) { HeadBlowersControlLoop(); @@ -837,15 +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 - - Shinko_Read = true;//start cycle of R/W setup or value every 10Sec } if (OneMinute_Tick) { @@ -876,6 +852,17 @@ uint32_t MillisecLowLoop(uint32_t tick) { waste_seq_step1();// include 1Sec delay <- to open !!!! }*/ + if (WHS_Type == WHS_TYPE_NEW) + { + 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/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h index f7351d0b1..0d7c42ad6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h @@ -50,7 +50,6 @@ void MillisecLogClose(void); #endif -extern bool Shinko_Read; extern bool watchdogCriticalAlarm; extern Task_Handle Millisecond_Task_Handle; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 14275533e..0a092821e 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"); } @@ -198,6 +199,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(); } @@ -206,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 |
