From a52e0e1b4f0b981af32427cb7b2044f5cedd9829 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 6 Jul 2020 16:52:05 +0300 Subject: Version 1.4.6.35 - Pack Mid alpha ============================ Arc head - activate arc heaters gradually stop FPGA Reinit after 20 trials Head cleaning - move actuators (with stub - 0xAD7) fix RML PID support head open prevent job - (with stub - 0xAD6) add stub to overrule cone missing - 0xAD8 --- Software/Embedded_SW/Embedded/Modules/Thread/Thread.h | 1 - 1 file changed, 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread.h') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index d1d23598f..3a7045a6e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -76,7 +76,6 @@ extern int MotorSpeedSamplePointer[MAX_THREAD_MOTORS_NUM]; uint32_t InternalWinderConfigMessage(HardwareWinder* request); uint32_t MotorsConfigMessage( HardwareConfiguration* HW_request); uint32_t InternalWindingConfigMessage(JobSpool* request); -uint32_t ThreadInitialTestStub(HardwareMotor * request); uint32_t MotorPidRequestMessage(HardwarePidControl* request); void SetKeepWindingCone(bool value); void SetWinderBackToBaseTime(uint32_t value); -- cgit v1.3.1 From 4afe631a74c19db1fe7d06d3ea7732decc69f82b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 26 Jul 2020 19:03:22 +0300 Subject: loading improved, actoator relocated. waste alarms --- .../I2C_Communication/Head_Card/IO_Ports/Head_IO.c | 35 ++++++++++---- .../Modules/Diagnostics/DiagnosticActions.c | 5 +- .../Embedded/Modules/IDS/IDS_Cleaning.c | 5 +- .../Embedded_SW/Embedded/Modules/Thread/Thread.h | 3 ++ .../Embedded/Modules/Thread/ThreadLoad.c | 55 ++++++++++++++-------- .../Embedded/Modules/Thread/Thread_init.c | 2 +- .../Embedded/Modules/Waste/Waste_maint.c | 12 ++--- 7 files changed, 80 insertions(+), 37 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread.h') diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c index 691f1c455..1ac0e439b 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c @@ -547,6 +547,12 @@ uint32_t HeadCard_ActStubCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) / ACTUATORS Act_ID = (ACTUATORS)(IfIndex); + if (SafeRemoveControlCallback(ActControlId, HeadCard_ActStubCallBackFunction )==OK) + ActControlId = 0xFF; + else + Report("Remove control callback failed",__FILE__,__LINE__,(int)ActControlId,RpWarning,(int)HeadCard_ActStubCallBackFunction,0); + + Report("HeadCard_ActStubCallBackFunction",__FILE__,__LINE__,(int)ActControlId,RpWarning,(int)Act_ID,0); if(Act_ID == ACTIN)//0 { Head_I2C_EXP4_0x46.bits.OUTPUT_ACTLOW_ACTIN_ON = HIGH; @@ -563,6 +569,7 @@ uint32_t HeadCard_ActStubCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) / uint32_t HeadCard_Actuators_Stub(ACTUATORS Act_ID, bool Enable, bool Direction)//ENABLE/DISABLE, DOWN/UP/DONTCARE { uint32_t status = OK; + Report("HeadCard_Actuators_Stub",__FILE__,Act_ID,(int)Enable,RpWarning,(int)Direction,0); if(Enable == true) { @@ -580,7 +587,8 @@ uint32_t HeadCard_Actuators_Stub(ACTUATORS Act_ID, bool Enable, bool Direction)/ } //100msec delay - (need short command - Active LOW ) - ActControlId = AddControlCallback("ctuatorControl", HeadCard_ActStubCallBackFunction, (eHundredMillisecond), TemplateDataReadCBFunction,Act_ID,0, 0 ); + if (ActControlId == 0xFF) + ActControlId = AddControlCallback("ctuatorControl", HeadCard_ActStubCallBackFunction, (eHundredMillisecond), TemplateDataReadCBFunction,Act_ID,0, 0 ); } else { @@ -594,6 +602,10 @@ uint32_t HeadCard_Actuators_Stub(ACTUATORS Act_ID, bool Enable, bool Direction)/ { Head_I2C_EXP4_0x46.bits.OUTPUT_ACTLOW_ACTOT_ON = HIGH; } + if (RemoveControlCallback(ActControlId, HeadCard_ActStubCallBackFunction )==OK) + ActControlId = 0xFF; + else + Report("Remove control callback failed",__FILE__,__LINE__,(int)ActControlId,RpWarning,(int)HeadCard_ActStubCallBackFunction,0); } status |= Head_Write_IO_Reg(0x42,HIGH); @@ -693,7 +705,7 @@ uint8_t Head_Test_IO() return status; } -#define ACTUATOR_RELOCATING_MOVEUP_TIME 160 +#define ACTUATOR_RELOCATING_MOVEUP_TIME 16//160 typedef enum { @@ -725,31 +737,38 @@ bool isActuatorOnLowestLocation(void) // Give indication if the actuator stopped uint32_t HeadCard_Actuators_Relocate_callback(uint32_t IfIndex, uint32_t BusyFlag) // use IfIndex for Act_ID { count_time++; + //ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0); switch (ActuatorLocating) { case ActuatorIdle: break; case ActuatorMoveDown: - Trigger_Head_Actuators_Stub(ACTIN, ENABLE, DOWN); - ActuatorLocating = ActuatorWait; - ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0); + if (count_time <=1) + Trigger_Head_Actuators_Stub(ACTIN, ENABLE, DOWN); + if (count_time > 10) + { + ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0); + ActuatorLocating = ActuatorWait; + } break; case ActuatorWait: if (isActuatorOnLowestLocation())//read the inputs in Hundred_msTick { - ActuatorLocating = ActuatorMoveUp; Trigger_Head_Actuators_Stub(ACTIN, ENABLE, UP); moveuptime = count_time; ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0); + ActuatorLocating = ActuatorMoveUp; } break; case ActuatorMoveUp: if (count_time>=(moveuptime+MovingUpTime)) { Trigger_Head_Actuators_Stub(ACTIN, DISABLE, DONTCARE); - ActuatorLocating = ActuatorLocated; ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0); + ActuatorLocating = ActuatorLocated; } + else + Trigger_Head_Actuators_Stub(ACTIN, ENABLE, UP); break; case ActuatorLocated: if (SafeRemoveControlCallback(ActuatorLocatingControl, HeadCard_Actuators_Relocate_callback )==OK) @@ -770,7 +789,7 @@ uint32_t HeadCard_Actuators_Relocate(void) ActuatorLocating = ActuatorMoveDown; count_time = 0; ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0); - ActuatorLocatingControl = AddControlCallback("Actuator Location", HeadCard_Actuators_Relocate_callback, eOneMillisecond, TemplateDataReadCBFunction,0,0, 0 ); + ActuatorLocatingControl = AddControlCallback("Actuator Location", HeadCard_Actuators_Relocate_callback, eTenMillisecond, TemplateDataReadCBFunction,0,0, 0 ); } return ActuatorLocatingControl; } diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c index 7bda97734..9e7ab1e56 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c @@ -232,7 +232,10 @@ uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer) Pumps_Control(WASTECH_PUMP2, request->value); break; case INTERFACE_IOS__GPO_LED3: - Trigger_Head_Actuators_Control(ACTIN, LOW,request->value); + if (request->value == true) + Trigger_Head_Actuators_Control(ACTIN, LOW,request->value); + else + HeadCard_Actuators_Relocate(); break; case INTERFACE_IOS__GPO_LED4: Trigger_Head_Actuators_Control(ACTOT, LOW,request->value); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c index 0be1e7ebe..c9e9afdde 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c @@ -101,8 +101,9 @@ uint32_t IDS_Cleaning_Center_And_Stop_Rockers (int timeout,callback_fptr callbac uint32_t status = OK; //status |= MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD].directionthreadwize, SaveRightRockerSpeed, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD], callback,timeout); //status |= MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH].directionthreadwize, SaveLeftRockerSpeed, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH], callback,timeout); - Trigger_Head_Actuators_Disable(); - Trigger_Head_Actuators_Control(ACTIN, LOW,false); + HeadCard_Actuators_Relocate(); + //Trigger_Head_Actuators_Disable(); + //Trigger_Head_Actuators_Control(ACTIN, LOW,false); CleaningStageCounter = 0; CleaningStage = CleaningStageIdle; Report("IDS_Cleaning_Center_And_Stop_Rockers actuator down", __FILE__, __LINE__, timeout, RpWarning, 123456, 0); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index 3a7045a6e..c912bca21 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -85,5 +85,8 @@ uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Rea void SetOriginMotorSpeed(float process_speed); +uint32_t ThreadPrepare_Tension (int DancerId, double tension); + + #endif //MODULES_THREAD_THREAD_H_ diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 2c8db8b6c..f95420725 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -236,6 +236,7 @@ //storeLoadArmParameters(); MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Hard_Stop); SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); //set this point as the spool home + MotorAbortMovetoLimitSwitch(HARDWARE_MOTOR_TYPE__MOTO_SCREW); return OK; } @@ -461,23 +462,35 @@ uint32_t Thread_Load_Close_Dancers(void) //Send Dancer Motors To Preset Location, Check That The Dancers Are On The Thread { + uint32_t current = 0; REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Close_Dancers"); CallbackCounter++; MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RDANCER], Thread_Load_HomingCallback,10000); - CallbackCounter++; - MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, 500); // MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, 500, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1], Thread_Load_HomingCallback,25000); - MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, ((int)windertension*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].microstep), Thread_Load_HomingCallback,20000); - status |= MCU_E2PromProgram(EEPROM_WINDER_TENSION_POSITION,(int)windertension); - if (Is_PP_Machine() == true) //PP machine - new LTFU + status |= MCU_E2PromRead(EEPROM_WINDER_TENSION_POSITION,¤t); + + ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension); +/* if (current!=windertension) { CallbackCounter++; - MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDANCER2, 500); - MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER2, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER2].directionthreadwize, ((int)pullertension*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER2].microstep), Thread_Load_HomingCallback,20000); - status |= MCU_E2PromProgram(EEPROM_PULLER_TENSION_POSITION,(int)pullertension); - } + MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, 500); + MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, ((int)windertension*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].microstep), Thread_Load_HomingCallback,20000); + status |= MCU_E2PromProgram(EEPROM_WINDER_TENSION_POSITION,(int)windertension); + }*/ + if (Is_PP_Machine() == true) //PP machine - new LTFU + { + ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension); + /*status |= MCU_E2PromRead(EEPROM_PULLER_TENSION_POSITION,¤t); + if (current!=pullertension) + { + CallbackCounter++; + MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDANCER2, 500); + MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER2, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER2].directionthreadwize, ((int)pullertension*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER2].microstep), Thread_Load_HomingCallback,20000); + status |= MCU_E2PromProgram(EEPROM_PULLER_TENSION_POSITION,(int)pullertension); + }*/ + } return OK; } uint32_t Thread_Load_Close_Lids(void) @@ -507,7 +520,8 @@ { Report("Thread_Load_Close_actuators",__FILE__,__LINE__,LOW,RpMessage,true,0); Trigger_Head_Actuators_Control(ACTOT, LOW,false); - Trigger_Head_Actuators_Control(ACTIN, LOW,false); + //Trigger_Head_Actuators_Control(ACTIN, LOW,false); + HeadCard_Actuators_Relocate(); } return OK; } @@ -515,6 +529,7 @@ { REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Resume_Heating"); ActivateHeadMagnet(); + HeadCard_Actuators_Relocate(); if (HandleProcessParameters(&ProcessParametersRecover,false)!= OK) { @@ -624,6 +639,7 @@ { return OK; } + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles); if (numberOfCycles MotorControlConfig[index].m_ingnoreValue) + if (fabs(calculated_speed-CurrentControlledSpeed[index])> MotorControlConfig[index].m_ingnoreValue) { CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index e1f887303..39ff91558 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -145,7 +145,7 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request) NormalizedErrorCoEfficient[Motor_i] = NormalizedErrorCoEfficient[Motor_i] / temp; // uint32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES]; temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits); - temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm*3/2); + temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm);//*3/2); DancerStopActivityLimit[Motor_i] = temp/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 40e23e0b3..de95ddb03 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -397,12 +397,6 @@ void Waste_StateMachine(void) break; } - //check door - if (DoorState == OPEN) { - Report("Close cartridge cover", __FILE__, __LINE__, DoorState, RpMessage, 0, 0); - break; - } - // select cartridge SelectedCard = cartSELECT_CART(); if (SelectedCard == MaxWasteCartridges) { @@ -413,6 +407,12 @@ void Waste_StateMachine(void) AlarmHandlingSetAlarm( EVENT_TYPE__NO_WASTE_CARTRIDGE_AVAILABLE, false); } + //check door + //moved door handling down - I want to see the alarm even if the door is open + if (DoorState == OPEN) { + Report("Close cartridge cover", __FILE__, __LINE__, DoorState, RpMessage, 0, 0); + break; + } //check RFID? (TBD) //move to next state -- cgit v1.3.1 From ccb92223657ac5a21af5aa21d309d9924d9a0fd8 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 12 Aug 2020 15:33:41 +0300 Subject: updates for the 4 winders demo --- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 6 ++ .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h | 5 ++ .../Embedded_SW/Embedded/Modules/Thread/Thread.h | 10 +++ .../Embedded/Modules/Thread/ThreadLoad.c | 12 +++- .../Embedded/Modules/Thread/Thread_Winder.c | 40 +++++++++++ .../Embedded/Modules/Thread/Thread_print.c | 77 +++++++++++++++++++++- 6 files changed, 145 insertions(+), 5 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread.h') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 1528473a1..fba22d732 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -434,6 +434,12 @@ bool FPGA_Read_limit_Switches(FPGA_GPI_ENUM Limit_Switch) case GPI_LS_LSPARE2: LM_Status = LS_Left.bits.F1_LS_LSPARE2; break; + case GPI_LS_SPARE2_2: + LM_Status = LS_Spare.bits.F3_LS_SPARE2_2; + break; + case GPI_LS_SPARE1_2: + LM_Status = LS_Spare.bits.F3_LS_SPARE1_2; + break; case I2C_HEADCARD_COVER_LS_FRONT: case I2C_HEADCARD_ARC_LS_ACTUATOR: LM_Status = !(Head_I2C_EXP4_0x46.bits.INPUT_LS_FRONT_ARC_ACT); diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h index a7999ea2e..e707a9b39 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h @@ -158,6 +158,11 @@ typedef enum GPI_EXTWINDER_Direct_BIT13, //125 GPI_EXTWINDER_Direct_BIT14, //126 GPI_EXTWINDER_Direct_BIT15, //127 + + //LS_Spare + GPI_LS_SPARE2_2, //128 + GPI_LS_SPARE1_2, //129 + //------------------------------- I2C_HEADCARD_COVER_LS_FRONT, I2C_HEADCARD_COVER_LS_REAR, diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index c912bca21..aea0dd93a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -42,6 +42,15 @@ typedef struct PID_Config_Params m_params; }MotorControlConfig_t; +#ifdef FOUR_WINDERS +#define SCREW_2_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE2_1 +#define SCREW_3_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE1_1 +#define SCREW_4_Motor HARDWARE_MOTOR_TYPE__MOTO_RDANCER +#define Winder_2_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE2_2 +#define Winder_3_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE1_2 +#define Winder_4_Motor HARDWARE_MOTOR_TYPE__MOTO_RLOADARM +#endif + #define MAX_THREAD_FEED_MOTORS (WINDER_MOTOR+1) #define MAX_SYSTEM_DANCERS (HARDWARE_DANCER_TYPE__RightDancer+1) @@ -84,6 +93,7 @@ uint32_t DancerConfigMessage(HardwareDancer * request); uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Read); void SetOriginMotorSpeed(float process_speed); +uint32_t UpdatePidDuringRun(HardwarePidControl *hardwarepidcontrol); uint32_t ThreadPrepare_Tension (int DancerId, double tension); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index c7ec8a58c..151886016 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -1344,10 +1344,16 @@ void ThreadLoadRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubHeatingTestResponse, requestContainer->token, false, &response, &stub_heating_test_response__pack, &stub_heating_test_response__get_packed_size); container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - int LoadStage = (int)request->dryerzone1temp; - LoadStages = LoadStage; - ThreadLoadStateMachine(LoadStage); + if (request->hardwarepidcontrol1!=NULL) + { + UpdatePidDuringRun(request->hardwarepidcontrol1); + } + else + { + LoadStages = LoadStage; + ThreadLoadStateMachine(LoadStage); + } /*if (status) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 420141d5b..bb838a5bd 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -200,6 +200,11 @@ uint32_t Winder_Prepare(void *JobDetails) Winder_ScrewHoming = true; //REPORT_MSG(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, "Winder_Prepare move to limit"); status = MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, ScrewSpeed, GPI_LS_SCREW_RIGHT, Winder_PrepareStage2,2000); +#ifdef FOUR_WINDERS + status = MotorMovetoLimitSwitch (SCREW_2_Motor,MotorsCfg[SCREW_2_Motor].directionthreadwize, ScrewSpeed, 5/*LS_SPARE2_2*/, NULL,2000); + status = MotorMovetoLimitSwitch (SCREW_3_Motor,MotorsCfg[SCREW_3_Motor].directionthreadwize, ScrewSpeed, 5/*LS_SPARE1_2*/, NULL,2000); + status = MotorMovetoLimitSwitch (SCREW_4_Motor,MotorsCfg[SCREW_4_Motor].directionthreadwize, ScrewSpeed, GPI_LS_RDANCER_UP, NULL,2000); +#endif } return status; } @@ -239,6 +244,11 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue) else { status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_SCREW, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize),numOfSteps, Winder_ScrewAtOffsetCallback,1000); +#ifdef FOUR_WINDERS + status |= MotorMoveWithCallback (SCREW_2_Motor,(1-MotorsCfg[SCREW_2_Motor].directionthreadwize), numOfSteps, NULL,1000); + status |= MotorMoveWithCallback (SCREW_3_Motor,(1-MotorsCfg[SCREW_3_Motor].directionthreadwize), numOfSteps, NULL,1000); + status |= MotorMoveWithCallback (SCREW_4_Motor,(1-MotorsCfg[SCREW_4_Motor].directionthreadwize), numOfSteps, NULL,1000); +#endif } //set motor location 0 here return status; @@ -250,6 +260,11 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag) //MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,temp_MaxFrequency); MotorStop (HARDWARE_MOTOR_TYPE__MOTO_SCREW,Soft_Hiz); //per L6470 errata between mov and run commands +#ifdef FOUR_WINDERS + MotorStop(SCREW_2_Motor, Hard_Hiz); + MotorStop(SCREW_3_Motor, Hard_Hiz); + MotorStop(SCREW_4_Motor, Hard_Hiz); +#endif Task_sleep(5); #ifdef READ_SCREW_ENCODER Reset_Screw_Encoder(); @@ -261,6 +276,11 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag) REPORT_MSG(ScrewLocationStart, "Winder_ScrewAtOffsetCallback Encoder Location"); #endif SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_SCREW); //set this point as the spool home +#ifdef FOUR_WINDERS + SetMotHome(SCREW_2_Motor); + SetMotHome(SCREW_3_Motor); + SetMotHome(SCREW_4_Motor); +#endif ScrewCurrentDirection = false; #ifdef READ_SCREW_ENCODER @@ -565,6 +585,11 @@ uint32_t ScrewDTSCallback(uint32_t deviceID, uint32_t BusyFlag) //MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, 1000, GPI_LS_SCREW_RIGHT, NULL,0); //MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, ScrewSpeed, GPI_LS_SCREW_RIGHT, WinderDistanceToSpoolEnded,2000); +#ifdef FOUR_WINDERS + MotorMovetoLimitSwitch (SCREW_2_Motor,MotorsCfg[SCREW_2_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE2_2, NULL,2000); + MotorMovetoLimitSwitch (SCREW_3_Motor,MotorsCfg[SCREW_3_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE1_2, NULL,2000); + MotorMovetoLimitSwitch (SCREW_4_Motor,MotorsCfg[SCREW_4_Motor].directionthreadwize, ScrewSpeed, GPI_LS_RDANCER_UP, NULL,2000); +#endif return OK; } @@ -594,6 +619,11 @@ uint32_t Winder_End(void) //MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, 1000, GPI_LS_SCREW_RIGHT, NULL,0); //MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); MotorAbortMovetoLimitSwitch(HARDWARE_MOTOR_TYPE__MOTO_SCREW); //bug #2709 +#ifdef FOUR_WINDERS + MotorAbortMovetoLimitSwitch (SCREW_2_Motor); + MotorAbortMovetoLimitSwitch (SCREW_3_Motor); + MotorAbortMovetoLimitSwitch (SCREW_4_Motor); +#endif return OK; } void Winder_ScrewHomeLimitSwitchInterrupt(void) @@ -655,7 +685,17 @@ void ScrewTimerInterrupt(int ARG0) { ROM_TimerLoadSet(Screw_timerBase, TIMER_A,(int)ScrewRunningTime); MotorSetDirection (HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewCurrentDirection); +#ifdef FOUR_WINDERS + MotorSetDirection (SCREW_2_Motor, ScrewCurrentDirection); + MotorSetDirection (SCREW_3_Motor, ScrewCurrentDirection); + MotorSetDirection (SCREW_4_Motor, ScrewCurrentDirection); +#endif MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed); +#ifdef FOUR_WINDERS + MotorSetSpeedDirect (SCREW_2_Motor, ScrewSpeed); + MotorSetSpeedDirect (SCREW_3_Motor, ScrewSpeed); + MotorSetSpeedDirect (SCREW_4_Motor, ScrewSpeed); +#endif #ifdef READ_SCREW_ENCODER Read_Screw_Encoder(); ScrewLocationRun[ScrewCurrentDirection] = Screw_RotEnc.Position; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 2bdf1b17f..849d54a67 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -728,6 +728,14 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) }*/ CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); +#ifdef FOUR_WINDERS + if (index == WINDER_MOTOR) + { + MotorSetSpeed(Winder_2_Motor, calculated_speed); + MotorSetSpeed(Winder_3_Motor, calculated_speed); + MotorSetSpeed(Winder_4_Motor, calculated_speed); + } +#endif } else { @@ -841,13 +849,14 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag) uint32_t Release_Right_TFU_Tension() { uint32_t status = OK; +#ifndef FOUR_WINDERS if (RTFU_Up == true) { Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0); RTFU_Up = false; status = MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Release_Right_TFU_TensionCallback,1000); } - +#endif return status; } int SecondFeederCorrection = 4; @@ -886,6 +895,7 @@ uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) uint32_t Adjust_Right_TFU_Tension(double tension) { uint32_t status = OK; +#ifndef FOUR_WINDERS if (tension > 0.5) //0 = lower position, 1 = high position { if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT) @@ -895,7 +905,7 @@ uint32_t Adjust_Right_TFU_Tension(double tension) Report("Adjust_Right_TFU_Tension",__FILE__,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,PrepareWaitCount,0); } } - +#endif return status; } uint32_t ThreadPrepare_TensionCallback (int MotorId, double tension) @@ -1120,6 +1130,7 @@ uint32_t ThreadPrepareState(void *JobDetails) ///////////////////////////////////////////////////// MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize); +#ifndef FOUR_WINDERS if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1132,6 +1143,7 @@ uint32_t ThreadPrepareState(void *JobDetails) LengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep); SpeedControlId = AddControlCallback(NULL,ThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } +#endif if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1145,6 +1157,7 @@ uint32_t ThreadPrepareState(void *JobDetails) PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep); PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } +#ifndef FOUR_WINDERS if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) @@ -1159,6 +1172,7 @@ uint32_t ThreadPrepareState(void *JobDetails) //AddControlCallback(NULL,ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); #endif } +#endif if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) @@ -1196,7 +1210,57 @@ uint32_t ThreadPrepareState(void *JobDetails) //set 3 dancers to the profile positions return OK; } +uint32_t UpdatePidDuringRun(HardwarePidControl *request) +{ + int Motor_i = MAX_THREAD_MOTORS_NUM,i; + double temp_dt; + for (i=0;ihardwarepidcontroltype) + { + Motor_i = i; + break; + } + } + if (Motor_i == MAX_THREAD_MOTORS_NUM) + return ERROR; + + + if (request->derivativetime == true) + { + MotorControlConfig[Motor_i].m_params.Kd = request->derivativetime; + ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Kd",__FILE__,Motor_i,(int)(request->derivativetime),RpWarning,0,0); + } + if (request->proportionalgain == true) + { + MotorControlConfig[Motor_i].m_params.Kp = request->proportionalgain; + ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Kp",__FILE__,Motor_i,(int)(request->proportionalgain),RpWarning,0,0); + } + if (request->integraltime == true) + { + MotorControlConfig[Motor_i].m_params.Ki = request->integraltime; + ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Ki",__FILE__,Motor_i,(int)(request->integraltime),RpWarning,0,0); + } + if (request->epsilon == true) + { + MotorControlConfig[Motor_i].m_params.epsilon = request->epsilon; + ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun epsilon",__FILE__,Motor_i,(int)(request->epsilon*10000),RpWarning,0,0); + } + if (request->has_controloutputtype == true) + { + MotorControlConfig[Motor_i].m_params.dt = request->controloutputtype; + temp_dt = MotorControlConfig[Motor_i].m_params.dt/0.001; + MotorTiming[Motor_i] = (int)temp_dt; + if (MotorTiming[Motor_i]) + { + MotorTimer[Motor_i] = MotorTiming[Motor_i]-1; + } + ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun dt",__FILE__,Motor_i,(int)(request->controloutputtype*1000),RpWarning,temp_dt,0); + } +////////////////////////////////////////////////// + return OK; +} void SetOriginMotorSpeed(float process_speed) { int Motor_i, HW_Motor_Id; @@ -1451,6 +1515,15 @@ char Endstr[150]; for ( Motor_i = 0;Motor_i <= WINDER_MOTOR;Motor_i++) { MotorStop(ThreadMotorIdToMotorId[Motor_i],Hard_Hiz); +#ifdef FOUR_WINDERS + if (Motor_i == WINDER_MOTOR) + { + MotorStop(Winder_2_Motor, Hard_Hiz); + MotorStop(Winder_3_Motor, Hard_Hiz); + MotorStop(Winder_4_Motor, Hard_Hiz); + } +#endif + } MotorStop(HARDWARE_MOTOR_TYPE__MOTO_RLOADING,Hard_Hiz); MotorStop(HARDWARE_MOTOR_TYPE__MOTO_LLOADING,Hard_Hiz); -- cgit v1.3.1 From ce95311e3ca782c405591d12da7cf4366c8dcfb2 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 26 Aug 2020 11:04:13 +0300 Subject: Add support of WHS fan controller with slave address 0x5E . Add option to read 2 more dancers for 4 winders demo --- Software/Embedded_SW/Embedded/DataDef.h | 2 + .../Embedded/Drivers/FPGA/FPGA_SSI_Comm.c | 15 ++++ .../Embedded/Drivers/FPGA/FPGA_SSI_Comm.h | 7 ++ .../WHS_Card/D_EMC2302_Fan/WHS_Fan.c | 94 +++++++++++++++------ .../WHS_Card/D_EMC2302_Fan/WHS_Fan.h | 4 +- .../Drivers/I2C_Communication/WHS_Card/WHS_data.h | 4 +- .../Embedded/Drivers/SSI_Comm/Dancer/Dancer.c | 22 +++++ .../Embedded/Drivers/SSI_Comm/SSI_Comm.h | 18 +++- .../Embedded/Modules/Stubs_Handler/Progress.c | 4 +- .../Embedded/Modules/Stubs_Handler/Stub_Dancer.c | 4 + .../Embedded_SW/Embedded/Modules/Thread/Thread.h | 7 ++ .../Embedded/Modules/Thread/Thread_print.c | 6 ++ .../Initialization/PowerOffSequence.c | 1 + Software/Embedded_SW/Embedded/debug_w_pmr/makefile | 87 +++++++------------ .../Embedded_SW/Embedded/debug_w_pmr/sources.mk | 7 -- .../Embedded/debug_w_pmr/subdir_rules.mk | 21 ++--- .../Embedded/debug_w_pmr/subdir_vars.mk | 18 ++-- Software/Embedded_SW/Embedded/src/makefile.libs | 4 +- Software/Embedded_SW/Embedded/src/sysbios/makefile | 8 +- .../Embedded_SW/Embedded/src/sysbios/sysbios.aem4f | Bin 1998354 -> 2002098 bytes 20 files changed, 205 insertions(+), 128 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread.h') diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 2b104a521..cf917c846 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -23,7 +23,9 @@ #define WATCHDOG //#define DISPESER_TEST //#define FPGA_WATCHDOG_DISABLE + //#define FOUR_WINDERS + //#define USE_POWERSTEP01 -NA //#define EMC_FORCE_MOT_CLOCK_INTERNAL diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c index 96598ef31..782949fd0 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c @@ -14,6 +14,8 @@ #include "PMR/Hardware/HardwareDancerType.pb-c.h" +static short DummyBusy = 0; + static FpgaDancerMap_t FpgaRotEncMap[NUM_OF_ROTENC] = { @@ -22,10 +24,19 @@ static FpgaDancerMap_t FpgaRotEncMap[NUM_OF_ROTENC] = {&F1_RDANCER_ROTENC_DATA_p_TX , &F1_RDANCER_ROTENC_DATA_p_RX_msb , &F1_RDANCER_ROTENC_DATA_p_RX_lsb ,&F1_SPI_Busy1_D}, // {&F1_LSPARE_ROTENC_DATA_p_TX , &F1_LSPARE_ROTENC_DATA_p_RX_msb , &F1_LSPARE_ROTENC_DATA_p_RX_lsb ,&F1_SPI_Busy1_D},//Dryer_ENC // {&F1_RSPARE_ROTENC_DATA_p_TX , &F1_RSPARE_ROTENC_DATA_p_RX_msb , &F1_RSPARE_ROTENC_DATA_p_RX_lsb ,&F1_SPI_Busy1_D}, +#ifdef FOUR_WINDERS + {&F2_DISPENSER_ROTENC_DATA_p_6_TX , &F2_DISPENSER_ROTENC_DATA_p_6_RX_msb , &F2_DISPENSER_ROTENC_DATA_p_6_RX_lsb ,&DummyBusy},//We don't have Busy bit in FPGA & It is not in use + {&F3_SPARE2_ROTENC_DATA_p_2_TX , &F3_SPARE2_ROTENC_DATA_p_2_RX_msb , &F3_SPARE2_ROTENC_DATA_p_2_RX_lsb ,&DummyBusy},//We don't have Busy bit in FPGA & It is not in use +#endif + }; +#ifdef FOUR_WINDERS +uint8_t FPGA_SSI_Transmit(Dancers_4_Winders _RotEncId) +#else uint8_t FPGA_SSI_Transmit(HardwareDancerType _RotEncId) +#endif { //if(*FpgaRotEncMap[_RotEncId].SSI_Busy == NOTBUSY) { @@ -36,7 +47,11 @@ uint8_t FPGA_SSI_Transmit(HardwareDancerType _RotEncId) return OK; } +#ifdef FOUR_WINDERS +uint8_t FPGA_SSI_Receive(Dancers_4_Winders _RotEncId) +#else uint8_t FPGA_SSI_Receive(HardwareDancerType _RotEncId) +#endif { INT2SHORT Int2Short; unsigned int temp; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.h index cec4c4de3..d51576778 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.h @@ -51,9 +51,16 @@ typedef struct } FpgaDancerMap_t; + + +#ifdef FOUR_WINDERS +uint8_t FPGA_SSI_Transmit(Dancers_4_Winders _RotEncId); +uint8_t FPGA_SSI_Receive(Dancers_4_Winders _RotEncId); +#else uint8_t FPGA_SSI_Transmit(HardwareDancerType _RotEncId); uint8_t FPGA_SSI_Receive(HardwareDancerType _RotEncId); +#endif uint8_t FPGA_SSI_Speed_Sensor_Transnit(); diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c index 7c854fe8b..6cb64262c 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c @@ -12,7 +12,7 @@ #include #include -FAN_DRIVER_INFO Fan_Driver_Info[maxFAN-1]; +FAN_DRIVER_INFO Fan_Driver_Info[maxFAN]; #define NUM_OF_FAN_DRIVER 3 @@ -24,6 +24,8 @@ uint8_t Fan_Mux_Channel = UNKNOWN; bool Select_WHS_Fan_Mux_Channel(WHS_fan_num fan_number); uint8_t Select_Fan_Driver(WHS_fan_num fan_number); +uint8_t I2CFanViaSwitch_ADD_Buf[maxFAN] = {UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN}; + uint8_t SmallFansCfg = 200; uint8_t LargeFansCfg = 200; /* @@ -60,8 +62,8 @@ uint8_t Select_Fan_Driver(WHS_fan_num fan_number) case FAN6: fan_driver = 2; break; - //default: - + default: + break; } return fan_driver; } @@ -113,8 +115,8 @@ bool WHS_set_fan_speed(WHS_fan_num fan_number, uint8_t fan_speed) fan_driver = Select_Fan_Driver(fan_number); status = Select_Main_WHS_Mux_Channel(); Select_WHS_Fan_Mux_Channel(fan_number); - status |= D_Fan_Setting(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADDRESS, !(fan_number & 0x01), fan_speed); - D_EMC2302_Write[fan_driver].Reg.Fan_Setting[!(fan_number & 0x01)] = fan_speed; + status |= D_Fan_Setting(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADD_Buf[fan_number], (fan_number & 0x01), fan_speed); + D_EMC2302_Write[fan_driver].Reg.Fan_Setting[(fan_number & 0x01)] = fan_speed; return status; } @@ -128,8 +130,8 @@ bool WHS_Read_fan_tach(WHS_fan_num fan_number) status = Select_Main_WHS_Mux_Channel(); Select_WHS_Fan_Mux_Channel(fan_number); - status |= D_Fan_Read_Tacho_HIGH(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADDRESS, !(fan_number & 0x01), &(D_EMC2302_Read[fan_driver].Reg.TACHReading_High[!(fan_number & 0x01)])); - status |= D_Fan_Read_Tacho_LOW (I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADDRESS, !(fan_number & 0x01), &(D_EMC2302_Read[fan_driver].Reg.TACHReading_Low [!(fan_number & 0x01)])); + status |= D_Fan_Read_Tacho_HIGH(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADD_Buf[fan_number], (fan_number & 0x01), &(D_EMC2302_Read[fan_driver].Reg.TACHReading_High[(fan_number & 0x01)])); + status |= D_Fan_Read_Tacho_LOW (I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADD_Buf[fan_number], (fan_number & 0x01), &(D_EMC2302_Read[fan_driver].Reg.TACHReading_Low [(fan_number & 0x01)])); return status; } @@ -140,8 +142,8 @@ uint16_t WHS_Get_fan_tach(WHS_fan_num fan_number) uint8_t fan_driver = 0; fan_driver = Select_Fan_Driver(fan_number); - tach = D_EMC2302_Read[fan_driver].Reg.TACHReading_High[!(fan_number & 0x01)]; - tach = ((tach << 8) | D_EMC2302_Read[fan_driver].Reg.TACHReading_Low[!(fan_number & 0x01)]); + tach = D_EMC2302_Read[fan_driver].Reg.TACHReading_High[(fan_number & 0x01)]; + tach = ((tach << 8) | D_EMC2302_Read[fan_driver].Reg.TACHReading_Low[(fan_number & 0x01)]); return tach; } @@ -170,22 +172,23 @@ bool WHS_Get_fan_ALERT(WHS_fan_num fan_number, bool *fan_alert) switch (fan_number) { - case 0: - fan_number_bit = FAN_BREAK; - break; - case 1: - case 2: +// case noFAN: +// fan_number_bit = FAN_BREAK; +// break; + case FAN1: + case FAN2: fan_number_bit = FAN_ALERT_12; break; - case 3: - case 4: + case FAN3: + case FAN4: fan_number_bit = FAN_ALERT_34; break; - case 5: - case 6: + case FAN5: + case FAN6: fan_number_bit = FAN_ALERT_56; break; default : + fan_number_bit = FAN_BREAK; status = ERROR; return status; } @@ -193,6 +196,38 @@ bool WHS_Get_fan_ALERT(WHS_fan_num fan_number, bool *fan_alert) return status; } +bool Fan_Status[] = {OK,OK,OK,OK,OK,OK}; + +uint8_t WHS_Check_Fan_Controller_Type(WHS_fan_num fan_number) +{ + uint8_t status = ERROR; + + if ( (I2CFanViaSwitch_ADD_Buf[fan_number] == UNKNOWN) && (( fan_number == FAN1) || ( fan_number == FAN3) || ( fan_number == FAN5))) + { + + I2CFanViaSwitch_ADD_Buf[fan_number] = 0x5C; + status = D_fan_productID (I2C_ID_WHS_CARD, I2CFanViaSwitch_ADD_Buf[fan_number], &(Fan_Driver_Info[fan_number].Product_ID) ); + + if((Fan_Driver_Info[fan_number].Product_ID != 0x36) || (status != OK)) + { + I2CFanViaSwitch_ADD_Buf[fan_number] = 0x5E; + status = D_fan_productID (I2C_ID_WHS_CARD, I2CFanViaSwitch_ADD_Buf[fan_number], &(Fan_Driver_Info[fan_number].Product_ID) ); + } + + if((Fan_Driver_Info[fan_number].Product_ID != 0x36) || (status != OK)) + { + I2CFanViaSwitch_ADD_Buf[fan_number] = 0x00; + ReportWithPackageFilter(WasteFilter,"unable to recognize the an controller", __FILE__,__LINE__, status, RpMessage, fan_number, 0); + status = ERROR; + } + + I2CFanViaSwitch_ADD_Buf[fan_number + 1] = I2CFanViaSwitch_ADD_Buf[fan_number]; + Fan_Driver_Info[fan_number + 1].Product_ID = Fan_Driver_Info[fan_number].Product_ID; + + } + return status; +} + bool init_WHS_fan() { @@ -246,11 +281,17 @@ bool init_WHS_fan() update = 0; } + + for (fan_number = FAN1 ; fan_number < maxFAN; fan_number++) { Select_WHS_Fan_Mux_Channel(fan_number); - status |= D_Fan_PWM_Output_Config(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADDRESS, !(fan_number & 0x01), PUSH_PULL ); - status |= D_Fan_Setting(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADDRESS, !(fan_number & 0x01), DEFAULT_FAN_SPEED);//FAN_SPEED_OFF + + Fan_Status[fan_number] = WHS_Check_Fan_Controller_Type(fan_number); + status |= Fan_Status[fan_number]; + + status |= D_Fan_PWM_Output_Config(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADD_Buf[fan_number], (fan_number & 0x01), PUSH_PULL ); + status |= D_Fan_Setting(I2C_ID_WHS_CARD ,I2CFanViaSwitch_ADD_Buf[fan_number], (fan_number & 0x01), DEFAULT_FAN_SPEED);//FAN_SPEED_OFF } @@ -266,9 +307,9 @@ bool Read_WHS_fan_info(WHS_fan_num fan_number) Select_Main_WHS_Mux_Channel(); Select_WHS_Fan_Mux_Channel(fan_number); - status |= D_fan_productID (I2C_ID_WHS_CARD, I2CFanViaSwitch_ADDRESS, &(Fan_Driver_Info[fan_number-1].Product_ID) ); - status |= D_fan_manufactuerID(I2C_ID_WHS_CARD, I2CFanViaSwitch_ADDRESS, &(Fan_Driver_Info[fan_number-1].Manufactuere_ID)); - status |= D_fan_revision (I2C_ID_WHS_CARD, I2CFanViaSwitch_ADDRESS, &(Fan_Driver_Info[fan_number-1].Revision) ); + status |= D_fan_productID (I2C_ID_WHS_CARD, I2CFanViaSwitch_ADD_Buf[fan_number], &(Fan_Driver_Info[fan_number].Product_ID) ); + status |= D_fan_manufactuerID(I2C_ID_WHS_CARD, I2CFanViaSwitch_ADD_Buf[fan_number], &(Fan_Driver_Info[fan_number].Manufactuere_ID)); + status |= D_fan_revision (I2C_ID_WHS_CARD, I2CFanViaSwitch_ADD_Buf[fan_number], &(Fan_Driver_Info[fan_number].Revision) ); return status; } @@ -325,15 +366,15 @@ bool Test_WHS_Fan() { status = Read_WHS_fan_info(fan_number); - if (Fan_Driver_Info[fan_number-1].Manufactuere_ID != 0x5D) + if (Fan_Driver_Info[fan_number].Manufactuere_ID != 0x5D) { status|= ERROR; } - if (Fan_Driver_Info[fan_number-1].Product_ID != 0x36) + if (Fan_Driver_Info[fan_number].Product_ID != 0x36) { status|= ERROR; } - if (Fan_Driver_Info[fan_number-1].Revision != 0x80) + if (Fan_Driver_Info[fan_number].Revision != 0x80) { status|= ERROR; } @@ -363,3 +404,4 @@ bool Test_WHS_Fan() return status; } + diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.h index c8a81a612..a15248866 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.h @@ -48,7 +48,7 @@ typedef struct #define number_of_EMC2302 3 typedef enum { - noFAN = 0, + //noFAN = 0, FAN1 , FAN2 , FAN3 , @@ -58,6 +58,8 @@ typedef enum maxFAN }WHS_fan_num; +extern uint8_t I2CFanViaSwitch_ADD_Buf[maxFAN]; + typedef enum { FAN1chanel = 0, diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/WHS_data.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/WHS_data.h index 3d6bbc462..e0745ea35 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/WHS_data.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/WHS_data.h @@ -15,12 +15,14 @@ #define I2C_ID_WHS_CARD 0x03 #define I2C2_MAIN_MUX_TCA9548A_0xE0 0xE0 //WHS - SD1, SC1 + + typedef enum { I2CExp1_ADDRESS = 0x40, I2CExp2_ADDRESS = 0x42, I2CSwitch_ADDRESS = 0xE8, - I2CFanViaSwitch_ADDRESS = 0x5C, + //I2CFanViaSwitch_ADDRESS = 0x5C, I2CTemp1_ADDRESS = 0x80, I2CTemp2_ADDRESS = 0x82, I2CDAC_ADDRESS = 0x30, diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c index ae814a8cb..00ef10032 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c +++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c @@ -43,13 +43,22 @@ typedef struct // 24bit SSI_ENC SSI_enc; #ifndef HUNDRED_MICROSECONDS_DANCER_READ +#ifdef FOUR_WINDERS +uint32_t Control_Read_Dancer_Position(Dancers_4_Winders DancerId, uint32_t Parameter1) +#else uint32_t Control_Read_Dancer_Position(HardwareDancerType DancerId, uint32_t Parameter1) +#endif { return DANCER_ENC[DancerId].Position; //return SSI_enc.Position; } #endif + +#ifdef FOUR_WINDERS +uint32_t Read_Dancer_Position (Dancers_4_Winders DancerId) +#else uint32_t Read_Dancer_Position (HardwareDancerType DancerId) +#endif { #ifdef EVALUATION_BOARD uint32_t ENC_SSI_Data = 0; @@ -71,7 +80,11 @@ uint32_t Read_Dancer_Position (HardwareDancerType DancerId) return SSI_enc.Position; #else // must call FPGA_SSI_Transmit first! + #ifdef FOUR_WINDERS + Dancers_4_Winders Dancer_Id = (Dancers_4_Winders)DancerId;//to remove warning + #else HardwareDancerType Dancer_Id = (HardwareDancerType)DancerId;//to remove warning + #endif FPGA_SSI_Receive(Dancer_Id); FPGA_SSI_Transmit(Dancer_Id); return DANCER_ENC[Dancer_Id].Position; @@ -86,11 +99,20 @@ uint32_t Read_Dryer_ENC_Position () //REPORT_MSG(Dryer_ENC.Position,"Read_Dryer_ENC_Position"); return Dryer_ENC.Position; } +#ifdef FOUR_WINDERS +uint32_t Read_Dryer_Status(Dancers_4_Winders DancerId) +#else uint32_t Read_Dryer_Status(HardwareDancerType DancerId) +#endif { return Dryer_ENC.Gen_status; } +#ifdef FOUR_WINDERS +uint32_t Control_Read_Dryer_Position(Dancers_4_Winders DancerId, uint32_t Parameter1) +#else uint32_t Control_Read_Dryer_Position(HardwareDancerType DancerId, uint32_t Parameter1) +#endif + { return Dryer_ENC.Position; //return SSI_enc.Position; diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h index 3a1c3ad5b..f726baeb4 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h @@ -23,7 +23,23 @@ NUM_OF_ROTENC }RotEnc_t;*/ -#define NUM_OF_ROTENC (HARDWARE_DANCER_TYPE__RightDancer+1) +#ifdef FOUR_WINDERS + + typedef enum Dancers4Winders + { + HARDWARE_DANCER_0 = 0, + HARDWARE_DANCER_1 = 1, + HARDWARE_DANCER_2 = 2, + HARDWARE_DANCER_3 = 3, + HARDWARE_DANCER_4 = 4, + MAX_HARDWARE_DANCER + } Dancers_4_Winders; + + #define NUM_OF_ROTENC (MAX_HARDWARE_DANCER) +#else + #define NUM_OF_ROTENC (HARDWARE_DANCER_TYPE__RightDancer+1) +#endif + void SSI1_Init(); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 89399cbe1..853f6913a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -833,9 +833,9 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) if (WHS_Type == WHS_TYPE_NEW) { - Trigger_SetWHSFanSpeed(((request->amount & 0x0000000F)-1) , request->delay & 0x000000FF); + Trigger_SetWHSFanSpeed(((request->amount & 0x0000000F)-2) , request->delay & 0x000000FF); Task_sleep(2000); - fan_tacho = WHS_Get_fan_tach( (request->amount & 0x0000000F)-1); + fan_tacho = WHS_Get_fan_tach( (request->amount & 0x0000000F)-2); } response.progress = fan_tacho; response.has_progress = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c index 213902038..3d2db071e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c @@ -52,7 +52,11 @@ void Stub_DancerPositionRequest(MessageContainer* requestContainer) response.dancer_id = request->dancer_id; response.has_dancer_id = true; + #ifdef FOUR_WINDERS + Dancers_4_Winders Dancer_Id = (Dancers_4_Winders)request->dancer_id;//to remove warning + #else HardwareDancerType Dancer_Id = (HardwareDancerType)request->dancer_id;//to remove warning + #endif if(Dancer_Id < NUM_OF_ROTENC) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index aea0dd93a..1f2da8dc0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -17,6 +17,7 @@ #include "../control/pidalgo.h" #include "thread_ex.h" +#include "drivers/SSI_Comm/SSI_Comm.h" #define NORMAL_COEF_DIVIDER 100 typedef struct @@ -56,7 +57,13 @@ typedef struct #define MAX_SYSTEM_DANCERS (HARDWARE_DANCER_TYPE__RightDancer+1) extern TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM]; + +#ifdef FOUR_WINDERS +extern Dancers_4_Winders ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM]; +#else extern HardwareDancerType ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM]; +#endif + extern HardwarePidControlType ThreadMotorIdToControlId[MAX_THREAD_MOTORS_NUM]; extern bool BreakSensorenabled; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 3f13365c2..72f369b64 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -37,6 +37,8 @@ #include "Control/MillisecTask.h" #include "drivers/Flash_ram/MCU_E2Prom.h" +#include "drivers/SSI_Comm/SSI_Comm.h" + ////////////////////////////////State machine operation//////////////////////////////////// //the state machine operation is used to operate in runtime correct profile flow execution //by recieved esign flow of the user from the UI @@ -45,7 +47,11 @@ double CurrentControlledSpeed[MAX_THREAD_MOTORS_NUM] = {0}; TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,HARDWARE_MOTOR_TYPE__MOTO_WINDER,HARDWARE_MOTOR_TYPE__MOTO_SCREW}; +#ifdef FOUR_WINDERS +Dancers_4_Winders ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {FEEDER_DANCER,NUM_OF_DANCERS,POOLER_DANCER,WINDER_DANCER,NUM_OF_DANCERS}; +#else HardwareDancerType ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {FEEDER_DANCER,NUM_OF_DANCERS,POOLER_DANCER,WINDER_DANCER,NUM_OF_DANCERS}; +#endif uint32_t ControlIdtoMotorId [MAX_THREAD_MOTORS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF}; uint32_t SpeedControlId=0xFF; uint32_t PoolerSpeedControlId=0xFF; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 04cc389ef..88fdff1b2 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -41,6 +41,7 @@ #include "PowerIdle.h" #include "InitSequence.h" #include "PowerOffSequence.h" +#include "modules/waste/waste_ex.h" /* typedef enum { diff --git a/Software/Embedded_SW/Embedded/debug_w_pmr/makefile b/Software/Embedded_SW/Embedded/debug_w_pmr/makefile index 911c345fc..4fec7571c 100644 --- a/Software/Embedded_SW/Embedded/debug_w_pmr/makefile +++ b/Software/Embedded_SW/Embedded/debug_w_pmr/makefile @@ -4,14 +4,13 @@ SHELL = cmd.exe -CG_TOOL_ROOT := C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS +CG_TOOL_ROOT := C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS GEN_OPTS__FLAG := --cmd_file="configPkg/compiler.opt" GEN_CMDS__FLAG := -l"configPkg/linker.cmd" ORDERED_OBJS += \ "./Main.obj" \ -"./delay.obj" \ "./Common/CheckSum/Checksum.obj" \ "./Common/SWUpdate/FileSystem.obj" \ "./Common/SWUpdate/FirmwareUpgrade.obj" \ @@ -23,6 +22,7 @@ ORDERED_OBJS += \ "./Common/Utilities/RFIDTagHandling.obj" \ "./Common/Utilities/Update.obj" \ "./Common/Utilities/Utils.obj" \ +"./Common/Utilities/delay.obj" \ "./Common/Utilities/idle_task.obj" \ "./Common/Utilities/ustdlib.obj" \ "./Common/protobuf-c/protobuf-c.obj" \ @@ -386,7 +386,6 @@ ORDERED_OBJS += \ "./Drivers/I2C_Communication/Dispenser_Card/I2C_Dispenser_Card_Mux.obj" \ "./Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.obj" \ "./Drivers/I2C_Communication/Head_Card/ADC/Head_ADC.obj" \ -"./Drivers/I2C_Communication/Head_Card/ADC/Head_ADC_old.obj" \ "./Drivers/I2C_Communication/Head_Card/EEPROM/Head_EEPROM.obj" \ "./Drivers/I2C_Communication/Head_Card/Fan/Head_Fan.obj" \ "./Drivers/I2C_Communication/Head_Card/Fan/fan_click.obj" \ @@ -399,12 +398,12 @@ ORDERED_OBJS += \ "./Drivers/I2C_Communication/I2C_FIFO.obj" \ "./Drivers/I2C_Communication/I2C_Task.obj" \ "./Drivers/I2C_Communication/ektm4c129_i2c_master_udma_fifo.obj" \ +"./Drivers/I2C_Communication/test_fifo_dma.obj" \ "./Drivers/I2C_Communication/Main_Board_EEPROM/Main_EEPROM.obj" \ +"./Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.obj" \ "./Drivers/I2C_Communication/RFID_NFC/NFC.obj" \ "./Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.obj" \ -"./Drivers/I2C_Communication/RFID_NFC/NFC_I2C/NFC_I2C.obj" \ -"./Drivers/I2C_Communication/RFID_NFC/NFC_I2C/Test_NFC.obj" \ -"./Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.obj" \ +"./Drivers/I2C_Communication/RFID_NFC/Test_RFID.obj" \ "./Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_NFC.obj" \ "./Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.obj" \ "./Drivers/I2C_Communication/Thermo_K/MCP9600.obj" \ @@ -434,18 +433,6 @@ ORDERED_OBJS += \ "./Drivers/SSI_Comm/Speed_Sensor/Speed_Sensor.obj" \ "./Drivers/USB_Communication/USBCDCD.obj" \ "./Drivers/Uart_Comm/Uart.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/ascii/mbascii.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbfunccoils.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbfuncdiag.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbfuncdisc.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbfuncholding.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbfuncinput.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbfuncother.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/mbutils.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/mb.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/rtu/mbcrc.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/rtu/mbrtu.obj" \ -"./Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/tcp/mbtcp.obj" \ "./Drivers/Uart_Comm/WHS_Controller_Comm/Shinko/ACS-13AC5E3.obj" \ "./Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.obj" \ "./Drivers/Valves/Valve.obj" \ @@ -513,7 +500,6 @@ ORDERED_OBJS += \ "./Modules/Waste/Waste_BIT.obj" \ "./Modules/Waste/Waste_init.obj" \ "./Modules/Waste/Waste_maint.obj" \ -"./Modules/Waste/Waste_print.obj" \ "./Modules/Waste/newWHS_init.obj" \ "./StateMachines/Initialization/InitSequence.obj" \ "./StateMachines/Initialization/PowerIdle.obj" \ @@ -582,8 +568,6 @@ RMDIR := RMDIR /S/Q -include Drivers/I2C_Communication/subdir_vars.mk -include Drivers/I2C_Communication/Main_Board_EEPROM/subdir_vars.mk -include Drivers/I2C_Communication/RFID_NFC/subdir_vars.mk --include Drivers/I2C_Communication/RFID_NFC/NFC_I2C/subdir_vars.mk --include Drivers/I2C_Communication/RFID_NFC/PN7150/subdir_vars.mk -include Drivers/I2C_Communication/RFID_NFC/logi-tag/subdir_vars.mk -include Drivers/I2C_Communication/Thermo_K/subdir_vars.mk -include Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/subdir_vars.mk @@ -603,11 +587,6 @@ RMDIR := RMDIR /S/Q -include Drivers/SSI_Comm/Speed_Sensor/subdir_vars.mk -include Drivers/USB_Communication/subdir_vars.mk -include Drivers/Uart_Comm/subdir_vars.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/ascii/subdir_vars.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/subdir_vars.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/subdir_vars.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/rtu/subdir_vars.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/tcp/subdir_vars.mk -include Drivers/Uart_Comm/WHS_Controller_Comm/Shinko/subdir_vars.mk -include Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/subdir_vars.mk -include Drivers/Valves/subdir_vars.mk @@ -672,8 +651,6 @@ RMDIR := RMDIR /S/Q -include Drivers/I2C_Communication/subdir_rules.mk -include Drivers/I2C_Communication/Main_Board_EEPROM/subdir_rules.mk -include Drivers/I2C_Communication/RFID_NFC/subdir_rules.mk --include Drivers/I2C_Communication/RFID_NFC/NFC_I2C/subdir_rules.mk --include Drivers/I2C_Communication/RFID_NFC/PN7150/subdir_rules.mk -include Drivers/I2C_Communication/RFID_NFC/logi-tag/subdir_rules.mk -include Drivers/I2C_Communication/Thermo_K/subdir_rules.mk -include Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/subdir_rules.mk @@ -693,11 +670,6 @@ RMDIR := RMDIR /S/Q -include Drivers/SSI_Comm/Speed_Sensor/subdir_rules.mk -include Drivers/USB_Communication/subdir_rules.mk -include Drivers/Uart_Comm/subdir_rules.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/ascii/subdir_rules.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions/subdir_rules.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/subdir_rules.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/rtu/subdir_rules.mk --include Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/tcp/subdir_rules.mk -include Drivers/Uart_Comm/WHS_Controller_Comm/Shinko/subdir_rules.mk -include Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/subdir_rules.mk -include Drivers/Valves/subdir_rules.mk @@ -832,20 +804,21 @@ main-build: Embedded.out # Tool invocations Embedded.out: $(OBJS) $(CMD_SRCS) $(GEN_CMDS) - @echo 'Building target: $@' + @echo 'Building target: "$@"' @echo 'Invoking: ARM Linker' - @echo 'Flags: -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi -z -m"Embedded.map" --heap_size=20480 --stack_size=4095 -i"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/lib" -i"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Embedded_linkInfo.xml" --rom_model' - $(shell echo -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi -z -m"Embedded.map" --heap_size=20480 --stack_size=4095 -i"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/lib" -i"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Embedded_linkInfo.xml" --rom_model > "ccsLinker.opt") + @echo 'Flags: -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi -z -m"Embedded.map" --heap_size=20480 --stack_size=4095 -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/lib" -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Embedded_linkInfo.xml" --rom_model' + $(shell echo -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi -z -m"Embedded.map" --heap_size=20480 --stack_size=4095 -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/lib" -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Embedded_linkInfo.xml" --rom_model > "ccsLinker.opt") $(shell type "ccsObjs.opt" >> "ccsLinker.opt") - "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl" -@"ccsLinker.opt" -o "Embedded.out" - @echo 'Finished building target: $@' + "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armcl" -@"ccsLinker.opt" -o "Embedded.out" + @echo 'Finished building target: "$@"' @echo ' ' @$(MAKE) --no-print-directory post-build Embedded.bin: $(EXE_OUTPUTS) + @echo 'Building files: $(strip $(EXE_OUTPUTS__QUOTED))' @echo 'Invoking: ARM Hex Utility' - "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armhex" -o "Embedded.bin" $(EXE_OUTPUTS__QUOTED) - @echo 'Finished building: $@' + "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armhex" -o "Embedded.bin" $(EXE_OUTPUTS__QUOTED) + @echo 'Finished building: $(strip $(EXE_OUTPUTS__QUOTED))' @echo ' ' @$(MAKE) --no-print-directory post-build @@ -853,7 +826,7 @@ Embedded.bin: $(EXE_OUTPUTS) clean: -$(RM) $(GEN_CMDS__QUOTED)$(GEN_MISC_FILES__QUOTED)$(BIN_OUTPUTS__QUOTED)$(GEN_FILES__QUOTED)$(EXE_OUTPUTS__QUOTED)$(GEN_OPTS__QUOTED) -$(RMDIR) $(GEN_MISC_DIRS__QUOTED) - -$(RM) "Main.obj" "delay.obj" "Common\CheckSum\Checksum.obj" "Common\SWUpdate\FileSystem.obj" "Common\SWUpdate\FirmwareUpgrade.obj" "Common\SW_Info\SW_Info.obj" "Common\Software_CRC\sw_crc.obj" "Common\Sys_PinOut_Config\MCU_MAIN_pinout.obj" "Common\Sys_PinOut_Config\Pin.obj" "Common\Sys_PinOut_Config\Pin_config.obj" "Common\Utilities\RFIDTagHandling.obj" "Common\Utilities\Update.obj" "Common\Utilities\Utils.obj" "Common\Utilities\idle_task.obj" "Common\Utilities\ustdlib.obj" "Common\protobuf-c\protobuf-c.obj" "Common\report\distributor.obj" "Common\report\filter.obj" "Common\report\reportInit.obj" "Communication\CommunicationTask.obj" "Communication\Connection.obj" "Communication\Container.obj" "Communication\PMR\Common\ErrorCode.pb-c.obj" "Communication\PMR\Common\ErrorResponse.pb-c.obj" "Communication\PMR\Common\MessageContainer.pb-c.obj" "Communication\PMR\Common\MessageType.pb-c.obj" "Communication\PMR\Connection\ConnectRequest.pb-c.obj" "Communication\PMR\Connection\ConnectResponse.pb-c.obj" + -$(RM) "Main.obj" "Common\CheckSum\Checksum.obj" "Common\SWUpdate\FileSystem.obj" "Common\SWUpdate\FirmwareUpgrade.obj" "Common\SW_Info\SW_Info.obj" "Common\Software_CRC\sw_crc.obj" "Common\Sys_PinOut_Config\MCU_MAIN_pinout.obj" "Common\Sys_PinOut_Config\Pin.obj" "Common\Sys_PinOut_Config\Pin_config.obj" "Common\Utilities\RFIDTagHandling.obj" "Common\Utilities\Update.obj" "Common\Utilities\Utils.obj" "Common\Utilities\delay.obj" "Common\Utilities\idle_task.obj" "Common\Utilities\ustdlib.obj" "Common\protobuf-c\protobuf-c.obj" "Common\report\distributor.obj" "Common\report\filter.obj" "Common\report\reportInit.obj" "Communication\CommunicationTask.obj" "Communication\Connection.obj" "Communication\Container.obj" "Communication\PMR\Common\ErrorCode.pb-c.obj" "Communication\PMR\Common\ErrorResponse.pb-c.obj" "Communication\PMR\Common\MessageContainer.pb-c.obj" "Communication\PMR\Common\MessageType.pb-c.obj" "Communication\PMR\Connection\ConnectRequest.pb-c.obj" "Communication\PMR\Connection\ConnectResponse.pb-c.obj" -$(RM) "Communication\PMR\Connection\DeviceInformation.pb-c.obj" "Communication\PMR\Connection\DisconnectRequest.pb-c.obj" "Communication\PMR\Connection\DisconnectResponse.pb-c.obj" "Communication\PMR\Connection\KeepAliveRequest.pb-c.obj" "Communication\PMR\Connection\KeepAliveResponse.pb-c.obj" "Communication\PMR\Debugging\DebugDistributor.pb-c.obj" "Communication\PMR\Debugging\DebugDistributorType.pb-c.obj" "Communication\PMR\Debugging\DebugLogCategory.pb-c.obj" "Communication\PMR\Debugging\SetDebugLogCategoryRequest.pb-c.obj" "Communication\PMR\Debugging\SetDebugLogCategoryResponse.pb-c.obj" "Communication\PMR\Debugging\SetupDebugDisributorsRequest.pb-c.obj" "Communication\PMR\Debugging\SetupDebugDisributorsResponse.pb-c.obj" "Communication\PMR\Debugging\StartDebugLogRequest.pb-c.obj" "Communication\PMR\Debugging\StartDebugLogResponse.pb-c.obj" "Communication\PMR\Debugging\StopDebugLogRequest.pb-c.obj" "Communication\PMR\Debugging\StopDebugLogResponse.pb-c.obj" "Communication\PMR\Diagnostics\Cartridge.pb-c.obj" -$(RM) "Communication\PMR\Diagnostics\CartridgeAction.pb-c.obj" "Communication\PMR\Diagnostics\CartridgeSlot.pb-c.obj" "Communication\PMR\Diagnostics\CartridgeTagContent.pb-c.obj" "Communication\PMR\Diagnostics\CartridgeValidationRequest.pb-c.obj" "Communication\PMR\Diagnostics\CartridgeValidationResponse.pb-c.obj" "Communication\PMR\Diagnostics\DataFileFrame.pb-c.obj" "Communication\PMR\Diagnostics\DiagnosticsMonitors.pb-c.obj" "Communication\PMR\Diagnostics\DigitalInterfaceState.pb-c.obj" "Communication\PMR\Diagnostics\DispenserAbortHomingRequest.pb-c.obj" "Communication\PMR\Diagnostics\DispenserAbortHomingResponse.pb-c.obj" "Communication\PMR\Diagnostics\DispenserAbortJoggingRequest.pb-c.obj" "Communication\PMR\Diagnostics\DispenserAbortJoggingResponse.pb-c.obj" "Communication\PMR\Diagnostics\DispenserHomingRequest.pb-c.obj" "Communication\PMR\Diagnostics\DispenserHomingResponse.pb-c.obj" "Communication\PMR\Diagnostics\DispenserJoggingRequest.pb-c.obj" "Communication\PMR\Diagnostics\DispenserJoggingResponse.pb-c.obj" -$(RM) "Communication\PMR\Diagnostics\DoubleArray.pb-c.obj" "Communication\PMR\Diagnostics\Event.pb-c.obj" "Communication\PMR\Diagnostics\EventType.pb-c.obj" "Communication\PMR\Diagnostics\HeaterState.pb-c.obj" "Communication\PMR\Diagnostics\HeaterType.pb-c.obj" "Communication\PMR\Diagnostics\InterfaceIOs.pb-c.obj" "Communication\PMR\Diagnostics\MotorAbortHomingRequest.pb-c.obj" "Communication\PMR\Diagnostics\MotorAbortHomingResponse.pb-c.obj" "Communication\PMR\Diagnostics\MotorAbortJoggingRequest.pb-c.obj" "Communication\PMR\Diagnostics\MotorAbortJoggingResponse.pb-c.obj" "Communication\PMR\Diagnostics\MotorDirection.pb-c.obj" "Communication\PMR\Diagnostics\MotorHomingRequest.pb-c.obj" "Communication\PMR\Diagnostics\MotorHomingResponse.pb-c.obj" "Communication\PMR\Diagnostics\MotorJoggingRequest.pb-c.obj" "Communication\PMR\Diagnostics\MotorJoggingResponse.pb-c.obj" "Communication\PMR\Diagnostics\ResolveEventRequest.pb-c.obj" "Communication\PMR\Diagnostics\ResolveEventResponse.pb-c.obj" "Communication\PMR\Diagnostics\SetBlowerStateRequest.pb-c.obj" @@ -873,15 +846,14 @@ clean: -$(RM) "Communication\PMR\Stubs\StubMotorPositionResponse.pb-c.obj" "Communication\PMR\Stubs\StubMotorRequest.pb-c.obj" "Communication\PMR\Stubs\StubMotorResponse.pb-c.obj" "Communication\PMR\Stubs\StubMotorRunRequest.pb-c.obj" "Communication\PMR\Stubs\StubMotorRunResponse.pb-c.obj" "Communication\PMR\Stubs\StubMotorRunStepTickRequest.pb-c.obj" "Communication\PMR\Stubs\StubMotorRunStepTickResponse.pb-c.obj" "Communication\PMR\Stubs\StubMotorSpeedRequest.pb-c.obj" "Communication\PMR\Stubs\StubMotorSpeedResponse.pb-c.obj" "Communication\PMR\Stubs\StubMotorStatusRequest.pb-c.obj" "Communication\PMR\Stubs\StubMotorStatusResponse.pb-c.obj" "Communication\PMR\Stubs\StubMotorStopRequest.pb-c.obj" "Communication\PMR\Stubs\StubMotorStopResponse.pb-c.obj" "Communication\PMR\Stubs\StubOptLimitSwitchRequest.pb-c.obj" "Communication\PMR\Stubs\StubOptLimitSwitchResponse.pb-c.obj" "Communication\PMR\Stubs\StubReadEmbeddedVersionRequest.pb-c.obj" "Communication\PMR\Stubs\StubReadEmbeddedVersionResponse.pb-c.obj" -$(RM) "Communication\PMR\Stubs\StubRealTimeUsageRequest.pb-c.obj" "Communication\PMR\Stubs\StubRealTimeUsageResponse.pb-c.obj" "Communication\PMR\Stubs\StubSpeedSensorRequest.pb-c.obj" "Communication\PMR\Stubs\StubSpeedSensorResponse.pb-c.obj" "Communication\PMR\Stubs\StubSteperMotorRequest.pb-c.obj" "Communication\PMR\Stubs\StubSteperMotorResponse.pb-c.obj" "Communication\PMR\Stubs\StubTempSensorRequest.pb-c.obj" "Communication\PMR\Stubs\StubTempSensorResponse.pb-c.obj" "Communication\PMR\Stubs\StubTivaReadRegRequest.pb-c.obj" "Communication\PMR\Stubs\StubTivaReadRegResponse.pb-c.obj" "Communication\PMR\Stubs\StubTivaWriteRegRequest.pb-c.obj" "Communication\PMR\Stubs\StubTivaWriteRegResponse.pb-c.obj" "Communication\PMR\Stubs\StubValveRequest.pb-c.obj" "Communication\PMR\Stubs\StubValveResponse.pb-c.obj" "Communication\PMR\Stubs\StubWhsEEpromData.pb-c.obj" "Communication\PMR\Stubs\StubWhsEEpromRequest.pb-c.obj" "Communication\PMR\Stubs\StubWhsEEpromResponse.pb-c.obj" "Communication\PMR\ThreadLoading\ContinueThreadLoadingRequest.pb-c.obj" -$(RM) "Communication\PMR\ThreadLoading\ContinueThreadLoadingResponse.pb-c.obj" "Communication\PMR\ThreadLoading\StartThreadLoadingRequest.pb-c.obj" "Communication\PMR\ThreadLoading\StartThreadLoadingResponse.pb-c.obj" "Communication\PMR\ThreadLoading\StopThreadLoadingRequest.pb-c.obj" "Communication\PMR\ThreadLoading\StopThreadLoadingResponse.pb-c.obj" "Communication\PMR\ThreadLoading\ThreadLoadingState.pb-c.obj" "Communication\PMR\ThreadLoading\TryThreadLoadingRequest.pb-c.obj" "Communication\PMR\ThreadLoading\TryThreadLoadingResponse.pb-c.obj" "Drivers\ADC_Sampling\ADC.obj" "Drivers\ADC_Sampling\ADC_DispPressSens.obj" "Drivers\ADC_Sampling\ADC_VAC.obj" "Drivers\ADC_Sampling\ADC_VOC_Sensor.obj" "Drivers\FPGA\FPGA.obj" "Drivers\FPGA\FPGA_SPI_Comm.obj" "Drivers\FPGA\FPGA_SSI_Comm.obj" "Drivers\FPGA\FPGA_GPIO\FPGA_GPIO.obj" "Drivers\FPGA\FPGA_INTERRUPTS\FPGA_Interrupts.obj" "Drivers\FPGA\Full_Vme\FPGA_Programming_Up.obj" "Drivers\FPGA\Full_Vme\ispvme\hardware.obj" "Drivers\FPGA\Full_Vme\ispvme\ispvm_ui.obj" - -$(RM) "Drivers\FPGA\Full_Vme\ispvme\ivm_core.obj" "Drivers\FPGA\Motors_Driver\L6470.obj" "Drivers\Flash_Memory\FATFS\Control_File_System.obj" "Drivers\Flash_Memory\FATFS\cc932.obj" "Drivers\Flash_Memory\FATFS\fatfs_port_mx66l51235f.obj" "Drivers\Flash_Memory\FATFS\ff.obj" "Drivers\Flash_Memory\FATFS\mx66l51235f.obj" "Drivers\Flash_Memory\FATFS\spi_flash.obj" "Drivers\Flash_Memory\Flash_Memory.obj" "Drivers\Heater\ADS1220.obj" "Drivers\Heater\Heater.obj" "Drivers\Heater\TemperatureSensor.obj" "Drivers\I2C_Communication\ADC_MUX\ADC_MUX.obj" "Drivers\I2C_Communication\DAC\Blower.obj" "Drivers\I2C_Communication\Dispenser_Card\EEPROM\Dispenser_EEPROM.obj" "Drivers\I2C_Communication\Dispenser_Card\I2C_Dispenser_Card_Mux.obj" "Drivers\I2C_Communication\Dispenser_Card\IO_Ports\Dispenser_IO.obj" "Drivers\I2C_Communication\Head_Card\ADC\Head_ADC.obj" "Drivers\I2C_Communication\Head_Card\ADC\Head_ADC_old.obj" "Drivers\I2C_Communication\Head_Card\EEPROM\Head_EEPROM.obj" "Drivers\I2C_Communication\Head_Card\Fan\Head_Fan.obj" - -$(RM) "Drivers\I2C_Communication\Head_Card\Fan\fan_click.obj" "Drivers\I2C_Communication\Head_Card\I2C_Head_Mux.obj" "Drivers\I2C_Communication\Head_Card\IO_Ports\Head_IO.obj" "Drivers\I2C_Communication\Head_Card\IO_Ports\Heaters\Head_Heaters.obj" "Drivers\I2C_Communication\Head_Card\PT100\Head_PT100_ADC.obj" "Drivers\I2C_Communication\I2C.obj" "Drivers\I2C_Communication\I2C_Comm.obj" "Drivers\I2C_Communication\I2C_FIFO.obj" "Drivers\I2C_Communication\I2C_Task.obj" "Drivers\I2C_Communication\ektm4c129_i2c_master_udma_fifo.obj" "Drivers\I2C_Communication\Main_Board_EEPROM\Main_EEPROM.obj" "Drivers\I2C_Communication\RFID_NFC\NFC.obj" "Drivers\I2C_Communication\RFID_NFC\NFC_MainBaord.obj" "Drivers\I2C_Communication\RFID_NFC\NFC_I2C\NFC_I2C.obj" "Drivers\I2C_Communication\RFID_NFC\NFC_I2C\Test_NFC.obj" "Drivers\I2C_Communication\RFID_NFC\PN7150\PN7150.obj" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_NFC.obj" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_RFID.obj" "Drivers\I2C_Communication\Thermo_K\MCP9600.obj" - -$(RM) "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\AD5272_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\WHS_Rheostat.obj" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\ADS122X04_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\WHS_PT100_ADC.obj" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\D_EMC2302_fan.obj" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\WHS_Fan.obj" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\MAX11614_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\WHS_MAX11614_A2D.obj" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\Max_5805_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\WHS_Blower.obj" "Drivers\I2C_Communication\WHS_Card\D_TCA9546_ADC_MUX\TCA9546_Driver.obj" "Drivers\I2C_Communication\WHS_Card\EEPROM\D_EEPROM.obj" "Drivers\I2C_Communication\WHS_Card\EEPROM\WHS_EEPROM.obj" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Fan_Mux.obj" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Mux.obj" - -$(RM) "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\TCA9555_Driver.obj" "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\WHS_IO.obj" "Drivers\Motors\Motor.obj" "Drivers\Motors\MotorActions.obj" "Drivers\On_Chip_Flash\Flashstore.obj" "Drivers\SPI\SPI_Comm.obj" "Drivers\SSI_Comm\Dancer\Dancer.obj" "Drivers\SSI_Comm\SSI_Comm.obj" "Drivers\SSI_Comm\Speed_Sensor\Speed_Sensor.obj" "Drivers\USB_Communication\USBCDCD.obj" "Drivers\Uart_Comm\Uart.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\ascii\mbascii.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfunccoils.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncdiag.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncdisc.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncholding.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncinput.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncother.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbutils.obj" - -$(RM) "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\mb.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\rtu\mbcrc.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\rtu\mbrtu.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\tcp\mbtcp.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Shinko\ACS-13AC5E3.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\WHS_UART\WHS_Uart.obj" "Drivers\Valves\Valve.obj" "Drivers\flash_ram\FlashProgram.obj" "Drivers\flash_ram\MCU_E2Prom.obj" "Modules\AlarmHandling\AlarmHandling.obj" "Modules\Control\DriverWithCallbackExample.obj" "Modules\Control\MillisecTask.obj" "Modules\Control\PIDAlgo.obj" "Modules\Control\control.obj" "Modules\Diagnostics\DiagnosticActions.obj" "Modules\Diagnostics\Diagnostics.obj" "Modules\Diagnostics\DiagnosticsHoming.obj" "Modules\Diagnostics\DiagnosticsJogging.obj" "Modules\General\GeneralHardware.obj" "Modules\General\MachineStatus.obj" "Modules\General\Safety.obj" "Modules\General\buttons.obj" "Modules\General\process.obj" "Modules\Heaters\Heaters_bit.obj" - -$(RM) "Modules\Heaters\Heaters_init.obj" "Modules\Heaters\Heaters_maint.obj" "Modules\Heaters\Heaters_print.obj" "Modules\IDS\IDS_BIT.obj" "Modules\IDS\IDS_Cleaning.obj" "Modules\IDS\IDS_dispenser.obj" "Modules\IDS\IDS_init.obj" "Modules\IDS\IDS_maint.obj" "Modules\IDS\IDS_print.obj" "Modules\IFS\ifs.obj" "Modules\Stubs_Handler\Calculate.obj" "Modules\Stubs_Handler\Progress.obj" "Modules\Stubs_Handler\StubRealTimeUsage.obj" "Modules\Stubs_Handler\Stub_Cartridge.obj" "Modules\Stubs_Handler\Stub_Dancer.obj" "Modules\Stubs_Handler\Stub_Dispenser.obj" "Modules\Stubs_Handler\Stub_ExtFlash.obj" "Modules\Stubs_Handler\Stub_FPGARWReg.obj" "Modules\Stubs_Handler\Stub_FPGAReadBackReg.obj" "Modules\Stubs_Handler\Stub_FPGAReadVersion.obj" "Modules\Stubs_Handler\Stub_GPIO.obj" "Modules\Stubs_Handler\Stub_HW_Version.obj" "Modules\Stubs_Handler\Stub_Heater.obj" "Modules\Stubs_Handler\Stub_I2C.obj" "Modules\Stubs_Handler\Stub_IntADC.obj" "Modules\Stubs_Handler\Stub_L6470.obj" "Modules\Stubs_Handler\Stub_MidTankPressureSensor.obj" - -$(RM) "Modules\Stubs_Handler\Stub_Motor.obj" "Modules\Stubs_Handler\Stub_OptLimitSwitch.obj" "Modules\Stubs_Handler\Stub_ReadEmbeddedVersion.obj" "Modules\Stubs_Handler\Stub_SpeedSensor.obj" "Modules\Stubs_Handler\Stub_Status.obj" "Modules\Stubs_Handler\Stub_SteperMotor.obj" "Modules\Stubs_Handler\Stub_TempSensor.obj" "Modules\Stubs_Handler\Stub_TivaReg.obj" "Modules\Stubs_Handler\Stub_Valve.obj" "Modules\Stubs_Handler\User_Leds.obj" "Modules\Stubs_Handler\temperature_sensor.obj" "Modules\Thread\ThreadLoad.obj" "Modules\Thread\Thread_BIT.obj" "Modules\Thread\Thread_Winder.obj" "Modules\Thread\Thread_init.obj" "Modules\Thread\Thread_maint.obj" "Modules\Thread\Thread_print.obj" "Modules\Waste\Waste_BIT.obj" "Modules\Waste\Waste_init.obj" "Modules\Waste\Waste_maint.obj" "Modules\Waste\Waste_print.obj" "Modules\Waste\newWHS_init.obj" "StateMachines\Initialization\InitSequence.obj" "StateMachines\Initialization\PowerIdle.obj" "StateMachines\Initialization\PowerOffSequence.obj" "StateMachines\Printing\JobSTM.obj" - -$(RM) "StateMachines\Printing\PrintingSTM.obj" - -$(RM) "Main.d" "delay.d" "Common\CheckSum\Checksum.d" "Common\SWUpdate\FileSystem.d" "Common\SWUpdate\FirmwareUpgrade.d" "Common\SW_Info\SW_Info.d" "Common\Software_CRC\sw_crc.d" "Common\Sys_PinOut_Config\MCU_MAIN_pinout.d" "Common\Sys_PinOut_Config\Pin.d" "Common\Sys_PinOut_Config\Pin_config.d" "Common\Utilities\RFIDTagHandling.d" "Common\Utilities\Update.d" "Common\Utilities\Utils.d" "Common\Utilities\idle_task.d" "Common\Utilities\ustdlib.d" "Common\protobuf-c\protobuf-c.d" "Common\report\distributor.d" "Common\report\filter.d" "Common\report\reportInit.d" "Communication\CommunicationTask.d" "Communication\Connection.d" "Communication\Container.d" "Communication\PMR\Common\ErrorCode.pb-c.d" "Communication\PMR\Common\ErrorResponse.pb-c.d" "Communication\PMR\Common\MessageContainer.pb-c.d" "Communication\PMR\Common\MessageType.pb-c.d" "Communication\PMR\Connection\ConnectRequest.pb-c.d" "Communication\PMR\Connection\ConnectResponse.pb-c.d" "Communication\PMR\Connection\DeviceInformation.pb-c.d" + -$(RM) "Drivers\FPGA\Full_Vme\ispvme\ivm_core.obj" "Drivers\FPGA\Motors_Driver\L6470.obj" "Drivers\Flash_Memory\FATFS\Control_File_System.obj" "Drivers\Flash_Memory\FATFS\cc932.obj" "Drivers\Flash_Memory\FATFS\fatfs_port_mx66l51235f.obj" "Drivers\Flash_Memory\FATFS\ff.obj" "Drivers\Flash_Memory\FATFS\mx66l51235f.obj" "Drivers\Flash_Memory\FATFS\spi_flash.obj" "Drivers\Flash_Memory\Flash_Memory.obj" "Drivers\Heater\ADS1220.obj" "Drivers\Heater\Heater.obj" "Drivers\Heater\TemperatureSensor.obj" "Drivers\I2C_Communication\ADC_MUX\ADC_MUX.obj" "Drivers\I2C_Communication\DAC\Blower.obj" "Drivers\I2C_Communication\Dispenser_Card\EEPROM\Dispenser_EEPROM.obj" "Drivers\I2C_Communication\Dispenser_Card\I2C_Dispenser_Card_Mux.obj" "Drivers\I2C_Communication\Dispenser_Card\IO_Ports\Dispenser_IO.obj" "Drivers\I2C_Communication\Head_Card\ADC\Head_ADC.obj" "Drivers\I2C_Communication\Head_Card\EEPROM\Head_EEPROM.obj" "Drivers\I2C_Communication\Head_Card\Fan\Head_Fan.obj" "Drivers\I2C_Communication\Head_Card\Fan\fan_click.obj" + -$(RM) "Drivers\I2C_Communication\Head_Card\I2C_Head_Mux.obj" "Drivers\I2C_Communication\Head_Card\IO_Ports\Head_IO.obj" "Drivers\I2C_Communication\Head_Card\IO_Ports\Heaters\Head_Heaters.obj" "Drivers\I2C_Communication\Head_Card\PT100\Head_PT100_ADC.obj" "Drivers\I2C_Communication\I2C.obj" "Drivers\I2C_Communication\I2C_Comm.obj" "Drivers\I2C_Communication\I2C_FIFO.obj" "Drivers\I2C_Communication\I2C_Task.obj" "Drivers\I2C_Communication\ektm4c129_i2c_master_udma_fifo.obj" "Drivers\I2C_Communication\test_fifo_dma.obj" "Drivers\I2C_Communication\Main_Board_EEPROM\Main_EEPROM.obj" "Drivers\I2C_Communication\RFID_NFC\I2C_IFS_Mux.obj" "Drivers\I2C_Communication\RFID_NFC\NFC.obj" "Drivers\I2C_Communication\RFID_NFC\NFC_MainBaord.obj" "Drivers\I2C_Communication\RFID_NFC\Test_RFID.obj" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_NFC.obj" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_RFID.obj" "Drivers\I2C_Communication\Thermo_K\MCP9600.obj" "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\AD5272_Driver.obj" + -$(RM) "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\WHS_Rheostat.obj" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\ADS122X04_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\WHS_PT100_ADC.obj" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\D_EMC2302_fan.obj" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\WHS_Fan.obj" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\MAX11614_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\WHS_MAX11614_A2D.obj" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\Max_5805_Driver.obj" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\WHS_Blower.obj" "Drivers\I2C_Communication\WHS_Card\D_TCA9546_ADC_MUX\TCA9546_Driver.obj" "Drivers\I2C_Communication\WHS_Card\EEPROM\D_EEPROM.obj" "Drivers\I2C_Communication\WHS_Card\EEPROM\WHS_EEPROM.obj" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Fan_Mux.obj" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Mux.obj" "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\TCA9555_Driver.obj" + -$(RM) "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\WHS_IO.obj" "Drivers\Motors\Motor.obj" "Drivers\Motors\MotorActions.obj" "Drivers\On_Chip_Flash\Flashstore.obj" "Drivers\SPI\SPI_Comm.obj" "Drivers\SSI_Comm\Dancer\Dancer.obj" "Drivers\SSI_Comm\SSI_Comm.obj" "Drivers\SSI_Comm\Speed_Sensor\Speed_Sensor.obj" "Drivers\USB_Communication\USBCDCD.obj" "Drivers\Uart_Comm\Uart.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\Shinko\ACS-13AC5E3.obj" "Drivers\Uart_Comm\WHS_Controller_Comm\WHS_UART\WHS_Uart.obj" "Drivers\Valves\Valve.obj" "Drivers\flash_ram\FlashProgram.obj" "Drivers\flash_ram\MCU_E2Prom.obj" "Modules\AlarmHandling\AlarmHandling.obj" "Modules\Control\DriverWithCallbackExample.obj" "Modules\Control\MillisecTask.obj" "Modules\Control\PIDAlgo.obj" "Modules\Control\control.obj" "Modules\Diagnostics\DiagnosticActions.obj" "Modules\Diagnostics\Diagnostics.obj" "Modules\Diagnostics\DiagnosticsHoming.obj" "Modules\Diagnostics\DiagnosticsJogging.obj" "Modules\General\GeneralHardware.obj" + -$(RM) "Modules\General\MachineStatus.obj" "Modules\General\Safety.obj" "Modules\General\buttons.obj" "Modules\General\process.obj" "Modules\Heaters\Heaters_bit.obj" "Modules\Heaters\Heaters_init.obj" "Modules\Heaters\Heaters_maint.obj" "Modules\Heaters\Heaters_print.obj" "Modules\IDS\IDS_BIT.obj" "Modules\IDS\IDS_Cleaning.obj" "Modules\IDS\IDS_dispenser.obj" "Modules\IDS\IDS_init.obj" "Modules\IDS\IDS_maint.obj" "Modules\IDS\IDS_print.obj" "Modules\IFS\ifs.obj" "Modules\Stubs_Handler\Calculate.obj" "Modules\Stubs_Handler\Progress.obj" "Modules\Stubs_Handler\StubRealTimeUsage.obj" "Modules\Stubs_Handler\Stub_Cartridge.obj" "Modules\Stubs_Handler\Stub_Dancer.obj" "Modules\Stubs_Handler\Stub_Dispenser.obj" "Modules\Stubs_Handler\Stub_ExtFlash.obj" "Modules\Stubs_Handler\Stub_FPGARWReg.obj" "Modules\Stubs_Handler\Stub_FPGAReadBackReg.obj" "Modules\Stubs_Handler\Stub_FPGAReadVersion.obj" "Modules\Stubs_Handler\Stub_GPIO.obj" "Modules\Stubs_Handler\Stub_HW_Version.obj" "Modules\Stubs_Handler\Stub_Heater.obj" + -$(RM) "Modules\Stubs_Handler\Stub_I2C.obj" "Modules\Stubs_Handler\Stub_IntADC.obj" "Modules\Stubs_Handler\Stub_L6470.obj" "Modules\Stubs_Handler\Stub_MidTankPressureSensor.obj" "Modules\Stubs_Handler\Stub_Motor.obj" "Modules\Stubs_Handler\Stub_OptLimitSwitch.obj" "Modules\Stubs_Handler\Stub_ReadEmbeddedVersion.obj" "Modules\Stubs_Handler\Stub_SpeedSensor.obj" "Modules\Stubs_Handler\Stub_Status.obj" "Modules\Stubs_Handler\Stub_SteperMotor.obj" "Modules\Stubs_Handler\Stub_TempSensor.obj" "Modules\Stubs_Handler\Stub_TivaReg.obj" "Modules\Stubs_Handler\Stub_Valve.obj" "Modules\Stubs_Handler\User_Leds.obj" "Modules\Stubs_Handler\temperature_sensor.obj" "Modules\Thread\ThreadLoad.obj" "Modules\Thread\Thread_BIT.obj" "Modules\Thread\Thread_Winder.obj" "Modules\Thread\Thread_init.obj" "Modules\Thread\Thread_maint.obj" "Modules\Thread\Thread_print.obj" "Modules\Waste\Waste_BIT.obj" "Modules\Waste\Waste_init.obj" "Modules\Waste\Waste_maint.obj" "Modules\Waste\newWHS_init.obj" "StateMachines\Initialization\InitSequence.obj" + -$(RM) "StateMachines\Initialization\PowerIdle.obj" "StateMachines\Initialization\PowerOffSequence.obj" "StateMachines\Printing\JobSTM.obj" "StateMachines\Printing\PrintingSTM.obj" + -$(RM) "Main.d" "Common\CheckSum\Checksum.d" "Common\SWUpdate\FileSystem.d" "Common\SWUpdate\FirmwareUpgrade.d" "Common\SW_Info\SW_Info.d" "Common\Software_CRC\sw_crc.d" "Common\Sys_PinOut_Config\MCU_MAIN_pinout.d" "Common\Sys_PinOut_Config\Pin.d" "Common\Sys_PinOut_Config\Pin_config.d" "Common\Utilities\RFIDTagHandling.d" "Common\Utilities\Update.d" "Common\Utilities\Utils.d" "Common\Utilities\delay.d" "Common\Utilities\idle_task.d" "Common\Utilities\ustdlib.d" "Common\protobuf-c\protobuf-c.d" "Common\report\distributor.d" "Common\report\filter.d" "Common\report\reportInit.d" "Communication\CommunicationTask.d" "Communication\Connection.d" "Communication\Container.d" "Communication\PMR\Common\ErrorCode.pb-c.d" "Communication\PMR\Common\ErrorResponse.pb-c.d" "Communication\PMR\Common\MessageContainer.pb-c.d" "Communication\PMR\Common\MessageType.pb-c.d" "Communication\PMR\Connection\ConnectRequest.pb-c.d" "Communication\PMR\Connection\ConnectResponse.pb-c.d" "Communication\PMR\Connection\DeviceInformation.pb-c.d" -$(RM) "Communication\PMR\Connection\DisconnectRequest.pb-c.d" "Communication\PMR\Connection\DisconnectResponse.pb-c.d" "Communication\PMR\Connection\KeepAliveRequest.pb-c.d" "Communication\PMR\Connection\KeepAliveResponse.pb-c.d" "Communication\PMR\Debugging\DebugDistributor.pb-c.d" "Communication\PMR\Debugging\DebugDistributorType.pb-c.d" "Communication\PMR\Debugging\DebugLogCategory.pb-c.d" "Communication\PMR\Debugging\SetDebugLogCategoryRequest.pb-c.d" "Communication\PMR\Debugging\SetDebugLogCategoryResponse.pb-c.d" "Communication\PMR\Debugging\SetupDebugDisributorsRequest.pb-c.d" "Communication\PMR\Debugging\SetupDebugDisributorsResponse.pb-c.d" "Communication\PMR\Debugging\StartDebugLogRequest.pb-c.d" "Communication\PMR\Debugging\StartDebugLogResponse.pb-c.d" "Communication\PMR\Debugging\StopDebugLogRequest.pb-c.d" "Communication\PMR\Debugging\StopDebugLogResponse.pb-c.d" "Communication\PMR\Diagnostics\Cartridge.pb-c.d" "Communication\PMR\Diagnostics\CartridgeAction.pb-c.d" "Communication\PMR\Diagnostics\CartridgeSlot.pb-c.d" -$(RM) "Communication\PMR\Diagnostics\CartridgeTagContent.pb-c.d" "Communication\PMR\Diagnostics\CartridgeValidationRequest.pb-c.d" "Communication\PMR\Diagnostics\CartridgeValidationResponse.pb-c.d" "Communication\PMR\Diagnostics\DataFileFrame.pb-c.d" "Communication\PMR\Diagnostics\DiagnosticsMonitors.pb-c.d" "Communication\PMR\Diagnostics\DigitalInterfaceState.pb-c.d" "Communication\PMR\Diagnostics\DispenserAbortHomingRequest.pb-c.d" "Communication\PMR\Diagnostics\DispenserAbortHomingResponse.pb-c.d" "Communication\PMR\Diagnostics\DispenserAbortJoggingRequest.pb-c.d" "Communication\PMR\Diagnostics\DispenserAbortJoggingResponse.pb-c.d" "Communication\PMR\Diagnostics\DispenserHomingRequest.pb-c.d" "Communication\PMR\Diagnostics\DispenserHomingResponse.pb-c.d" "Communication\PMR\Diagnostics\DispenserJoggingRequest.pb-c.d" "Communication\PMR\Diagnostics\DispenserJoggingResponse.pb-c.d" "Communication\PMR\Diagnostics\DoubleArray.pb-c.d" "Communication\PMR\Diagnostics\Event.pb-c.d" "Communication\PMR\Diagnostics\EventType.pb-c.d" -$(RM) "Communication\PMR\Diagnostics\HeaterState.pb-c.d" "Communication\PMR\Diagnostics\HeaterType.pb-c.d" "Communication\PMR\Diagnostics\InterfaceIOs.pb-c.d" "Communication\PMR\Diagnostics\MotorAbortHomingRequest.pb-c.d" "Communication\PMR\Diagnostics\MotorAbortHomingResponse.pb-c.d" "Communication\PMR\Diagnostics\MotorAbortJoggingRequest.pb-c.d" "Communication\PMR\Diagnostics\MotorAbortJoggingResponse.pb-c.d" "Communication\PMR\Diagnostics\MotorDirection.pb-c.d" "Communication\PMR\Diagnostics\MotorHomingRequest.pb-c.d" "Communication\PMR\Diagnostics\MotorHomingResponse.pb-c.d" "Communication\PMR\Diagnostics\MotorJoggingRequest.pb-c.d" "Communication\PMR\Diagnostics\MotorJoggingResponse.pb-c.d" "Communication\PMR\Diagnostics\ResolveEventRequest.pb-c.d" "Communication\PMR\Diagnostics\ResolveEventResponse.pb-c.d" "Communication\PMR\Diagnostics\SetBlowerStateRequest.pb-c.d" "Communication\PMR\Diagnostics\SetBlowerStateResponse.pb-c.d" "Communication\PMR\Diagnostics\SetComponentValueRequest.pb-c.d" @@ -901,13 +873,12 @@ clean: -$(RM) "Communication\PMR\Stubs\StubMotorStatusRequest.pb-c.d" "Communication\PMR\Stubs\StubMotorStatusResponse.pb-c.d" "Communication\PMR\Stubs\StubMotorStopRequest.pb-c.d" "Communication\PMR\Stubs\StubMotorStopResponse.pb-c.d" "Communication\PMR\Stubs\StubOptLimitSwitchRequest.pb-c.d" "Communication\PMR\Stubs\StubOptLimitSwitchResponse.pb-c.d" "Communication\PMR\Stubs\StubReadEmbeddedVersionRequest.pb-c.d" "Communication\PMR\Stubs\StubReadEmbeddedVersionResponse.pb-c.d" "Communication\PMR\Stubs\StubRealTimeUsageRequest.pb-c.d" "Communication\PMR\Stubs\StubRealTimeUsageResponse.pb-c.d" "Communication\PMR\Stubs\StubSpeedSensorRequest.pb-c.d" "Communication\PMR\Stubs\StubSpeedSensorResponse.pb-c.d" "Communication\PMR\Stubs\StubSteperMotorRequest.pb-c.d" "Communication\PMR\Stubs\StubSteperMotorResponse.pb-c.d" "Communication\PMR\Stubs\StubTempSensorRequest.pb-c.d" "Communication\PMR\Stubs\StubTempSensorResponse.pb-c.d" "Communication\PMR\Stubs\StubTivaReadRegRequest.pb-c.d" "Communication\PMR\Stubs\StubTivaReadRegResponse.pb-c.d" -$(RM) "Communication\PMR\Stubs\StubTivaWriteRegRequest.pb-c.d" "Communication\PMR\Stubs\StubTivaWriteRegResponse.pb-c.d" "Communication\PMR\Stubs\StubValveRequest.pb-c.d" "Communication\PMR\Stubs\StubValveResponse.pb-c.d" "Communication\PMR\Stubs\StubWhsEEpromData.pb-c.d" "Communication\PMR\Stubs\StubWhsEEpromRequest.pb-c.d" "Communication\PMR\Stubs\StubWhsEEpromResponse.pb-c.d" "Communication\PMR\ThreadLoading\ContinueThreadLoadingRequest.pb-c.d" "Communication\PMR\ThreadLoading\ContinueThreadLoadingResponse.pb-c.d" "Communication\PMR\ThreadLoading\StartThreadLoadingRequest.pb-c.d" "Communication\PMR\ThreadLoading\StartThreadLoadingResponse.pb-c.d" "Communication\PMR\ThreadLoading\StopThreadLoadingRequest.pb-c.d" "Communication\PMR\ThreadLoading\StopThreadLoadingResponse.pb-c.d" "Communication\PMR\ThreadLoading\ThreadLoadingState.pb-c.d" "Communication\PMR\ThreadLoading\TryThreadLoadingRequest.pb-c.d" "Communication\PMR\ThreadLoading\TryThreadLoadingResponse.pb-c.d" "Drivers\ADC_Sampling\ADC.d" -$(RM) "Drivers\ADC_Sampling\ADC_DispPressSens.d" "Drivers\ADC_Sampling\ADC_VAC.d" "Drivers\ADC_Sampling\ADC_VOC_Sensor.d" "Drivers\FPGA\FPGA.d" "Drivers\FPGA\FPGA_SPI_Comm.d" "Drivers\FPGA\FPGA_SSI_Comm.d" "Drivers\FPGA\FPGA_GPIO\FPGA_GPIO.d" "Drivers\FPGA\FPGA_INTERRUPTS\FPGA_Interrupts.d" "Drivers\FPGA\Full_Vme\FPGA_Programming_Up.d" "Drivers\FPGA\Full_Vme\ispvme\hardware.d" "Drivers\FPGA\Full_Vme\ispvme\ispvm_ui.d" "Drivers\FPGA\Full_Vme\ispvme\ivm_core.d" "Drivers\FPGA\Motors_Driver\L6470.d" "Drivers\Flash_Memory\FATFS\Control_File_System.d" "Drivers\Flash_Memory\FATFS\cc932.d" "Drivers\Flash_Memory\FATFS\fatfs_port_mx66l51235f.d" "Drivers\Flash_Memory\FATFS\ff.d" "Drivers\Flash_Memory\FATFS\mx66l51235f.d" "Drivers\Flash_Memory\FATFS\spi_flash.d" "Drivers\Flash_Memory\Flash_Memory.d" "Drivers\Heater\ADS1220.d" "Drivers\Heater\Heater.d" "Drivers\Heater\TemperatureSensor.d" "Drivers\I2C_Communication\ADC_MUX\ADC_MUX.d" "Drivers\I2C_Communication\DAC\Blower.d" "Drivers\I2C_Communication\Dispenser_Card\EEPROM\Dispenser_EEPROM.d" - -$(RM) "Drivers\I2C_Communication\Dispenser_Card\I2C_Dispenser_Card_Mux.d" "Drivers\I2C_Communication\Dispenser_Card\IO_Ports\Dispenser_IO.d" "Drivers\I2C_Communication\Head_Card\ADC\Head_ADC.d" "Drivers\I2C_Communication\Head_Card\ADC\Head_ADC_old.d" "Drivers\I2C_Communication\Head_Card\EEPROM\Head_EEPROM.d" "Drivers\I2C_Communication\Head_Card\Fan\Head_Fan.d" "Drivers\I2C_Communication\Head_Card\Fan\fan_click.d" "Drivers\I2C_Communication\Head_Card\I2C_Head_Mux.d" "Drivers\I2C_Communication\Head_Card\IO_Ports\Head_IO.d" "Drivers\I2C_Communication\Head_Card\IO_Ports\Heaters\Head_Heaters.d" "Drivers\I2C_Communication\Head_Card\PT100\Head_PT100_ADC.d" "Drivers\I2C_Communication\I2C.d" "Drivers\I2C_Communication\I2C_Comm.d" "Drivers\I2C_Communication\I2C_FIFO.d" "Drivers\I2C_Communication\I2C_Task.d" "Drivers\I2C_Communication\ektm4c129_i2c_master_udma_fifo.d" "Drivers\I2C_Communication\Main_Board_EEPROM\Main_EEPROM.d" "Drivers\I2C_Communication\RFID_NFC\NFC.d" "Drivers\I2C_Communication\RFID_NFC\NFC_MainBaord.d" - -$(RM) "Drivers\I2C_Communication\RFID_NFC\NFC_I2C\NFC_I2C.d" "Drivers\I2C_Communication\RFID_NFC\NFC_I2C\Test_NFC.d" "Drivers\I2C_Communication\RFID_NFC\PN7150\PN7150.d" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_NFC.d" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_RFID.d" "Drivers\I2C_Communication\Thermo_K\MCP9600.d" "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\AD5272_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\WHS_Rheostat.d" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\ADS122X04_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\WHS_PT100_ADC.d" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\D_EMC2302_fan.d" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\WHS_Fan.d" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\MAX11614_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\WHS_MAX11614_A2D.d" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\Max_5805_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\WHS_Blower.d" - -$(RM) "Drivers\I2C_Communication\WHS_Card\D_TCA9546_ADC_MUX\TCA9546_Driver.d" "Drivers\I2C_Communication\WHS_Card\EEPROM\D_EEPROM.d" "Drivers\I2C_Communication\WHS_Card\EEPROM\WHS_EEPROM.d" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Fan_Mux.d" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Mux.d" "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\TCA9555_Driver.d" "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\WHS_IO.d" "Drivers\Motors\Motor.d" "Drivers\Motors\MotorActions.d" "Drivers\On_Chip_Flash\Flashstore.d" "Drivers\SPI\SPI_Comm.d" "Drivers\SSI_Comm\Dancer\Dancer.d" "Drivers\SSI_Comm\SSI_Comm.d" "Drivers\SSI_Comm\Speed_Sensor\Speed_Sensor.d" "Drivers\USB_Communication\USBCDCD.d" "Drivers\Uart_Comm\Uart.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\ascii\mbascii.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfunccoils.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncdiag.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncdisc.d" - -$(RM) "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncholding.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncinput.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbfuncother.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\functions\mbutils.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\mb.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\rtu\mbcrc.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\rtu\mbrtu.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Modbus\tcp\mbtcp.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Shinko\ACS-13AC5E3.d" "Drivers\Uart_Comm\WHS_Controller_Comm\WHS_UART\WHS_Uart.d" "Drivers\Valves\Valve.d" "Drivers\flash_ram\FlashProgram.d" "Drivers\flash_ram\MCU_E2Prom.d" "Modules\AlarmHandling\AlarmHandling.d" "Modules\Control\DriverWithCallbackExample.d" "Modules\Control\MillisecTask.d" "Modules\Control\PIDAlgo.d" "Modules\Control\control.d" "Modules\Diagnostics\DiagnosticActions.d" "Modules\Diagnostics\Diagnostics.d" "Modules\Diagnostics\DiagnosticsHoming.d" - -$(RM) "Modules\Diagnostics\DiagnosticsJogging.d" "Modules\General\GeneralHardware.d" "Modules\General\MachineStatus.d" "Modules\General\Safety.d" "Modules\General\buttons.d" "Modules\General\process.d" "Modules\Heaters\Heaters_bit.d" "Modules\Heaters\Heaters_init.d" "Modules\Heaters\Heaters_maint.d" "Modules\Heaters\Heaters_print.d" "Modules\IDS\IDS_BIT.d" "Modules\IDS\IDS_Cleaning.d" "Modules\IDS\IDS_dispenser.d" "Modules\IDS\IDS_init.d" "Modules\IDS\IDS_maint.d" "Modules\IDS\IDS_print.d" "Modules\IFS\ifs.d" "Modules\Stubs_Handler\Calculate.d" "Modules\Stubs_Handler\Progress.d" "Modules\Stubs_Handler\StubRealTimeUsage.d" "Modules\Stubs_Handler\Stub_Cartridge.d" "Modules\Stubs_Handler\Stub_Dancer.d" "Modules\Stubs_Handler\Stub_Dispenser.d" "Modules\Stubs_Handler\Stub_ExtFlash.d" "Modules\Stubs_Handler\Stub_FPGARWReg.d" "Modules\Stubs_Handler\Stub_FPGAReadBackReg.d" "Modules\Stubs_Handler\Stub_FPGAReadVersion.d" "Modules\Stubs_Handler\Stub_GPIO.d" "Modules\Stubs_Handler\Stub_HW_Version.d" "Modules\Stubs_Handler\Stub_Heater.d" - -$(RM) "Modules\Stubs_Handler\Stub_I2C.d" "Modules\Stubs_Handler\Stub_IntADC.d" "Modules\Stubs_Handler\Stub_L6470.d" "Modules\Stubs_Handler\Stub_MidTankPressureSensor.d" "Modules\Stubs_Handler\Stub_Motor.d" "Modules\Stubs_Handler\Stub_OptLimitSwitch.d" "Modules\Stubs_Handler\Stub_ReadEmbeddedVersion.d" "Modules\Stubs_Handler\Stub_SpeedSensor.d" "Modules\Stubs_Handler\Stub_Status.d" "Modules\Stubs_Handler\Stub_SteperMotor.d" "Modules\Stubs_Handler\Stub_TempSensor.d" "Modules\Stubs_Handler\Stub_TivaReg.d" "Modules\Stubs_Handler\Stub_Valve.d" "Modules\Stubs_Handler\User_Leds.d" "Modules\Stubs_Handler\temperature_sensor.d" "Modules\Thread\ThreadLoad.d" "Modules\Thread\Thread_BIT.d" "Modules\Thread\Thread_Winder.d" "Modules\Thread\Thread_init.d" "Modules\Thread\Thread_maint.d" "Modules\Thread\Thread_print.d" "Modules\Waste\Waste_BIT.d" "Modules\Waste\Waste_init.d" "Modules\Waste\Waste_maint.d" "Modules\Waste\Waste_print.d" "Modules\Waste\newWHS_init.d" "StateMachines\Initialization\InitSequence.d" - -$(RM) "StateMachines\Initialization\PowerIdle.d" "StateMachines\Initialization\PowerOffSequence.d" "StateMachines\Printing\JobSTM.d" "StateMachines\Printing\PrintingSTM.d" + -$(RM) "Drivers\I2C_Communication\Dispenser_Card\I2C_Dispenser_Card_Mux.d" "Drivers\I2C_Communication\Dispenser_Card\IO_Ports\Dispenser_IO.d" "Drivers\I2C_Communication\Head_Card\ADC\Head_ADC.d" "Drivers\I2C_Communication\Head_Card\EEPROM\Head_EEPROM.d" "Drivers\I2C_Communication\Head_Card\Fan\Head_Fan.d" "Drivers\I2C_Communication\Head_Card\Fan\fan_click.d" "Drivers\I2C_Communication\Head_Card\I2C_Head_Mux.d" "Drivers\I2C_Communication\Head_Card\IO_Ports\Head_IO.d" "Drivers\I2C_Communication\Head_Card\IO_Ports\Heaters\Head_Heaters.d" "Drivers\I2C_Communication\Head_Card\PT100\Head_PT100_ADC.d" "Drivers\I2C_Communication\I2C.d" "Drivers\I2C_Communication\I2C_Comm.d" "Drivers\I2C_Communication\I2C_FIFO.d" "Drivers\I2C_Communication\I2C_Task.d" "Drivers\I2C_Communication\ektm4c129_i2c_master_udma_fifo.d" "Drivers\I2C_Communication\test_fifo_dma.d" "Drivers\I2C_Communication\Main_Board_EEPROM\Main_EEPROM.d" "Drivers\I2C_Communication\RFID_NFC\I2C_IFS_Mux.d" "Drivers\I2C_Communication\RFID_NFC\NFC.d" + -$(RM) "Drivers\I2C_Communication\RFID_NFC\NFC_MainBaord.d" "Drivers\I2C_Communication\RFID_NFC\Test_RFID.d" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_NFC.d" "Drivers\I2C_Communication\RFID_NFC\logi-tag\LT_RFID.d" "Drivers\I2C_Communication\Thermo_K\MCP9600.d" "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\AD5272_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_AD5272_Rheostat\WHS_Rheostat.d" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\ADS122X04_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_ADS122_PT100\WHS_PT100_ADC.d" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\D_EMC2302_fan.d" "Drivers\I2C_Communication\WHS_Card\D_EMC2302_Fan\WHS_Fan.d" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\MAX11614_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_MAX11614_ADC\WHS_MAX11614_A2D.d" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\Max_5805_Driver.d" "Drivers\I2C_Communication\WHS_Card\D_Max5805_ADC_Blower\WHS_Blower.d" "Drivers\I2C_Communication\WHS_Card\D_TCA9546_ADC_MUX\TCA9546_Driver.d" + -$(RM) "Drivers\I2C_Communication\WHS_Card\EEPROM\D_EEPROM.d" "Drivers\I2C_Communication\WHS_Card\EEPROM\WHS_EEPROM.d" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Fan_Mux.d" "Drivers\I2C_Communication\WHS_Card\I2C_WHS_Mux.d" "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\TCA9555_Driver.d" "Drivers\I2C_Communication\WHS_Card\IO_Extender_Ports_TCA9555\WHS_IO.d" "Drivers\Motors\Motor.d" "Drivers\Motors\MotorActions.d" "Drivers\On_Chip_Flash\Flashstore.d" "Drivers\SPI\SPI_Comm.d" "Drivers\SSI_Comm\Dancer\Dancer.d" "Drivers\SSI_Comm\SSI_Comm.d" "Drivers\SSI_Comm\Speed_Sensor\Speed_Sensor.d" "Drivers\USB_Communication\USBCDCD.d" "Drivers\Uart_Comm\Uart.d" "Drivers\Uart_Comm\WHS_Controller_Comm\Shinko\ACS-13AC5E3.d" "Drivers\Uart_Comm\WHS_Controller_Comm\WHS_UART\WHS_Uart.d" "Drivers\Valves\Valve.d" "Drivers\flash_ram\FlashProgram.d" "Drivers\flash_ram\MCU_E2Prom.d" "Modules\AlarmHandling\AlarmHandling.d" "Modules\Control\DriverWithCallbackExample.d" "Modules\Control\MillisecTask.d" "Modules\Control\PIDAlgo.d" + -$(RM) "Modules\Control\control.d" "Modules\Diagnostics\DiagnosticActions.d" "Modules\Diagnostics\Diagnostics.d" "Modules\Diagnostics\DiagnosticsHoming.d" "Modules\Diagnostics\DiagnosticsJogging.d" "Modules\General\GeneralHardware.d" "Modules\General\MachineStatus.d" "Modules\General\Safety.d" "Modules\General\buttons.d" "Modules\General\process.d" "Modules\Heaters\Heaters_bit.d" "Modules\Heaters\Heaters_init.d" "Modules\Heaters\Heaters_maint.d" "Modules\Heaters\Heaters_print.d" "Modules\IDS\IDS_BIT.d" "Modules\IDS\IDS_Cleaning.d" "Modules\IDS\IDS_dispenser.d" "Modules\IDS\IDS_init.d" "Modules\IDS\IDS_maint.d" "Modules\IDS\IDS_print.d" "Modules\IFS\ifs.d" "Modules\Stubs_Handler\Calculate.d" "Modules\Stubs_Handler\Progress.d" "Modules\Stubs_Handler\StubRealTimeUsage.d" "Modules\Stubs_Handler\Stub_Cartridge.d" "Modules\Stubs_Handler\Stub_Dancer.d" "Modules\Stubs_Handler\Stub_Dispenser.d" "Modules\Stubs_Handler\Stub_ExtFlash.d" "Modules\Stubs_Handler\Stub_FPGARWReg.d" "Modules\Stubs_Handler\Stub_FPGAReadBackReg.d" + -$(RM) "Modules\Stubs_Handler\Stub_FPGAReadVersion.d" "Modules\Stubs_Handler\Stub_GPIO.d" "Modules\Stubs_Handler\Stub_HW_Version.d" "Modules\Stubs_Handler\Stub_Heater.d" "Modules\Stubs_Handler\Stub_I2C.d" "Modules\Stubs_Handler\Stub_IntADC.d" "Modules\Stubs_Handler\Stub_L6470.d" "Modules\Stubs_Handler\Stub_MidTankPressureSensor.d" "Modules\Stubs_Handler\Stub_Motor.d" "Modules\Stubs_Handler\Stub_OptLimitSwitch.d" "Modules\Stubs_Handler\Stub_ReadEmbeddedVersion.d" "Modules\Stubs_Handler\Stub_SpeedSensor.d" "Modules\Stubs_Handler\Stub_Status.d" "Modules\Stubs_Handler\Stub_SteperMotor.d" "Modules\Stubs_Handler\Stub_TempSensor.d" "Modules\Stubs_Handler\Stub_TivaReg.d" "Modules\Stubs_Handler\Stub_Valve.d" "Modules\Stubs_Handler\User_Leds.d" "Modules\Stubs_Handler\temperature_sensor.d" "Modules\Thread\ThreadLoad.d" "Modules\Thread\Thread_BIT.d" "Modules\Thread\Thread_Winder.d" "Modules\Thread\Thread_init.d" "Modules\Thread\Thread_maint.d" "Modules\Thread\Thread_print.d" "Modules\Waste\Waste_BIT.d" "Modules\Waste\Waste_init.d" + -$(RM) "Modules\Waste\Waste_maint.d" "Modules\Waste\newWHS_init.d" "StateMachines\Initialization\InitSequence.d" "StateMachines\Initialization\PowerIdle.d" "StateMachines\Initialization\PowerOffSequence.d" "StateMachines\Printing\JobSTM.d" "StateMachines\Printing\PrintingSTM.d" -@echo 'Finished clean' -@echo ' ' @@ -916,7 +887,7 @@ pre-build: -@echo ' ' post-build: - -"C:/TI/ccsv7/utils/tiobj2bin/tiobj2bin" "Embedded.out" "Embedded.bin" "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armofd" "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armhex" "C:/TI/ccsv7/utils/tiobj2bin/mkhex4bin" + -"C:/ti/ccsv7/utils/tiobj2bin/tiobj2bin" "Embedded.out" "Embedded.bin" "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armofd" "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armhex" "C:/ti/ccsv7/utils/tiobj2bin/mkhex4bin" -@echo ' ' .PHONY: all clean dependents diff --git a/Software/Embedded_SW/Embedded/debug_w_pmr/sources.mk b/Software/Embedded_SW/Embedded/debug_w_pmr/sources.mk index 5e25513c4..a7125af0d 100644 --- a/Software/Embedded_SW/Embedded/debug_w_pmr/sources.mk +++ b/Software/Embedded_SW/Embedded/debug_w_pmr/sources.mk @@ -171,8 +171,6 @@ Drivers/I2C_Communication/Head_Card/PT100 \ Drivers/I2C_Communication \ Drivers/I2C_Communication/Main_Board_EEPROM \ Drivers/I2C_Communication/RFID_NFC \ -Drivers/I2C_Communication/RFID_NFC/NFC_I2C \ -Drivers/I2C_Communication/RFID_NFC/PN7150 \ Drivers/I2C_Communication/RFID_NFC/logi-tag \ Drivers/I2C_Communication/Thermo_K \ Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat \ @@ -192,11 +190,6 @@ Drivers/SSI_Comm \ Drivers/SSI_Comm/Speed_Sensor \ Drivers/USB_Communication \ Drivers/Uart_Comm \ -Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/ascii \ -Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/functions \ -Drivers/Uart_Comm/WHS_Controller_Comm/Modbus \ -Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/rtu \ -Drivers/Uart_Comm/WHS_Controller_Comm/Modbus/tcp \ Drivers/Uart_Comm/WHS_Controller_Comm/Shinko \ Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART \ Drivers/Valves \ diff --git a/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_rules.mk b/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_rules.mk index c9da089bb..6ac9b689c 100644 --- a/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_rules.mk +++ b/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_rules.mk @@ -6,13 +6,13 @@ SHELL = cmd.exe # Each subdirectory must supply rules for building sources it contributes build-306001487: - @$(MAKE) -Onone -f subdir_rules.mk build-306001487-inproc + @$(MAKE) --no-print-directory -Onone -f subdir_rules.mk build-306001487-inproc build-306001487-inproc: ../Embedded.cfg - @echo 'Building file: $<' + @echo 'Building file: "$<"' @echo 'Invoking: XDCtools' - "C:/TI/xdctools_3_32_00_06_core/xs" --xdcpath="C:/ti/tirtos_tivac_2_16_00_08/packages;C:/ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08/packages;C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages;C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages;C:/ti/tirtos_tivac_2_16_00_08/products/uia_2_00_05_50/packages;C:/ti/tirtos_tivac_2_16_00_08/products/ns_1_11_00_10/packages;C:/ti/TivaWare_C_Series-2.1.2.111;C:/TI/ccsv7/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C129XNCZAD -r release -c "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS" --compileOptions "-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me" "$<" - @echo 'Finished building: $<' + "C:/ti/xdctools_3_32_00_06_core/xs" --xdcpath="C:/ti/tirtos_tivac_2_16_00_08/packages;C:/ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08/packages;C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages;C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages;C:/ti/tirtos_tivac_2_16_00_08/products/uia_2_00_05_50/packages;C:/ti/tirtos_tivac_2_16_00_08/products/ns_1_11_00_10/packages;C:/ti/TivaWare_C_Series-2.1.2.111;C:/ti/ccsv7/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C129XNCZAD -r release -c "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS" --compileOptions "-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me" "$<" + @echo 'Finished building: "$<"' @echo ' ' configPkg/linker.cmd: build-306001487 ../Embedded.cfg @@ -20,17 +20,10 @@ configPkg/compiler.opt: build-306001487 configPkg/: build-306001487 Main.obj: ../Main.c $(GEN_OPTS) | $(GEN_HDRS) - @echo 'Building file: $<' + @echo 'Building file: "$<"' @echo 'Invoking: ARM Compiler' - "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages/ti/ndk/inc/bsd" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Common/protobuf-c" --include_path="C:/Tango/Software/Embedded_SW/Embedded" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Hardware" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Printing" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Common" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Debugging" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Common" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Modules" --include_path="C:/ti/TivaWare_C_Series-2.1.2.111" --include_path="C:/ti/xdctools_3_32_00_06_core/include" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08" --include_path="C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include" --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="Main.d_raw" $(GEN_OPTS__FLAG) "$<" - @echo 'Finished building: $<' - @echo ' ' - -delay.obj: ../delay.c $(GEN_OPTS) | $(GEN_HDRS) - @echo 'Building file: $<' - @echo 'Invoking: ARM Compiler' - "C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages/ti/ndk/inc/bsd" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Common/protobuf-c" --include_path="C:/Tango/Software/Embedded_SW/Embedded" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Hardware" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Printing" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Common" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Debugging" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Common" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Modules" --include_path="C:/ti/TivaWare_C_Series-2.1.2.111" --include_path="C:/ti/xdctools_3_32_00_06_core/include" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08" --include_path="C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include" --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="delay.d_raw" $(GEN_OPTS__FLAG) "$<" - @echo 'Finished building: $<' + "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages/ti/ndk/inc/bsd" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Common/protobuf-c" --include_path="C:/Tango/Software/Embedded_SW/Embedded" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Hardware" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Printing" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Common" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Debugging" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication/PMR" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Communication" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Common" --include_path="C:/Tango/Software/Embedded_SW/Embedded/Modules" --include_path="C:/ti/TivaWare_C_Series-2.1.2.111" --include_path="C:/ti/xdctools_3_32_00_06_core/include" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include" --define=ENABLE_LFN --define=DEBUG_TEST_FUNCTIONS --define=TARGET_IS_TM4C129_RA0 --define=ccs="ccs" --define=ccs --define=TIVAWARE --define=PART_TM4C129XNCZAD -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="Main.d_raw" $(GEN_OPTS__FLAG) "$<" + @echo 'Finished building: "$<"' @echo ' ' diff --git a/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_vars.mk b/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_vars.mk index 7aa0e8205..9e69ad7a4 100644 --- a/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_vars.mk +++ b/Software/Embedded_SW/Embedded/debug_w_pmr/subdir_vars.mk @@ -12,8 +12,7 @@ CMD_SRCS += \ ../tm4c129xnczad.cmd C_SRCS += \ -../Main.c \ -../delay.c +../Main.c GEN_CMDS += \ ./configPkg/linker.cmd @@ -26,33 +25,28 @@ GEN_MISC_DIRS += \ ./configPkg/ C_DEPS += \ -./Main.d \ -./delay.d +./Main.d GEN_OPTS += \ ./configPkg/compiler.opt OBJS += \ -./Main.obj \ -./delay.obj +./Main.obj GEN_MISC_DIRS__QUOTED += \ "configPkg\" OBJS__QUOTED += \ -"Main.obj" \ -"delay.obj" +"Main.obj" C_DEPS__QUOTED += \ -"Main.d" \ -"delay.d" +"Main.d" GEN_FILES__QUOTED += \ "configPkg\linker.cmd" \ "configPkg\compiler.opt" C_SRCS__QUOTED += \ -"../Main.c" \ -"../delay.c" +"../Main.c" diff --git a/Software/Embedded_SW/Embedded/src/makefile.libs b/Software/Embedded_SW/Embedded/src/makefile.libs index ae6999352..f262762ef 100644 --- a/Software/Embedded_SW/Embedded/src/makefile.libs +++ b/Software/Embedded_SW/Embedded/src/makefile.libs @@ -1,6 +1,6 @@ # # This file was generated based on the configuration script: -# C:\tango\Software\Embedded_SW\Embedded\Embedded.cfg +# C:\Tango\Software\Embedded_SW\Embedded\Embedded.cfg # # This makefile may be included in other makefiles that need to build # the libraries containing the compiled source files generated as @@ -14,7 +14,7 @@ # # The absolute path to the generated source directory (at the time the # sources were generated) is: -# C:\tango\Software\Embedded_SW\Embedded\src +# C:\Tango\Software\Embedded_SW\Embedded\src # GEN_SRC_DIR ?= ../src diff --git a/Software/Embedded_SW/Embedded/src/sysbios/makefile b/Software/Embedded_SW/Embedded/src/sysbios/makefile index a8280a913..b1ccf442b 100644 --- a/Software/Embedded_SW/Embedded/src/sysbios/makefile +++ b/Software/Embedded_SW/Embedded/src/sysbios/makefile @@ -10,7 +10,7 @@ XDC_ROOT = C:/ti/xdctools_3_32_00_06_core/packages/ BIOS_ROOT = C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/ -BIOS_DEFS = -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=16 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=16 -Dti_sysbios_knl_Task_checkStackFlag__D=TRUE -Dti_sysbios_knl_Task_initStackFlag__D=TRUE -Dti_sysbios_knl_Task_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_PERIODIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=TRUE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_utils_Load_hwiEnabled__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=TRUE +BIOS_DEFS = -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=16 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=16 -Dti_sysbios_knl_Task_checkStackFlag__D=TRUE -Dti_sysbios_knl_Task_initStackFlag__D=TRUE -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_PERIODIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=TRUE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_utils_Load_hwiEnabled__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=TRUE BIOS_INC = -I"C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/" @@ -18,9 +18,9 @@ TARGET_INC = -I"C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ INCS = $(BIOS_INC) $(TARGET_INC) -CC = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/include -ASM = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/include -AR = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/bin/armar rq +CC = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include +ASM = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include +AR = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armar rq DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f diff --git a/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f b/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f index 5708939be..41e969041 100644 Binary files a/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f and b/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f differ -- cgit v1.3.1 From 0c038093d83f8e266f09f489cd93dda3dbc6ab3f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 27 Aug 2020 16:08:47 +0300 Subject: 4 winders test; keep alive embedded==>management. procedures. --- .../Embedded/Communication/Connection.c | 46 +- .../Embedded/Communication/Connection.h | 1 + .../Embedded_SW/Embedded/Communication/Container.c | 6 +- .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 18 +- .../Embedded/Drivers/SSI_Comm/SSI_Comm.h | 4 +- .../Embedded/Drivers/flash_ram/MCU_E2Prom.h | 2 + .../Embedded/Modules/Control/MillisecTask.c | 9 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 24 + .../Embedded/Modules/General/GeneralHardware.c | 6 + .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 4 +- Software/Embedded_SW/Embedded/Modules/IFS/ifs.h | 1 + .../Embedded_SW/Embedded/Modules/Thread/Thread.h | 2 +- .../Embedded/Modules/Thread/Thread_Winder.c | 22 +- .../Embedded/Modules/Thread/Thread_ex.h | 7 +- .../Embedded/Modules/Thread/Thread_init.c | 64 +- .../Embedded/Modules/Thread/Thread_print.c | 126 ++- .../Embedded/Modules/Waste/Waste_maint.c | 2 +- .../Procedures/Mid tank calibration.pproj | 478 ++++++++- .../Stubs Collection/Procedures/Priming1.pproj | 1015 ++++++++++++++++++++ .../WHS_waste_Tank_Calibration_Save_V0.pproj | 107 +++ 20 files changed, 1879 insertions(+), 65 deletions(-) create mode 100644 Software/Stubs Collection/Procedures/Priming1.pproj create mode 100644 Software/Stubs Collection/Procedures/WHS_waste_Tank_Calibration_Save_V0.pproj (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread.h') diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index aa0db0ea9..c7077124c 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -139,7 +139,7 @@ void DisconnectionRequest(MessageContainer* requestContainer) int KeepAliveOneSecondCounter = 0; #define KEEPALIVE_COMMUNICATION_ABORT_LIMIT 10 bool KeepAliveActive = false; -bool keepalivetest = false; +bool keepalivetest = true; void KeepAliveRequestFunc(MessageContainer* requestContainer) { MessageContainer responseContainer; @@ -158,12 +158,50 @@ void KeepAliveRequestFunc(MessageContainer* requestContainer) SendChars((char*)container_buffer, container_size); //keep_alive_request__free_unpacked(request,NULL); } + +int KARequestId = 0x01010101; +char KARequestToken[36+1]; +void KeepAliveResponseFunc(MessageContainer* requestContainer) +{ + //KeepAliveRequest* request = + KeepAliveResponse *response = keep_alive_response__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + if (strcmp(requestContainer->token,KARequestToken)==0) + { + if (keepalivetest == false) + KeepAliveOneSecondCounter = 0; + KeepAliveActive = true; + //Report("keepalive response received",__FILE__,__LINE__,KARequestId,RpWarning,msec_millisecondCounter, 0); + } + keep_alive_response__free_unpacked(response,NULL); +} + +void KeepAliveRequest1Second(void) +{ + MessageContainer responseContainer; + + KeepAliveResponse request = KEEP_ALIVE_REQUEST__INIT; + + strcpy(KARequestToken,"Happy days are coming to us, soon"); + memcpy(&KARequestToken[32],&KARequestId,sizeof(KARequestId)); + KARequestId++; + //Report("keepalive request sent",__FILE__,__LINE__,KARequestId,RpWarning,msec_millisecondCounter, 0); + + if (keepalivetest == false) + KeepAliveOneSecondCounter = 0; + //KeepAliveActive = true; + responseContainer = createContainer(MESSAGE_TYPE__KeepAliveRequest, KARequestToken, true, &request, &keep_alive_request__pack, &keep_alive_request__get_packed_size); + //------------------------------------------------------------------------------------------- + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars((char*)container_buffer, container_size); +} void KeepAliveOneSecondCall(void) { - if (KeepAliveActive == false) - return; if (FileUploadGetState()==false) return; + KeepAliveRequest1Second(); + if (KeepAliveActive == false) + return; KeepAliveOneSecondCounter++; if (KeepAliveOneSecondCounter > (KEEPALIVE_COMMUNICATION_ABORT_LIMIT/2)) @@ -181,7 +219,7 @@ void KeepAliveOneSecondCall(void) JobStopReporting(); //AlarmHandlingStop(); //CommunicationMailboxFlush(); - keepalivetest = false; + //keepalivetest = false; //USBCDCD_init(); USBCDCD_Reinit(); //UART_ResetBuffers(); diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.h b/Software/Embedded_SW/Embedded/Communication/Connection.h index 8089cd82f..c0a31344f 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.h +++ b/Software/Embedded_SW/Embedded/Communication/Connection.h @@ -12,6 +12,7 @@ void ConnectionRequest(MessageContainer* requestContainer); void DisconnectionRequest(MessageContainer* requestContainer); void KeepAliveRequestFunc(MessageContainer* requestContainer); +void KeepAliveResponseFunc(MessageContainer* requestContainer); void KeepAliveOneSecondCall(void); extern int KeepAliveOneSecondCounter; diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 64f06a8c5..b14efbd55 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -42,6 +42,7 @@ #include "Modules/General/process.h" #include "Modules/Thread/Thread_ex.h" #include "Modules/Ids/Ids_ex.h" +#include "Modules/Ifs/Ifs.h" #include "Common/SWUpdate/FileSystem.h" #include "Common/SWUpdate/FirmwareUpgrade.h" @@ -142,7 +143,7 @@ void receive_callback(char* buffer, size_t length) if (requestContainer == NULL) return; #ifndef DISPESER_TEST - if ((requestContainer->type>= MESSAGE_TYPE__StartDiagnosticsRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)) //user action resets the idle counter + if ((requestContainer->type>= MESSAGE_TYPE__StartDiagnosticsRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveResponse)) //user action resets the idle counter { ReportWithPackageFilter(CommFilter,"Message received", __FILE__,__LINE__,requestContainer->type, RpMessage,length, 0); } @@ -411,6 +412,9 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__KeepAliveRequest: KeepAliveRequestFunc(requestContainer); break; + case MESSAGE_TYPE__KeepAliveResponse: + KeepAliveResponseFunc(requestContainer); + break; case MESSAGE_TYPE__FileUploadRequest: FileUploadRequestFunc(requestContainer); break; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index fda349f69..9c5c52bb9 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -335,13 +335,13 @@ void FPGA_GetBusy() F1MOTNBUSY1 F1_MOT_NBUSY1; F1MOTNBUSY2 F1_MOT_NBUSY2; F2MOTNBUSY1 F2_MOT_NBUSY1; - //F3MOTNBUSY1 F3_MOT_NBUSY1; - for spare motors + F3MOTNBUSY1 F3_MOT_NBUSY1; //- for spare motors F1SPIBUSY1 F1_SPI_BUSY1; F1SPIBUSY2 F1_SPI_BUSY2; F2SPIBUSY1 F2_SPI_BUSY1; F2SPIBUSY2 F2_SPI_BUSY2; - //F3SPIBUSY1 F3_SPI_BUSY1; - for spare motors + F3SPIBUSY1 F3_SPI_BUSY1;// - for spare motors //Read NBUSY from FPGA unsigned short readValue = 0; @@ -351,14 +351,15 @@ void FPGA_GetBusy() F1_MOT_NBUSY2.ushort = (uint16_t) ~((unsigned int) readValue); readValue = F2_Moto_Driver_NBUSY1_D; F2_MOT_NBUSY1.ushort = (uint16_t) ~((unsigned int) readValue); - //F3_MOT_NBUSY1.ushort = F3_Moto_Driver_NBUSY1_D; - for spare motors + readValue = F3_Moto_Driver_NBUSY1_D; + F3_MOT_NBUSY1.ushort = (uint16_t) ~((unsigned int) readValue);; // - for spare motors //Read SPI BUSY from FPGA F1_SPI_BUSY1.ushort = F1_SPI_Busy1_D; F1_SPI_BUSY2.ushort = F1_SPI_Busy2_D; F2_SPI_BUSY1.ushort = F2_SPI_Busy1_D; F2_SPI_BUSY2.ushort = F2_SPI_Busy2_D; - //F3_SPI_BUSY1.ushort = F3_SPI_Busy1_D; - for spare motors + F3_SPI_BUSY1.ushort = F3_SPI_Busy1_D; // - for spare motors MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD].Busy = (F1_MOT_NBUSY1.bits.F1_MOTO_DH_CLEANHEAD_A1_NBUSY) | F1_SPI_BUSY1.bits.F1_MOTO_DH_CLEANHEAD_A1_SDI_busy; MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH].Busy = (F1_MOT_NBUSY1.bits.F1_MOTO_DH_CLEANMECH_A1_NBUSY) | F1_SPI_BUSY1.bits.F1_MOTO_DH_CLEANMECH_A1_SDI_busy; @@ -381,10 +382,17 @@ void FPGA_GetBusy() MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_LDRIVING].Busy = (F1_MOT_NBUSY1.bits.F1_MOTO_LDRIVING_A1_NBUSY) | F1_SPI_BUSY1.bits.F1_MOTO_LDRIVING_A1_SDI_busy; MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].Busy = (F1_MOT_NBUSY1.bits.F1_MOTO_LLOADING_A1_NBUSY) | F1_SPI_BUSY1.bits.F1_MOTO_LLOADING_A1_SDI_busy; MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_LPIVOT1].Busy = (F1_MOT_NBUSY1.bits.F1_MOTO_LPIVOT1_A1_NBUSY) | F1_SPI_BUSY2.bits.F1_MOTO_LPIVOT1_A1_SDI_busy; - MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].Busy = (F1_MOT_NBUSY2.bits.F1_MOTO_RDANCER_A1_NBUSY) | F1_SPI_BUSY2.bits.F1_MOTO_RDANCER_A1_SDI_busy; + MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].Busy = (F1_MOT_NBUSY2.bits.F1_MOTO_RDANCER_A1_NBUSY) & F1_SPI_BUSY2.bits.F1_MOTO_RDANCER_A1_SDI_busy; MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].Busy = (F1_MOT_NBUSY2.bits.F1_MOTO_RDRIVING_A1_NBUSY) | F1_SPI_BUSY1.bits.F1_MOTO_RDRIVING_A1_SDI_busy; MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].Busy = (F1_MOT_NBUSY2.bits.F1_MOTO_RLOADING_A1_NBUSY) | F1_SPI_BUSY1.bits.F1_MOTO_RLOADING_A1_SDI_busy; + MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_SPARE1_1].Busy = (F3_MOT_NBUSY1.bits.F3_MOTO_SPARE1_1_A1_NBUSY) | F3_SPI_BUSY1.bits.F3_MOTO_SPARE1_1_A1_SDI_busy; + MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_SPARE1_2].Busy = (F3_MOT_NBUSY1.bits.F3_MOTO_SPARE1_2_A1_NBUSY) | F3_SPI_BUSY1.bits.F3_MOTO_SPARE1_2_A1_SDI_busy; + MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_SPARE2_1].Busy = (F3_MOT_NBUSY1.bits.F3_MOTO_SPARE2_1_A1_NBUSY) | F3_SPI_BUSY1.bits.F3_MOTO_SPARE2_1_A1_SDI_busy; + MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_SPARE2_2].Busy = (F3_MOT_NBUSY1.bits.F3_MOTO_SPARE2_2_A1_NBUSY) | F3_SPI_BUSY1.bits.F3_MOTO_SPARE2_2_A1_SDI_busy; + + + TempSensorResponse[TEMP_SENSE_ANALOG_MIXCHIP_TEMP].Busy = F2_SPI_BUSY1.bits.F2_ANALOG_MIXCHIP_TEMP_1_BUSY; TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP1].Busy = F2_SPI_BUSY1.bits.F2_ANALOG_DYEINGH_TEMP1_1_BUSY; TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP2].Busy = F2_SPI_BUSY1.bits.F2_ANALOG_DYEINGH_TEMP2_1_BUSY; diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h index f726baeb4..79239835f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/SSI_Comm.h @@ -27,8 +27,8 @@ typedef enum Dancers4Winders { - HARDWARE_DANCER_0 = 0, - HARDWARE_DANCER_1 = 1, + HARDWARE_DANCER_0 = 0, //winder + HARDWARE_DANCER_1 = 1, // puller HARDWARE_DANCER_2 = 2, HARDWARE_DANCER_3 = 3, HARDWARE_DANCER_4 = 4, diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h index bbbc49c7d..3331241cb 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h @@ -42,6 +42,8 @@ typedef enum { EEPROM_PULLER_TENSION_POSITION, EEPROM_WINDER_TENSION_POSITION, EEPROM_INIT_FAILURE_COUNTER, + EEPROM_STORAGE_DANCER_3, + EEPROM_STORAGE_DANCER_4, MAX_EEPROM_STORAGE }EEPROM_STORAGE_USAGE_ENUM; #define MAX_SERIAL_NUM_LEN 5 //5*4 bytes diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 327b5d19b..55148e655 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -496,9 +496,17 @@ uint32_t MillisecLoop(uint32_t tick) #ifdef test_RTFU_dancer test_dancer_responce_RTFU(); #else +#ifdef FOUR_WINDERS + Dancer_Data[HARDWARE_DANCER_0] = Read_Dancer_Position(HARDWARE_DANCER_0); + Dancer_Data[HARDWARE_DANCER_1] = Read_Dancer_Position(HARDWARE_DANCER_1); + Dancer_Data[HARDWARE_DANCER_2] = Read_Dancer_Position(HARDWARE_DANCER_2); + Dancer_Data[HARDWARE_DANCER_3] = Read_Dancer_Position(HARDWARE_DANCER_3); + Dancer_Data[HARDWARE_DANCER_4] = Read_Dancer_Position(HARDWARE_DANCER_4); +#else Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(FEEDER_DANCER); Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(POOLER_DANCER); Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER); +#endif #endif #endif @@ -732,7 +740,6 @@ uint32_t MillisecLowLoop(uint32_t tick) //static int Counter = 0; MachineUpdateResponseFunc(); //KeepAliveOneSecondCall(); - //TemperatureListString(Lenstr); //ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)Counter++,RpWarning,(int) msec_millisecondCounter,0); for (Sensor_i = StartPT100;Sensor_i < MAX_HEAD_CARD_TEMP_SENS_ID;Sensor_i++) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index a76142b00..05987ee7f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -17,6 +17,7 @@ #include "drivers/Motors/Motor.h" #include "drivers/Heater/TemperatureSensor.h" #include "drivers/SSI_Comm/Dancer/Dancer.h" +#include #include "drivers/FPGA/FPGA_SPI_Comm.h" #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/FPGA/FPGA.h" @@ -407,6 +408,9 @@ void DiagnosticLoadDancerError(int DancerId, double value) // DancerErrorCounterIndex[DancerId] = 0; } +#ifdef FOUR_WINDERS + double dancer2,dancer3,dancer4; +#endif void CopyTemperaturesToMonitor(void) { DiagnosticsMonitor.mixertemperature = @@ -511,6 +515,18 @@ void CopyTemperaturesToMonitor(void) DiagnosticsMonitor.headblowervoltage2 = &headblowervoltage2; DiagnosticsMonitor.n_headblowervoltage1 = 1; DiagnosticsMonitor.n_headblowervoltage2 = 1; +#ifdef FOUR_WINDERS +// double dancer2,dancer3,dancer4; + dancer2 = Control_Read_Dancer_Position(HARDWARE_DANCER_2,0); + dancer3 = Control_Read_Dancer_Position(HARDWARE_DANCER_3,0); + dancer4 = Control_Read_Dancer_Position(HARDWARE_DANCER_4,0); + DiagnosticsMonitor.n_headblower1airflow = 1; + DiagnosticsMonitor.n_headblower2airflow = 1; + DiagnosticsMonitor.headblower1airflow = &dancer4; + DiagnosticsMonitor.headblower2airflow = &dancer3; + DiagnosticsMonitor.headblowervoltage1 = &dancer2; + DiagnosticsMonitor.n_headblowervoltage1 = 1; +#endif DiagnosticsMonitor.dryerzone1temperature = HeaterTemperature[HEATER_TYPE__DryerAirHeater]; DiagnosticsMonitor.dryerzone2temperature = @@ -975,11 +991,19 @@ void Diagnostic100msecCollection(void) { //if (JobIsActive()) { +#ifdef FOUR_WINDERS + DiagnosticLoadMotor(FEEDER_MOTOR, ThreadGetMotorSpeed (WINDER_2_MOTOR)); + DiagnosticLoadMotor(DRYER_MOTOR, ThreadGetMotorSpeed (WINDER_3_MOTOR)); + DiagnosticLoadMotor(POOLER_MOTOR, ThreadGetMotorSpeed (WINDER_4_MOTOR)); + DiagnosticLoadMotor(WINDER_MOTOR, ThreadGetMotorSpeed (WINDER_MOTOR)); + DiagnosticLoadMotor(SCREW_MOTOR, ThreadGetMotorSpeed (SCREW_MOTOR)); +#else DiagnosticLoadMotor(FEEDER_MOTOR, ThreadGetMotorSpeed (FEEDER_MOTOR)); DiagnosticLoadMotor(DRYER_MOTOR, ThreadGetMotorSpeed (DRYER_MOTOR)); DiagnosticLoadMotor(POOLER_MOTOR, ThreadGetMotorSpeed (POOLER_MOTOR)); DiagnosticLoadMotor(WINDER_MOTOR, ThreadGetMotorSpeed (WINDER_MOTOR)); DiagnosticLoadMotor(SCREW_MOTOR, ThreadGetMotorSpeed (SCREW_MOTOR)); +#endif } for (i=0;i +#include "drivers/FPGA/Full_Vme/FPGA_Programming_Up.h" #include "StateMachines/Printing/PrintingSTM.h" #include "StateMachines/Initialization/InitSequence.h" @@ -431,6 +432,11 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) LOG_ERROR(1,"JobIsActive"); return ERROR; } + if (FPGABurningActive == true) + { + LOG_ERROR(1,"FPGABurningActive"); + return ERROR; + } if (watchdogCriticalAlarm == true) { LOG_ERROR(1,"Critical Alarm cleared - Watchdog de-activated"); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 9c82cb1bf..c0ccefde1 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1118,8 +1118,8 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0) IDS_Cleaning_Stop_Cleaning_Solution (NULL); setRapidPressureRead(false); - if (JobEndSequence == true) - DistanceToSpoolReady(Module_IDS,ModuleDone); + //if (JobEndSequence == true) + // DistanceToSpoolReady(Module_IDS,ModuleDone); } if (EnableCleaning == true) { diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h index 1edc03264..0f95fb2e2 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h @@ -27,5 +27,6 @@ void ResponseDemo(int MidtankId); bool IFS_MidTankFilling(void); MidTank_t IFS_MidTankIsActive(void); bool IFS_CartridgeLowerPresent(); +bool CartridgeValidationResponseFunc(MessageContainer* requestContainer); #endif /* MODULES_IFS_IFS_H_ */ diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index 1f2da8dc0..13032f49d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -54,7 +54,7 @@ typedef struct #define MAX_THREAD_FEED_MOTORS (WINDER_MOTOR+1) -#define MAX_SYSTEM_DANCERS (HARDWARE_DANCER_TYPE__RightDancer+1) +#define MAX_SYSTEM_DANCERS NUM_OF_ROTENC extern TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM]; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 1ce27115d..852389001 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -347,10 +347,14 @@ int flipflop = 0; uint32_t motspeed; float speedf; int WinderCalculation = 0; +int MotorOrder[4] = {HARDWARE_MOTOR_TYPE__MOTO_SCREW,SCREW_2_Motor,SCREW_3_Motor,SCREW_4_Motor}; + + uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { //uint32_t Steps; double temp,tempScrewSpeed; + int i,tempmot; //double screw_horizontal_speed = 0; //double RotationsPerSecond; if (WinderMotorSpeedCounter++>=MAX_WINDER_SPEED_CALCULATION) @@ -369,6 +373,14 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) ScrewCurrentDirection = 1-ScrewCurrentDirection; CalculationDirectionChangeCounter++; +#ifdef FOUR_WINDERS + tempmot = MotorOrder[0]; + MotorOrder[0] = MotorOrder[1]; + MotorOrder[1] = MotorOrder[2]; + MotorOrder[2] = MotorOrder[3]; + MotorOrder[3] = tempmot; + //Report("order change" ,__FILE__,MotorOrder[0],MotorOrder[1],RpWarning,MotorOrder[2], 0); +#endif if (SampleWinding) return OK; //double calcsteps = (ScrewRunningTime/SYS_CLK_FREQ)*ScrewSpeed; @@ -707,11 +719,13 @@ void ScrewTimerInterrupt(int ARG0) MotorSetDirection (SCREW_3_Motor, ScrewCurrentDirection); MotorSetDirection (SCREW_4_Motor, ScrewCurrentDirection); #endif - MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed); #ifdef FOUR_WINDERS - MotorSetSpeedDirect (SCREW_2_Motor, ScrewSpeed); - MotorSetSpeedDirect (SCREW_3_Motor, ScrewSpeed); - MotorSetSpeedDirect (SCREW_4_Motor, ScrewSpeed); + MotorSetSpeedDirect(MotorOrder[0],ScrewSpeed); + MotorSetSpeedDirect (MotorOrder[1], ScrewSpeed); + MotorSetSpeedDirect (MotorOrder[2], ScrewSpeed); + MotorSetSpeedDirect (MotorOrder[3], ScrewSpeed); +#else + MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed); #endif #ifdef READ_SCREW_ENCODER Read_Screw_Encoder(); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 4339c5312..c3f181b52 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -9,7 +9,7 @@ #define WINDER_DANCER HARDWARE_DANCER_TYPE__LeftDancer #define POOLER_DANCER HARDWARE_DANCER_TYPE__MiddleDancer #define FEEDER_DANCER HARDWARE_DANCER_TYPE__RightDancer -#define NUM_OF_DANCERS (HARDWARE_DANCER_TYPE__RightDancer+1) +#define NUM_OF_DANCERS NUM_OF_ROTENC //} DANCER_ENUM; typedef enum threadMotorsEnum { @@ -17,6 +17,11 @@ typedef enum threadMotorsEnum DRYER_MOTOR, POOLER_MOTOR, WINDER_MOTOR, +#ifdef FOUR_WINDERS + WINDER_2_MOTOR, + WINDER_3_MOTOR, + WINDER_4_MOTOR, +#endif SCREW_MOTOR, MAX_THREAD_MOTORS_NUM }threadMotorsEnum; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index bbb3e4040..1920db03a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -151,6 +151,39 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request) temp = temp*3/2; } DancerStopActivityLimit[Motor_i] = temp/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); +#ifdef FOUR_WINDERS + if (Motor_i == WINDER_MOTOR) + { + int j,winderMotorId; + for (j=0;j<3;j++) + { + winderMotorId = j+WINDER_2_MOTOR; + memcpy (&MotorsControl[winderMotorId],request,sizeof(HardwarePidControl)); + if (MotorsControl[winderMotorId].pvinputfilterfactormode > MAX_CONTROL_SAMPLES) + MotorsControl[winderMotorId].pvinputfilterfactormode = MAX_CONTROL_SAMPLES; + #ifdef TEST_LONGER_PID_THREAD + MotorsControl[Motor_i].pvinputfilterfactormode = 10; //test longer control + #endif + for (i = 0;i < (int)MotorsControl[winderMotorId].pvinputfilterfactormode; i++) + { + MotorSamples[winderMotorId][i] = 0; //reset the samples value for control beginning + MotorSpeedSamples[winderMotorId][i] = 0; + } + NormalizedErrorCoEfficient[winderMotorId] = (2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); + temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits); + temp=(NORMAL_COEF_DIVIDER*(temp-1)*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm); + NormalizedErrorCoEfficient[winderMotorId] = NormalizedErrorCoEfficient[winderMotorId] / temp; + // uint32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES]; + temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits); + temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm);//*3/2); + if (Motor_i == WINDER_MOTOR) + { + temp = temp*3/2; + } + DancerStopActivityLimit[winderMotorId] = temp/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); + } + } +#endif return OK; } char DancerConfigPath[50] = "0://SysInfo//DancCfg.cfg"; @@ -159,31 +192,37 @@ uint32_t StoreDancerConfigMessage() { uint32_t status = OK; // FRESULT Fresult = FR_OK; - HardwareConfiguration DancerConfig; + //HardwareConfiguration DancerConfig; HardwareDancer Dancers[MAX_SYSTEM_DANCERS]; // uint8_t* response_buffer; // size_t response_size = 0; int Dancer_i; - hardware_configuration__init(&DancerConfig); - DancerConfig.dancers = (HardwareDancer**)my_malloc(sizeof(HardwareDancer*)*MAX_SYSTEM_DANCERS); + //hardware_configuration__init(&DancerConfig); + //DancerConfig.dancers = (HardwareDancer**)my_malloc(sizeof(HardwareDancer*)*MAX_SYSTEM_DANCERS); for (Dancer_i = 0; Dancer_i < MAX_SYSTEM_DANCERS; Dancer_i++) { hardware_dancer__init(&Dancers[Dancer_i]); - DancerConfig.dancers[Dancer_i] = &Dancers[Dancer_i]; + //DancerConfig.dancers[Dancer_i] = &Dancers[Dancer_i]; Dancers[Dancer_i].has_zeropoint = true; Dancers[Dancer_i].hardwaredancertype = Dancer_i; Dancers[Dancer_i].has_hardwaredancertype = true; - DancerConfig.dancers[Dancer_i]->zeropoint=Control_Read_Dancer_Position(Dancer_i,0); - DancerConfig.n_dancers++; - DancersCfg[Dancer_i].zeropoint = DancerConfig.dancers[Dancer_i]->zeropoint; + Dancers[Dancer_i].zeropoint=Control_Read_Dancer_Position(Dancer_i,0); + //DancerConfig.n_dancers++; + DancersCfg[Dancer_i].zeropoint = Dancers[Dancer_i].zeropoint; + DancersCfg[Dancer_i].zeropoint = Control_Read_Dancer_Position(Dancer_i,0); } status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_0,DancersCfg[0].zeropoint); status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_1,DancersCfg[1].zeropoint); status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_2,DancersCfg[2].zeropoint); Report("~~~~~~Store eeprom 0",__FILE__,DancersCfg[0].zeropoint,(int)DancersCfg[1].zeropoint,RpWarning,(int)DancersCfg[2].zeropoint,0); -/* +#ifdef FOUR_WINDERS + status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_3,DancersCfg[HARDWARE_DANCER_3].zeropoint); + status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_4,DancersCfg[HARDWARE_DANCER_4].zeropoint); + Report("~~~~~~Store eeprom 1",__FILE__,__LINE__,(int)DancersCfg[HARDWARE_DANCER_3].zeropoint,RpWarning,(int)DancersCfg[HARDWARE_DANCER_4].zeropoint,0); +#endif + /* response_buffer = my_malloc(hardware_configuration__get_packed_size(&DancerConfig)); if (response_buffer) { @@ -208,11 +247,18 @@ uint32_t LoadDancerConfigMessage() MCU_E2PromRead(EEPROM_STORAGE_DANCER_0,&DancersCfg[0].zeropoint); MCU_E2PromRead(EEPROM_STORAGE_DANCER_1,&DancersCfg[1].zeropoint); MCU_E2PromRead(EEPROM_STORAGE_DANCER_2,&DancersCfg[2].zeropoint); - +#ifdef FOUR_WINDERS + MCU_E2PromRead(EEPROM_STORAGE_DANCER_3,&DancersCfg[3].zeropoint); + MCU_E2PromRead(EEPROM_STORAGE_DANCER_4,&DancersCfg[4].zeropoint); +#endif status |= Report("Dancer 0 Store data eeprom ",__FILE__,__LINE__,0,RpWarning,(int)DancersCfg[0].zeropoint,0); status |= Report("Dancer 1 Store data eeprom ",__FILE__,__LINE__,1,RpWarning,(int)DancersCfg[1].zeropoint,0); status |= Report("Dancer 2 Store data eeprom ",__FILE__,__LINE__,2,RpWarning,(int)DancersCfg[2].zeropoint,0); +#ifdef FOUR_WINDERS + status |= Report("Dancer 3 Store data eeprom ",__FILE__,__LINE__,3,RpWarning,(int)DancersCfg[3].zeropoint,0); + status |= Report("Dancer 4 Store data eeprom ",__FILE__,__LINE__,4,RpWarning,(int)DancersCfg[4].zeropoint,0); +#endif return status; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 79832120b..7ec0ed5e5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -46,13 +46,15 @@ double CurrentControlledSpeed[MAX_THREAD_MOTORS_NUM] = {0}; -TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,HARDWARE_MOTOR_TYPE__MOTO_WINDER,HARDWARE_MOTOR_TYPE__MOTO_SCREW}; #ifdef FOUR_WINDERS -Dancers_4_Winders ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {FEEDER_DANCER,NUM_OF_DANCERS,POOLER_DANCER,WINDER_DANCER,NUM_OF_DANCERS}; +TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,HARDWARE_MOTOR_TYPE__MOTO_WINDER,Winder_2_Motor,Winder_3_Motor,Winder_4_Motor,HARDWARE_MOTOR_TYPE__MOTO_SCREW}; +Dancers_4_Winders ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {NUM_OF_DANCERS,NUM_OF_DANCERS,HARDWARE_DANCER_1,HARDWARE_DANCER_0,HARDWARE_DANCER_4,HARDWARE_DANCER_3,HARDWARE_DANCER_2,NUM_OF_DANCERS}; +uint32_t ControlIdtoMotorId [MAX_THREAD_MOTORS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; #else +TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,HARDWARE_MOTOR_TYPE__MOTO_WINDER,HARDWARE_MOTOR_TYPE__MOTO_SCREW}; HardwareDancerType ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {FEEDER_DANCER,NUM_OF_DANCERS,POOLER_DANCER,WINDER_DANCER,NUM_OF_DANCERS}; -#endif uint32_t ControlIdtoMotorId [MAX_THREAD_MOTORS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF}; +#endif uint32_t SpeedControlId=0xFF; uint32_t PoolerSpeedControlId=0xFF; @@ -432,7 +434,10 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue) uint16_t BreakSensorCounter = 0; uint16_t BreakSensorLatchCounter = 0; char TMessage[150]; - +#ifdef FOUR_WINDERS +char ATMessage[MAX_THREAD_MOTORS_NUM][150]; +int c = 0; +#endif uint32_t checkBreakSensor(uint32_t index) { if (BreakSensorenabled == true) @@ -550,7 +555,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //#define MAX_CONTROL_SAMPLES 6 //extern uint32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES]; //extern int MotorSamplePointer[MAX_THREAD_MOTORS_NUM]; - //read value is the dancer angle int i,index=MAX_THREAD_MOTORS_NUM; int len; @@ -621,6 +625,29 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //pooler dancer is right sided: data is opposite TranslatedReadValue = (-1*TranslatedReadValue); } +#ifdef FOUR_WINDERS + if (index == WINDER_MOTOR) + { + c++; + } + if (index == WINDER_2_MOTOR) + { + c++; + } + if (index == WINDER_3_MOTOR) + { + c++; + } + if (index == WINDER_4_MOTOR) + { + c++; + } + if ((index == WINDER_2_MOTOR)||(index == WINDER_3_MOTOR)) + { + //pooler dancer is right sided: data is opposite + TranslatedReadValue = (-1*TranslatedReadValue); + } +#endif if (index == POOLER_MOTOR) { //pooler dancer is right sided: data is opposite @@ -650,6 +677,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) ThreadControlActive = false; //MotorGetStatusFromFPGA(ThreadMotorIdToMotorId[index]); JobEndReason = JOB_WINDER_DANCER_FAIL+DancerId; +#ifdef FOUR_WINDERS + if (DancerId>HARDWARE_DANCER_2) + JobEndReason = JOB_WINDER_DANCER_FAIL+HARDWARE_DANCER_0; +#endif SendJobProgress(0.0,0,false, TMessage); //EndState(CurrentJob,TMessage ); SendSegmentFail(); @@ -702,24 +733,26 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) }*`/ }*/ calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index]; - if (index != WINDER_MOTOR) + if (index < WINDER_MOTOR) calculated_speed = calculated_speed*InitialDryerSpeed/OriginalMotorSpd_2PPS[DRYER_MOTOR]; //calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*CurrentControlledSpeed[index]; - if (0)//(JobCounter % 1000 == 0) - //if (JobCounter < 100)//(FirstCalcInJob == true) + //if (0)//(JobCounter % 1000 == 0) +#ifdef FOUR_WINDERS + if (JobCounter % 500 < 4)//(FirstCalcInJob == true) { - if (index == FEEDER_MOTOR) + if (index >= WINDER_MOTOR) { // FirstCalcInJob = false; - len = usnprintf(TMessage, 150, "read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d %d", + len = usnprintf(ATMessage[index], 150, "index %d read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d %d",index, TranslatedReadValue,avreageSampleValue,(int)(MotorControlConfig[index].m_mesuredParam*1000000), (int)(MotorControlConfig[index].m_integral*1000000000),(int)((MotorControlConfig[index].m_mesuredParam*MotorControlConfig[index].m_params.dt)*1000000000), (int)(MotorControlConfig[index].m_calculatedError*1000),(int)calculated_speed, (int)(InitialDryerSpeed*100/OriginalMotorSpd_2PPS[DRYER_MOTOR])); - ReportWithPackageFilter(ThreadFilter,TMessage,__FILE__,MotorSamplePointer[index],JobCounter,RpError,ReadValue,0); + ReportWithPackageFilter(ThreadFilter,ATMessage[index],__FILE__,MotorSamplePointer[index],JobCounter,RpError,ReadValue,0); } + JobCounter++; } - +#endif #ifndef TEST_PID_THREAD if (fabs(calculated_speed-CurrentControlledSpeed[index])> MotorControlConfig[index].m_ingnoreValue) #else @@ -735,14 +768,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) }*/ CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); -#ifdef FOUR_WINDERS - if (index == WINDER_MOTOR) - { - MotorSetSpeed(Winder_2_Motor, calculated_speed); - MotorSetSpeed(Winder_3_Motor, calculated_speed); - MotorSetSpeed(Winder_4_Motor, calculated_speed); - } -#endif } else { @@ -832,11 +857,32 @@ uint32_t HandleJobThreadControlParameters(ThreadParameters* ThreadParams) MotorControlConfig[POOLER_MOTOR].m_params.Kd = ThreadParams->pullerd; if(ThreadParams->winderp) + { MotorControlConfig[WINDER_MOTOR].m_params.Kp = ThreadParams->winderp; +#ifdef FOUR_WINDERS + MotorControlConfig[WINDER_2_MOTOR].m_params.Kp = ThreadParams->winderp; + MotorControlConfig[WINDER_3_MOTOR].m_params.Kp = ThreadParams->winderp; + MotorControlConfig[WINDER_4_MOTOR].m_params.Kp = ThreadParams->winderp; +#endif + } if(ThreadParams->winderi) + { MotorControlConfig[WINDER_MOTOR].m_params.Ki = ThreadParams->winderi; +#ifdef FOUR_WINDERS + MotorControlConfig[WINDER_2_MOTOR].m_params.Ki = ThreadParams->winderi; + MotorControlConfig[WINDER_3_MOTOR].m_params.Ki = ThreadParams->winderi; + MotorControlConfig[WINDER_4_MOTOR].m_params.Ki = ThreadParams->winderi; +#endif + } if(ThreadParams->winderd) + { MotorControlConfig[WINDER_MOTOR].m_params.Kd = ThreadParams->winderd; +#ifdef FOUR_WINDERS + MotorControlConfig[WINDER_2_MOTOR].m_params.Kd = ThreadParams->winderd; + MotorControlConfig[WINDER_3_MOTOR].m_params.Kd = ThreadParams->winderd; + MotorControlConfig[WINDER_4_MOTOR].m_params.Kd = ThreadParams->winderd; +#endif + } ReportWithPackageFilter(ThreadFilter,"Rockers activity",__FILE__,__LINE__,(int)Thread_Rockers_Bypass,RpWarning,(int)ThreadParams->bypassrockers,0); if(ThreadParams->bypassrockers) Thread_Rockers_Bypass = true; @@ -1032,13 +1078,14 @@ uint32_t ThreadPrepareState(void *JobDetails) IntersegmentLength = JobTicket->intersegmentlength; PrepareWaitCount = 0; +#ifndef FOUR_WINDERS status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0); status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpWarning,(int)pullertension,0); status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpWarning,(int)feedertension,0); - +#endif FirstCalcInJob = true; if(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].speedmaster == false) { @@ -1098,6 +1145,11 @@ uint32_t ThreadPrepareState(void *JobDetails) { HW_Motor_Id = ThreadMotorIdToMotorId[Motor_i]; Pid_Id = Motor_i;/*ThreadMotorIdToControlId[Motor_i];*/ +#ifdef FOUR_WINDERS + if (Motor_i == WINDER_2_MOTOR) Pid_Id = WINDER_MOTOR; + if (Motor_i == WINDER_3_MOTOR) Pid_Id = WINDER_MOTOR; + if (Motor_i == WINDER_4_MOTOR) Pid_Id = WINDER_MOTOR; +#endif MotorControlConfig[Motor_i].m_params.MAX = 1; MotorControlConfig[Motor_i].m_params.MIN = MotorsControl[Pid_Id].outputproportionalpowerlimit*-1; MotorControlConfig[Motor_i].m_params.Kd = MotorsControl[Pid_Id].derivativetime; @@ -1116,7 +1168,6 @@ uint32_t ThreadPrepareState(void *JobDetails) MotorControlConfig[Motor_i].m_preError = 0; MotorControlConfig[Motor_i].m_SetParam = 0;//need to update SetParams on presegment stage - HandleJobThreadControlParameters(JobTicket->threadparameters); //OVERRIDES CONFIGURATION PARAMETERS!!! temp_dt = MotorControlConfig[Motor_i].m_params.dt/0.001; MotorTiming[Motor_i] = (int)temp_dt; @@ -1208,9 +1259,26 @@ uint32_t ThreadPrepareState(void *JobDetails) } #ifndef TEST_PID_THREAD ControlIdtoMotorId[Motor_i] = AddControlCallback(NULL,ThreadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); +#endif + } +#ifdef FOUR_WINDERS + if ((Motor_i == WINDER_2_MOTOR)||(Motor_i == WINDER_3_MOTOR)||(Motor_i == WINDER_4_MOTOR)) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled + { + ReportWithPackageFilter(ThreadFilter,"Winder 2/3/4 Control",__FILE__,Motor_i,MotorControlConfig[WINDER_MOTOR].m_params.Kp,RpWarning,MotorControlConfig[WINDER_MOTOR].m_params.Ki,0); + if (ControlIdtoMotorId[Motor_i] != 0xFF) + { + if(RemoveControlCallback(ControlIdtoMotorId[Motor_i],ThreadControlCBFunction)!=OK) + ReportWithPackageFilter(ThreadFilter,"Remove Control Failed.",__FILE__,__LINE__,(int)Motor_i,RpError,(int)PoolerSpeedControlId,0); + CurrentControlledSpeed[Motor_i] = 0; + ControlIdtoMotorId[Motor_i] = 0xFF; + } +#ifndef TEST_PID_THREAD + ControlIdtoMotorId[Motor_i] = AddControlCallback(NULL,ThreadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); +#endif #endif } } + HandleJobThreadControlParameters(JobTicket->threadparameters); //OVERRIDES CONFIGURATION PARAMETERS!!! #ifdef TEST_PID_THREAD testDancersControl(); @@ -1274,7 +1342,7 @@ uint32_t UpdatePidDuringRun(HardwarePidControl *request) void SetOriginMotorSpeed(float process_speed) { int Motor_i, HW_Motor_Id; - for (Motor_i = 0; Motor_i <= WINDER_MOTOR; Motor_i++) + for (Motor_i = 0; Motor_i < SCREW_MOTOR; Motor_i++) { HW_Motor_Id = ThreadMotorIdToMotorId[Motor_i]; //(Speed*uStep*PPR)/((2*PI*motor_Radius) @@ -1509,7 +1577,7 @@ char Endstr[150]; PoolerSpeedControlId = 0xFF; } - for ( Motor_i = 0;Motor_i <= WINDER_MOTOR;Motor_i++) + for ( Motor_i = 0;Motor_i < SCREW_MOTOR;Motor_i++) { if (ControlIdtoMotorId[Motor_i] != 0xFF) { @@ -1522,17 +1590,9 @@ char Endstr[150]; } Task_sleep(100); - for ( Motor_i = 0;Motor_i <= WINDER_MOTOR;Motor_i++) + for ( Motor_i = 0;Motor_i < SCREW_MOTOR;Motor_i++) { MotorStop(ThreadMotorIdToMotorId[Motor_i],Hard_Hiz); -#ifdef FOUR_WINDERS - if (Motor_i == WINDER_MOTOR) - { - MotorStop(Winder_2_Motor, Hard_Hiz); - MotorStop(Winder_3_Motor, Hard_Hiz); - MotorStop(Winder_4_Motor, Hard_Hiz); - } -#endif } MotorStop(HARDWARE_MOTOR_TYPE__MOTO_RLOADING,Hard_Hiz); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 222b618d2..7c29a909b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -76,7 +76,7 @@ void cartCART_EXTRACTED(WasteCartridgeEnum CartId) //{called from polling functi } WasteCartridgeEnum cartSELECT_CART(void) //{ if there is no SELECTED cartridge select the first cartridge in IN state. If there is none, return -1} { - Report("Cartridges select cart", __FILE__, __LINE__, CartState[WasteCartridge_middle], RpMessage, CartState[WasteCartridge_lower], 0); + //Report("Cartridges select cart", __FILE__, __LINE__, CartState[WasteCartridge_middle], RpMessage, CartState[WasteCartridge_lower], 0); if ((CartState[WasteCartridge_middle] == CartridgeStateSELECTED)||(CartState[WasteCartridge_middle] == CartridgeStateACTIVE)) return WasteCartridge_middle; if ((CartState[WasteCartridge_lower] == CartridgeStateSELECTED)||(CartState[WasteCartridge_lower] == CartridgeStateACTIVE)) diff --git a/Software/Stubs Collection/Procedures/Mid tank calibration.pproj b/Software/Stubs Collection/Procedures/Mid tank calibration.pproj index 0bb05e75b..655bbd099 100644 --- a/Software/Stubs Collection/Procedures/Mid tank calibration.pproj +++ b/Software/Stubs Collection/Procedures/Mid tank calibration.pproj @@ -1 +1,477 @@ -{"$id":"1","Inputs":{"$id":"2","$values":[{"$id":"3","Type":"Default","SelectionInputs":{"$id":"4","$values":[]},"DisplayName":"Check Tamper / Fan alarms","Description":"Check Tamper / Fan alarms","Key":"CheckTampers","Value":"1.0"},{"$id":"5","Type":"Default","SelectionInputs":{"$id":"6","$values":[]},"DisplayName":"Initial Heating on startup","Description":"Initial Heating on startup","Key":"InitialHeating","Value":"true"},{"$id":"7","Type":"Default","SelectionInputs":{"$id":"8","$values":[]},"DisplayName":"WCF Value","Description":"WCF Value","Key":"WCF_Value","Value":"40"},{"$id":"9","Type":"Default","SelectionInputs":{"$id":"10","$values":[]},"DisplayName":"AutoFill Mode","Description":"Controls the AutoFill Mode","Key":"AutoFillMode","Value":"3.0"}]},"Variables":{"$id":"11","$values":[]},"Resources":{"$id":"12","$values":[]},"Dialogs":{"$id":"13","$values":[]},"ID":"2bd29884-5eb9-4d27-be4e-6cfa31dc9f66","Name":"Mid tank calibration","Description":"This procedure lets the FSE to define values for cleaning, tamper alarms, initial heating, WCF value and automatic dispenser filling.","ApartmentState":"MTA","ReferenceAssemblies":{"$id":"14","$values":[{"$id":"15","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":"16","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":"17","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":"18","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":"19","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":"20","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":"21","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":"22","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":"23","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":"24","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":"25","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"}]},"Scripts":{"$id":"26","$values":[{"$id":"27","Name":"Program.csx","IsEntryPoint":true,"Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.IO;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing System.Drawing;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Entities;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.PMR.EmbeddedParameters;\r\nusing Tango.FSE.Common.Connection;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\n\r\npublic class Program\r\n{\r\n\r\nprivate IProcedureContext context;\r\n\r\n\t//----------------------\r\n\tconst double \tSlop=0.92;\r\n\tconst double\tMIN_SLOP=0.7;\r\n\tconst double\tMAX_SLOP=1.4;\r\n\tconst double\tERROR_SLOP=-1;\r\n\tconst double\tMIN_50cc_on_volt=2.3;\r\n\tconst double\tMAX_50cc_on_volt=3.2;\r\n\tconst double\tERROR_50cc_on_volt=-1;\r\n\tdouble CartSizeLiter = 1.0;\r\n\t\r\n\tint [] Convert_Midtank_No = new Int32 [8] {1,3,5,7,2,4,6,8};\r\n\tuint [,] ADC_Add_Chnl = new uint [8,2]\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x44,0x20},\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x44,0x08},\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x46,0x80},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x46,0x20},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x44,0x10},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x44,0x04},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x46,0x40},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{0x46,0x10},\r\n\t\t\t\t\t\t\t\t\t\t\t};\r\n\t\r\n\t\r\n\tconst Int32\tF3_VALVE_OUT\t=\t0x600008E2\t;\r\n\tstring Machine_SN\t;\r\n\tprivate const string FILE_PATH = @\"C:\\MidTankLog\\\";\r\n\tstring File_name;\r\n\tdouble [,] voltage_array = new double[9,9];\r\n\tstring [] Parameter = new string[5] {\"\\t\",\"Empty [V]\",\"100cc [V]\",\"800cc [V]\",\" b [L/V] \"};\r\n\t\tdouble Full_Cartridge=1;\t// 1 litter less 100 cc\r\n\t\r\n\t//----------------------\r\n\tconst Int32 I2C_ID = 2;\r\n\t//const Int32 I2C_Slave_Add = 0x46; //must be 0x40, 0x44 or 0x46\r\n\t//----------------------\r\n\t\r\n public void OnExecute(IProcedureContext context)\r\n {\r\n\tthis.context = context;\r\n\t\r\n\tInt32 midtankno = 0;\r\n\tdouble Full_Point=0;\t\t\t//on Voltage\r\n\tdouble resualt;\r\n\tdouble Sum=0 ;\r\n\tdouble Old_Sum=0 ;\r\n\t\r\n\r\n\tif (!Directory.Exists(FILE_PATH))\r\n\t\t{\r\n\t\t\tDirectory.CreateDirectory(FILE_PATH);\r\n\t\t}\t\t\t\r\n\r\n\r\n \t//Machine_SN = context.GetInput(\"Midtank_SN\");\r\n var response = context.RequestUserInputFor(\"Mid Tank Serial Number\", \"Enter Midtank S/N:\");\r\n\tcontext.Write(\"\\n\");\r\n\tMachine_SN = response;\r\n\tcontext.WriteLine(Machine_SN);\r\n\tFile_name= FILE_PATH +Machine_SN + DateTime.Now.ToString(\"MM_dd_yyyy_HH_mm_ss\")+\".csv\";\r\n\tcontext.Write(File_name);\r\n \tcontext.WriteToFile(File_name,\"MidTank S/N:,\" + Machine_SN); \r\n\t\r\n\t\r\n\r\n\t//midtankno = context.GetInput(\"MidTankId\");\r\n\tvar response1 = context.RequestUserInputFor(\"Mid Tank Number\", \"Enter Midtank number to calibrate (1-8):\");\r\n\tcontext.WriteLine(response1);\r\n\tmidtankno = Int32.Parse(response1);\r\n \tcontext.AppendToFile(File_name,\"MidTank Number:\\t\" + response1);\r\n\r\n\r\n\tvar response2 = context.RequestUserInputFor(\"Cartridge size\", \"Enter enter cartridge size in ml (1000/700/500):\");\r\n\tcontext.WriteLine(response2);\r\n\tint Cart_size = response2;\r\n \tcontext.AppendToFile(File_name,\"Cartrideg size:\\t\" + response2);\r\n\r\n\r\n string box_msg = \"Please Insert cartridge with\" +Cart_size+\"cc (Lubbricant add 500cc only) \";\r\n// string box_title = \"Midatnk empty\";\r\n// context.ShowInfo(box_msg, box_title);\r\n\tcontext.ShowInfo(box_msg);\r\n\r\n\t//int CartInserted = 0;\r\n\t//while (CartInserted == 0)\r\n\t//\tCartInserted = context.GetInput(\"insertCartridge\");\r\n\t\r\n\tCartSizeLiter = Cart_size/1000;\r\n\t\r\n\topen_valve(midtankno,1,1)\t\t;\t//open Air valve\r\n\topen_valve(midtankno,0,1)\t\t;\t//open Ink valve\r\n\tInt32 i=0; \r\n\twhile (i<60*15)\t\t\t\t\t//check for 15 minitus \r\n\t{\r\n\t\tSum=0;\r\n\t\tfor (Int32 j=0;j<30;j++)\r\n\t\t{\r\n\t\t\tresualt=read_pressure_sensor(midtankno);\r\n\t\t\tcontext.AppendToFile(File_name,resualt+\",mV\");\r\n\t\t\tSum=Sum+resualt;\r\n\t\t\tThread.Sleep(1000);\r\n\t\t}\r\n\t\ti=i+1;\r\n\t\tif (Sum>Old_Sum)\r\n\t\t\tOld_Sum=Sum-Old_Sum;\r\n\t\telse\r\n\t\t\tOld_Sum=Old_Sum-Sum;\r\n\t\t\t\r\n\t\tif ( Old_Sum <0.02)\t\r\n\t\t\ti=60*15;\t\t//end \r\n\t\tOld_Sum=Sum;\r\n\t}\r\n\tFull_Point=Sum/30;\r\n\t\r\n\tbox_msg = \"Send file\" + File_name +\"to Mati\"; \r\n\tcontext.ShowInfo(box_msg);\r\n\t\r\n\t\r\n\t//\tcontext.Send(\"StubFpgaWriteRegRequest\" ,F3_VALVE_OUT, 0x000f);\t\t// open all valve air of midtank and close all ink of midtank\r\n\t//\tThread.Sleep(500);\r\n\t//\tcontext.Send(\"StubFpgaWriteRegRequest\" ,F3_VALVE_OUT, 0x00ff);\t\t// open all valve air of midtank and close all ink of midtank\r\n\t//\tThread.Sleep(500);\r\n\t//\tcontext.Send(\"StubFpgaWriteRegRequest\" ,F3_VALVE_OUT, 0x0fff);\t\t// open all valve air of midtank and close all ink of midtank\r\n\t//\tThread.Sleep(500);\r\n\t//\tcontext.Send(\"stubFpgaWriteRegRequest\" ,F3_VALVE_OUT, 0xffff);\t\t// open all valve air and ink of midtank\r\n\t//\r\n\t//\tThread.Sleep(2500);\r\n\r\n\t//\tThread.Sleep(1000);\t\r\n\t\t\r\n\t//\tread_pressure_sensor(1);\r\n \t\t\r\n\t//\tbox_msg =\"Insert 100cc of appropriate ink/lube to each midtank\\n\\t1.black ink\\n\\t2. Magenta ink\\n\\t3. Transparent ink\\n\\t4. Cleaner\\n\\t5. Cyan ink\\n\\t6. Yellow ink\\n\\t7. Spot color\\n\\t8. Lubricant/n\";\r\n // context.ShowInfo(box_msg);\r\n//\r\n\t//\tread_pressure_sensor(2);\r\n\r\n\t\t\t\t\t//\tvoltage_array[3,2]=2.5;\r\n\t\t\r\n//\t\tbox_msg = \"Add another 700cc for ink and TI \\nFor Lubbricant add 500cc only.\"; \r\n//\t\tcontext.ShowInfo(box_msg);\r\n//\t\tread_pressure_sensor(3);\r\n//\t\t\t\tcontext.Send(\"stubFpgaWriteRegRequest\" ,F3_VALVE_OUT, 0x0000);\t\t// close all valve air and ink of midtank\r\n\t\t\t\t\t\t\t\t\t//\t\t\tvoltage_array[3,3]=4.5;\r\n\tclose_valve(midtankno,1,1)\t\t;\t//close Air valve\r\n\tclose_valve(midtankno,0,1)\t\t;\t//close Ink valve\r\n\r\n//\t\tcalc_slop();\r\n//\t\tprint_table();\r\n\t\t\r\n//\t\tinsert_slop_t_eeprom(Full_Point, midtankno);\r\n\t\tinsert_slop_t_eeprom(Full_Point, midtankno);\r\n\t\tbox_msg =\"Turn Power Off and On to finish the calibration.\";\r\n context.ShowInfo(box_msg);\r\n\t\r\n\t}\r\n\r\nint calc_slop()\r\n\t{\r\n\tcontext.Write(\"\\n \");\r\n\t\t\r\n\tdouble delta;\r\n\tfor (uint i=1;i<9;i++)\r\n\t\t{\r\n\t\t\tdelta=voltage_array[i,3]-voltage_array[i,2];\r\n\t\t\r\n\t\t\tcontext.Write(\"\\nMidtank No:\"+i +\"=\"+delta);\r\n//\t\t\tif (i==8)\r\n\t\t\t\tdelta=CartSizeLiter/delta;\t\t\t\t\t\t\t\t\t\t\t\t//0.5 litter on lubricant\t\t\t\r\n//\t\t\telse \r\n//\t\t\t\tdelta=CartSizeLiter/delta;\t\t\t\t\t\t\t\t\t\t\t\t//0.7 litter\r\n\t\t\t\t\r\n\t\t\tif ((deltaMAX_SLOP)) \r\n\t\t\t{\r\n\t\t\t\tvoltage_array[i,4]=ERROR_SLOP;\r\n\t\t//\t\tcontext.Write(\"123\");\r\n\t\t\t}\r\n\t\telse if\t((voltage_array[i,2]MAX_50cc_on_volt ))\r\n\t\t\t\t\tvoltage_array[i,4]=ERROR_SLOP;\r\n\t\telse\r\n\t\tvoltage_array[i,4]=delta;\r\n\t\t}\r\n\treturn 1;\r\n\t}\r\n\r\n\r\n\tint\tinsert_slop_t_eeprom( double FullPoint,Int32 midtankno)\r\n{\r\n//\tcontext.Write(\"\\n \");\r\n\r\n\tMidTankDataSetupRequest midTankDataSetupRequest = new MidTankDataSetupRequest();\r\n\r\n\r\n//\tfor (uint i=1;i<9;i++)\r\n//\t{\r\n//\t\tif (voltage_array[i,4]!= ERROR_SLOP)\r\n//\t\t{\r\n\t\tMidTankData midTankData = new MidTankData();\r\n\t\tmidTankData.MidTankId = Convert.ToUInt32 (midtankno-1);\r\n\t\tmidTankData.InitialOffsetA =FullPoint - (Full_Cartridge-0.1)/Slop;\r\n\t\tmidTankData.SlopeB = Slop;\r\n\t\t\r\n\t\tcontext.Write(\"\\nMidtank No:\" + midtankno + \"=\\tVoltage Zero is =\"+(FullPoint - (Full_Cartridge-0.1)/Slop)+\"\\tSlop=\"+ Slop);\r\n\t\tcontext.AppendToFile(File_name,\"\\nMidtank No:\" + midtankno + \"=\\tVoltage Zero is =\"+(FullPoint - (Full_Cartridge-0.1)/Slop)+\"\\tSlop=\"+ Slop);\r\n\r\n\t\t\r\n\t\tmidTankDataSetupRequest.MidTankInfo.Add(midTankData);\r\n\t\r\n\t//\t}\r\nvar response = context.Send(midTankDataSetupRequest);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t//}\r\n\r\n\r\nreturn\t1;\r\n}\r\n\r\n//\r\n//\r\n//int\t\tprint_table()\r\n//\t\t{\r\n//\r\n//\t\tfor (uint i=0;i<5;i++)\r\n//\t\t\t{\r\n//\t\t\t\tcontext.AppendToFile(File_name,Parameter[i]+\"\\t\"+voltage_array[1,i]+\"\\t\"+voltage_array[2,i]+\"\\t\"+voltage_array[3,i]+\"\\t\"+voltage_array[4,i]+\"\\t\"+voltage_array[5,i]+\"\\t\"+voltage_array[6,i]+\"\\t\"+voltage_array[7,i]+\"\\t\"+voltage_array[8,i]) ;\r\n// } \r\n// \r\n//\t\r\n//\t\t\treturn 1;\r\n//\r\n//\t\t}\r\n\r\n//start mat\r\n\r\nint adc_configuration(uint I2C_Slave_Add,uint channel ) \r\n\t{\r\n\tStubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();\r\n\tstubI2CWriteBytesRequest.I2CId = I2C_ID;\r\n\tstubI2CWriteBytesRequest.SlaveAddress = I2C_Slave_Add;\r\n\t\r\n\tUInt32 uInt32 = new UInt32();\r\n\tstubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//Byte 0 to write\r\n\tstubI2CWriteBytesRequest.BytesTWrite.Add(channel);//Byte 1 to Write, must be 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02 or 0x01 for different channels\r\n\tstubI2CWriteBytesRequest.BytesTWrite.Add(0x80);//Byte 2 to Write\r\n\t\r\n\tvar response = context.Send(stubI2CWriteBytesRequest);\r\n\t\r\n\treturn 1;\r\n\t}\r\n\r\n\r\nint adc_set_for_read_ch(uint I2C_Slave_Add) \r\n\t{\r\n\tStubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();\r\n\tstubI2CWriteBytesRequest.I2CId = I2C_ID;\r\n\tstubI2CWriteBytesRequest.SlaveAddress = I2C_Slave_Add;\r\n\t\r\n\tUInt32 uInt32 = new UInt32();\r\n\tstubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//Byte 0 to write\r\n\r\n\tvar response = context.Send(stubI2CWriteBytesRequest);\r\n\t\r\n\treturn 1;\r\n\t}\r\n\r\n\r\n\r\n\r\ndouble adc_read_ch(uint I2C_Slave_Add) \r\n\t{\r\n\tStubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();\r\n\tstubI2CReadBytesRequest.I2CId = I2C_ID;\r\n\tstubI2CReadBytesRequest.SlaveAddress = I2C_Slave_Add;\r\n\tstubI2CReadBytesRequest.NumberOfBytesToRead = 2; // Number of bytes to read\r\n\r\n\tvar response1 = context.Send(stubI2CReadBytesRequest);\r\n\tuint temph=0;\r\n\tuint templ=0;\r\n\tuint temp;\r\n\tdouble calc;\r\n\tdouble calc1;\r\n\tdouble calc2;\r\n\t\t\ttemph=response1.ReadBytes[0];\r\n\t\t\ttempl=response1.ReadBytes[1];\r\n\t\t\ttemp = (temph << 8) | templ;\r\n\t\t\ttemp=temp & 0x0fff;\r\n\t\t\t\t\r\n\t\t\tcalc = (double)temp *2.5 / 4096.0;\r\n//\t\t\tcontext.Write(\"ADC [volts]:\\t\");\r\n//\t\t\tcontext.Write(calc+\"\\t\");\r\n\t\t\r\n\t\t\tcalc1 = (1.96- calc) * 4.64 + 1.96;\r\n\t\t\tcontext.Write(\"Vsensor [volts]:\\t\");\r\n\t\t\tcontext.Write(calc1 + \"\\n\");\r\n\r\n\t//\t\tvoltage_array[table_index_x,table_index_y]=calc1;\r\n\t\r\n\treturn calc1;\r\n\t}\r\n\r\ndouble\t\tread_pressure_sensor(Int32 i )\r\n\t{\r\ndouble resualt =0 ;\r\n\t\t switch (i)\r\n {\r\n case 1:\r\n\t\t\tadc_configuration(0x44,0x20);\t\t//a2d_address 0x44 channel channel 2\r\n\t\t\tadc_set_for_read_ch(0x44);\r\n\t\t\tresualt=adc_read_ch(0x44);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 2:\r\n\t\t\tadc_configuration(0x44,0x08);\t\t//a2d_address 0x44 channel channel 4\r\n\t\t\tadc_set_for_read_ch(0x44);\r\n\t\t\tresualt=adc_read_ch(0x44);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 3:\r\n\t\t\tadc_configuration(0x46,0x80);\t\t//a2d_address 0x46 channel channel 0\r\n\t\t\tadc_set_for_read_ch(0x46);\r\n\t\t\tresualt=adc_read_ch(0x46);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 4:\r\n\t\t\tadc_configuration(0x46,0x20);\t\t//a2d_address 0x46 channel channel 2\r\n\t\t\tadc_set_for_read_ch(0x46);\r\n\t\t\tresualt=adc_read_ch(0x46);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 5:\r\n\t\t\tadc_configuration(0x44,0x10);\t\t//a2d_address 0x44 channel channel 3\r\n\t\t\tadc_set_for_read_ch(0x44);\r\n\t\t\tresualt=adc_read_ch(0x44);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 6:\r\n\t\t\tadc_configuration(0x44,0x04);\t\t//a2d_address 0x44 channel channel 5\r\n\t\t\tadc_set_for_read_ch(0x44);\r\n\t\t\tresualt=adc_read_ch(0x44);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 7:\r\n\t\t\tadc_configuration(0x46,0x40);\t\t//a2d_address 0x46 channel channel 1\r\n\t\t\tadc_set_for_read_ch(0x46);\r\n\t\t\tresualt=adc_read_ch(0x46);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 8:\r\n\t\t\tadc_configuration(0x46,0x10);\t\t//a2d_address 0x46 channel channel 3\r\n\t\t\tadc_set_for_read_ch(0x46);\r\n\t\t\tresualt=adc_read_ch(0x46);\r\n\t\tbreak;\r\n\t\t\r\n default:\r\n context.Write(\"Error\");\r\n\r\n break;\r\n\t }\t\r\n\t\t\r\n\t\treturn resualt;\r\n\t}\t\r\n\r\n\r\n//--------------------------------\r\nint open_valve (int valve_nm,int valve_type,int check_valve)\t\t//valve_type=0 is Air ,1 is Ink ; check_valve=1 send feedbak\r\n{\r\n\tint temp1=Convert_Midtank_No[valve_nm-1]\t;\r\n\r\n\tstring temp;\r\n\tSetBit (F3_VALVE_OUT,(((valve_type+1)*8)- temp1), 1);\t\r\n\t\r\n\t\tif (check_valve!=0)\r\n\t\t{\r\n\t\t\ttemp=\"Air\";\r\n\t\t\tif (valve_type==1)\r\n\t\t\ttemp=\"Ink\";\r\n\t\t\t\t\r\n\t\t\tif(!context.ShowWarningQuestion(\"Did \" + temp + \"Valve of Midtank \" + valve_nm +\" open?\"))\r\n\t\t\t\t{\r\n//\t\t\t\t\tUnits_status[(valve_nm-1)*3+valve_type,1]=\"Fail\";\r\n\t\t\t\t\tcontext.Write(temp +\"Valve\\tFail\\n\");\t\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\telse \r\n\t\t\t\t{\r\n//\t\t\t\t\tUnits_status[(valve_nm-1)*3+valve_type,1]=\"Pass\";\r\n\t\t\t\t\tcontext.Write(temp +\"Valve\\tOpen\\n\");\t\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn 1;\r\n\r\n}\r\n//--------------------------------\t\r\nint close_valve (int valve_nm,int valve_type,int check_valve)\r\n{\r\n\tint temp1=Convert_Midtank_No[valve_nm-1];\t\r\n\r\n\tstring temp;\r\n\tSetBit (F3_VALVE_OUT,(((valve_type+1)*8)- temp1), 0);\r\n\tif (check_valve!=0)\r\n\t\t{\r\n\t\t\ttemp=\"Air\";\r\n\t\t\tif (valve_type==1)\r\n\t\t\ttemp=\"Ink\";\r\n\t\t\t\t\r\n\t\t\tif(!context.ShowWarningQuestion(\"Did \" + temp +\" Valve of Midtank \" + valve_nm +\" close?\"))\r\n\t\t\t\t{\r\n//\t\t\t\t\tUnits_status[(valve_nm-1)*3+valve_type,1]=\"Fail\";\r\n\t\t\t\t\tcontext.Write(temp +\"Valve\\tFail\\n\");\t\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\telse \r\n\t\t\t\t{\r\n//\t\t\t\t\tUnits_status[(valve_nm-1)*3+valve_type,1]=\"Pass\";\r\n\t\t\t\t\tcontext.Write(temp +\"Valve\\tclose\\n\");\t\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\t\t\t\r\n\t\t}\r\n\treturn 1;\r\n\r\n}\r\n\r\npublic Int32 SetBit(Int32 Adr, Int32 BitNo, Int32 Bit)\r\n{\r\n\tInt32 BitMask;\r\n\tvar RetVal = Fpga_Read_Reg(Adr);\r\n\tInt32 RV = (Int32) RetVal.Value;\r\n\t\r\n\tif (Bit == 0x1) \r\n\t{\r\n\t\tBitMask = 0x1 << BitNo;\r\n\t\tRV = RV | BitMask;\r\n\t\tFpga_Write_Reg( Adr, RV );\r\n\t}\r\n\telse if (Bit == 0x0)\r\n\t{\r\n\t\tBitMask = ~(0x1 << BitNo);\r\n\t\tRV = RV & BitMask;\r\n\t\tFpga_Write_Reg(Adr, RV );\t\r\n\t}\r\n\treturn 1;\r\n}\r\n\r\nint Fpga_Write_Reg(Int32 Addr, Int32 Data)\r\n{\r\n\tvar response = context.Send(\"StubFpgaWriteRegRequest\" ,Addr, Data);\r\n\t\r\n\treturn 1;\r\n}\r\n\r\n\r\n\r\nStubFpgaReadRegResponse Fpga_Read_Reg(Int32 Addr)\r\n{\r\n var response = context.Send(\"StubFpgaReadRegRequest\" ,Addr);\r\n\tresponse.Value = response.Value & 0xffff;\r\n\t\r\n\treturn response;\r\n}\r\n}"},{"$id":"28","Name":"Service.csx","IsEntryPoint":false,"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}"}]}} \ No newline at end of file +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Drawing; +using Google.Protobuf; +using Tango.BL.Entities; +using Tango.BL.Enumerations; +using Tango.PMR.Stubs; +using Tango.PMR.Diagnostics; +using Tango.FSE.Common.Connection; +using Tango.FSE.Common.Diagnostics; +using Tango.FSE.Procedures; +using System.IO; +using System.Windows.Forms; +using Tango.PMR.EmbeddedParameters; + +public class Program +{ +const double MIN_SLOP=0.7; +const double MAX_SLOP=1.4; +const double ERROR_SLOP=-1; +const double MIN_50cc_on_volt=2.3; +const double MAX_50cc_on_volt=3.2; +const double ERROR_50cc_on_volt=-1; + +int [] Convert_Midtank_No = new Int32 [8] {1,3,5,7,2,4,6,8}; +uint [,] ADC_Add_Chnl = new uint [8,2] { + {0x44,0x20}, + {0x44,0x08}, + {0x46,0x80}, + {0x46,0x20}, + {0x44,0x10}, + {0x44,0x04}, + {0x46,0x40}, + {0x46,0x10}, + }; + + +const Int32 F3_VALVE_OUT = 0x600008E2 ; +string Machine_SN ; +private const string FILE_PATH = @"C:\MidTankLog\"; +string File_name; +double Full_Cartridge=1000; // on CC +double Slop=0.92; +//---------------------- +const Int32 I2C_ID = 2; +//const Int32 I2C_Slave_Add = 0x46; //must be 0x40, 0x44 or 0x46 +//---------------------- + + +private IProcedureContext context; + + + + + public void OnExecute(IProcedureContext context) + { + + + Int32 Timout ; + Int32 Interval; + Int32 midtankno = 0; + double Full_Point=0; //on Voltage + double resualt; + double Sum=0 ; + double Old_Sum=0 ; + double Start_Point=0; + + + if (!Directory.Exists(FILE_PATH)) + { + Directory.CreateDirectory(FILE_PATH); + } + + + + var response =context.RequestUserInputFor("Enter Midtank S/N: ", ""); + context.Write("\n"); + Machine_SN = response; + context.WriteLine(Machine_SN); + File_name= FILE_PATH +Machine_SN + DateTime.Now.ToString("MM_dd_yyyy_HH_mm_ss")+".csv"; + context.Write(File_name); + context.WriteToFile(File_name,"MidTank S/N:," + Machine_SN); + + + var response1 =context.RequestUserInputFor("Enter Midtank number to calibrate (1-8):", ""); + context.WriteLine(response1); + midtankno = Int32.Parse(response1); + context.AppendToFile(File_name,"MidTank Number:\t" + response1); + if (midtankno==8) + { + Slop=1; + Timout=60; //60 minutes + Interval=60; //60 second + } + else + { + Slop=0.92; + Timout=10*2; //10 minutes + Interval=30; //30 second + + } + var response10 =context.RequestUserInputFor("Enter Cartridge Valume on CC (500-1500):", ""); + context.WriteLine(response10); + Full_Cartridge = double.Parse(response10); + context.AppendToFile(File_name,"Cartridge Valume:\t" + response10); + context.AppendToFile(File_name,"Slop value:\t" + Slop); + + + DialogResult result = MessageBox.Show("Are you sure to calibrate Midtank No: "+ midtankno + " with "+ Full_Cartridge +" CC" , "Warning",MessageBoxButtons.YesNo); + if(result == DialogResult.Yes) + { + + + + string box_msg = "Please Insert cartridge "; + + MessageBox.Show(box_msg); + + open_valve(midtankno,1,1) ; //open Air valve + open_valve(midtankno,0,1) ; //open Ink valve + Int32 i=0; + while (iOld_Sum) + Old_Sum=Sum-Old_Sum; + else + Old_Sum=Old_Sum-Sum; + + + if ((check_valve(midtankno,1) != 0) && (check_valve(midtankno,0) != 0)) + { + i++; + if ( Old_Sum <0.02) + i=Timout+1; //end + Old_Sum=Sum; + } + else + { + open_valve(midtankno,1,0) ; //open Air valve + open_valve(midtankno,0,0) ; //open Ink valve + Old_Sum=0; + + } + } + Full_Point=Sum/Interval; + + + close_valve(midtankno,1,1) ; //close Air valve + close_valve(midtankno,0,1) ; //close Ink valve + + + if (insert_slop_t_eeprom(Full_Point, midtankno,Start_Point)==0) + { + box_msg ="Turn Power Off and On to finish the calibration."; + MessageBox.Show(box_msg); + + + context.AddResult(ResultType.Passed, "Test passed", "Test passed."); + + } + else + { + box_msg ="Calibration error"; + MessageBox.Show(box_msg); + + + context.AddResult(ResultType.Failed, "Test Fail", "Test Fail."); + + } + } + +} + + + int insert_slop_t_eeprom( double FullPoint,Int32 midtankno, double StartPoint) +{ +// context.Write("\n "); + + StartPoint=FullPoint-StartPoint; + StartPoint=StartPoint/Full_Cartridge; + if ((StartPoint>0.7 ) && (StartPoint>1.3 )) + { + MidTankDataSetupRequest midTankDataSetupRequest = new MidTankDataSetupRequest(); + + MidTankData midTankData = new MidTankData(); + midTankData.MidTankId = Convert.ToUInt32 (midtankno-1); + midTankData.InitialOffsetA =FullPoint - (Full_Cartridge/1000-0.1)/Slop; + midTankData.SlopeB = Slop; + + context.Write("\nMidtank No:" + midtankno + "=\tVoltage Zero is ="+(FullPoint - (Full_Cartridge/1000-0.1)/Slop)+"\tSlop="+ Slop); + context.AppendToFile(File_name,"\nMidtank No:" + midtankno + "=\tVoltage Zero is ="+(FullPoint - (Full_Cartridge/1000-0.1)/Slop)+"\tSlop="+ Slop); + + + midTankDataSetupRequest.MidTankInfo.Add(midTankData); + + + var response =context.Send(midTankDataSetupRequest); + + return 0; + } + else + context.Write("\nError"); + context.AppendToFile(File_name,"\n Slop Error"); + return 1; + + + } + + + +int adc_configuration(uint I2C_Slave_Add,uint channel ) + { + StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest(); + stubI2CWriteBytesRequest.I2CId = I2C_ID; + stubI2CWriteBytesRequest.SlaveAddress = I2C_Slave_Add; + + UInt32 uInt32 = new UInt32(); + stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//Byte 0 to write + stubI2CWriteBytesRequest.BytesTWrite.Add(channel);//Byte 1 to Write, must be 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02 or 0x01 for different channels + stubI2CWriteBytesRequest.BytesTWrite.Add(0x80);//Byte 2 to Write + + var response =context.Send(stubI2CWriteBytesRequest); + + return 1; + } + + +int adc_set_for_read_ch(uint I2C_Slave_Add) + { + StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest(); + stubI2CWriteBytesRequest.I2CId = I2C_ID; + stubI2CWriteBytesRequest.SlaveAddress = I2C_Slave_Add; + + UInt32 uInt32 = new UInt32(); + stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//Byte 0 to write + + var response =context.Send(stubI2CWriteBytesRequest); + + return 1; + } + + + + +double adc_read_ch(uint I2C_Slave_Add) + { + StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest(); + stubI2CReadBytesRequest.I2CId = I2C_ID; + stubI2CReadBytesRequest.SlaveAddress = I2C_Slave_Add; + stubI2CReadBytesRequest.NumberOfBytesToRead = 2; // Number of bytes to read + + var response1 =context.Send(stubI2CReadBytesRequest); + uint temph=0; + uint templ=0; + uint temp; + double calc; + double calc1; + double calc2; + temph=response1.ReadBytes[0]; + templ=response1.ReadBytes[1]; + temp = (temph << 8) | templ; + temp=temp & 0x0fff; + + calc = (double)temp *2.5 / 4096.0; + + calc1 = (1.96- calc) * 4.64 + 1.96; + context.Write("Vsensor [volts]:\t"); + context.Write(calc1 + "\n"); + + + return calc1; + } + +double read_pressure_sensor(Int32 i ) + { +double resualt =0 ; + switch (i) + { + case 1: + adc_configuration(0x44,0x20); //a2d_address 0x44 channel channel 2 + adc_set_for_read_ch(0x44); + resualt=adc_read_ch(0x44); + break; + + case 2: + adc_configuration(0x44,0x08); //a2d_address 0x44 channel channel 4 + adc_set_for_read_ch(0x44); + resualt=adc_read_ch(0x44); + break; + + case 3: + adc_configuration(0x46,0x80); //a2d_address 0x46 channel channel 0 + adc_set_for_read_ch(0x46); + resualt=adc_read_ch(0x46); + break; + + case 4: + adc_configuration(0x46,0x20); //a2d_address 0x46 channel channel 2 + adc_set_for_read_ch(0x46); + resualt=adc_read_ch(0x46); + break; + + case 5: + adc_configuration(0x44,0x10); //a2d_address 0x44 channel channel 3 + adc_set_for_read_ch(0x44); + resualt=adc_read_ch(0x44); + break; + + case 6: + adc_configuration(0x44,0x04); //a2d_address 0x44 channel channel 5 + adc_set_for_read_ch(0x44); + resualt=adc_read_ch(0x44); + break; + + case 7: + adc_configuration(0x46,0x40); //a2d_address 0x46 channel channel 1 + adc_set_for_read_ch(0x46); + resualt=adc_read_ch(0x46); + break; + + case 8: + adc_configuration(0x46,0x10); //a2d_address 0x46 channel channel 3 + adc_set_for_read_ch(0x46); + resualt=adc_read_ch(0x46); + break; + + default: + context.Write("Error"); + + break; + } + + return resualt; + } + + +//-------------------------------- +int open_valve (int valve_nm,int valve_type,int check_valve) //valve_type=0 is Air ,1 is Ink ; check_valve=1 send feedbak +{ + int temp1=Convert_Midtank_No[valve_nm-1] ; + + string temp; + SetBit (F3_VALVE_OUT,(((valve_type+1)*8)- temp1), 1); + + if (check_valve!=0) + { + temp="Air"; + if (valve_type==1) + temp="Ink"; + + DialogResult result = MessageBox.Show("Did " + temp + "Valve of Midtank " + valve_nm +" open?", "Warning",MessageBoxButtons.YesNo); + if(result == DialogResult.No) + { +// Units_status[(valve_nm-1)*3+valve_type,1]="Fail"; + context.Write(temp +"Valve\tFail\n"); + return 0; + } + else + { +// Units_status[(valve_nm-1)*3+valve_type,1]="Pass"; + context.Write(temp +"Valve\tOpen\n"); + return 1; + } + + } + return 1; + +} +//-------------------------------- +int close_valve (int valve_nm,int valve_type,int check_valve) +{ + int temp1=Convert_Midtank_No[valve_nm-1]; + + string temp; + SetBit (F3_VALVE_OUT,(((valve_type+1)*8)- temp1), 0); + if (check_valve!=0) + { + temp="Air"; + if (valve_type==1) + temp="Ink"; + + DialogResult result = MessageBox.Show("Did " + temp +" Valve of Midtank " + valve_nm +" close?", "Warning",MessageBoxButtons.YesNo); + if(result == DialogResult.No) + { +// Units_status[(valve_nm-1)*3+valve_type,1]="Fail"; + context.Write(temp +"Valve\tFail\n"); + return 0; + } + else + { +// Units_status[(valve_nm-1)*3+valve_type,1]="Pass"; + context.Write(temp +"Valve\tclose\n"); + return 1; + } + } + return 1; + +} + +public Int32 SetBit(Int32 Adr, Int32 BitNo, Int32 Bit) +{ + Int32 BitMask; + Int32 RetVal; + RetVal = Fpga_Read_Reg(Adr); + Int32 RV = RetVal ; + + if (Bit == 0x1) + { + BitMask = 0x1 << BitNo; + RV = RV | BitMask; + Fpga_Write_Reg( Adr, RV ); + } + else if (Bit == 0x0) + { + BitMask = ~(0x1 << BitNo); + RV = RV & BitMask; + Fpga_Write_Reg(Adr, RV ); + } + return 1; +} + +int Fpga_Write_Reg(Int32 Addr, Int32 Data) +{ + var response =context.Send("StubFpgaWriteRegRequest" ,Addr, Data); + + return 1; +} + + +Int32 check_valve (Int32 valve_nm,int valve_type) +{ + Int32 temp1=Convert_Midtank_No[valve_nm-1]; + + var response =context.Send("StubFpgaReadRegRequest" ,F3_VALVE_OUT); + Int32 RV =(Int32) response.Value & 0xffff ; + RV = RV & ( 0x1 << (((valve_type+1)*8)- temp1)); + return RV; + +} + + +Int32 Fpga_Read_Reg(Int32 Addr) +{ + +context.Write("123"); + + var response =context.Send("StubFpgaReadRegRequest" ,Addr); + context.Write("456"); + + Int32 RV= (Int32) response.Value & 0xffff; + context.Write("789"); + + return RV; +} + + + +} \ No newline at end of file diff --git a/Software/Stubs Collection/Procedures/Priming1.pproj b/Software/Stubs Collection/Procedures/Priming1.pproj new file mode 100644 index 000000000..adfed3f3e --- /dev/null +++ b/Software/Stubs Collection/Procedures/Priming1.pproj @@ -0,0 +1,1015 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Drawing; +using Google.Protobuf; +using Tango.BL.Entities; +using Tango.BL.Enumerations; +using Tango.PMR.Stubs; +using Tango.PMR.Diagnostics; +using Tango.FSE.Common.Connection; +using Tango.FSE.Common.Diagnostics; +using Tango.FSE.Procedures; +using System.IO; +using System.Diagnostics; +using System.Windows.Forms; + + +public class Program +{ + + +private IProcedureContext context; + +//---------------------Start Command ---------------- +const Int32 CMD_RUN = 0; //Run on Pulse Per Secound .positive run Up and negative run Down b +const Int32 CMD_STOP= 1; //0;Hard stop(Defualt);1-Soft stop;2-Hard Hiz;3-Soft Hiz +const Int32 CMD_VALVE= 2; //0-to Midtank ,1-to head +const Int32 CMD_DLY = 3; //delay in Seconds . +const Int32 CMD_TIME= 4; //Print Time . +const Int32 CMD_PRESS= 5; //return from Delay loop when pressure is high (on mBAR) . +const Int32 CMD_LOOP_NM=6; //NUMBER OF counter +const Int32 CMD_LOOP= 7; //jump up(+) or down(-) command u +const Int32 CMD_MTV_OPEN = 8; //0 Air ; 1 Ink +const Int32 CMD_MTV_CLOSE= 9; //0 Air ; 1 Ink +const Int32 CMD_LBL= 10; //label for user +const Int32 CMD_SMP= 11; //sample rate ,defualt 100msec (1); for 1 second is 10. +const Int32 CMD_PRESL= 12; //return from Delay loop when pressure is low (on mBAR) . + +const Int32 CMD_END = 13; //end loop . + + +Int32[] BuildUp_Table = new int [] +{ + CMD_VALVE,1, + CMD_PRESL,200, + CMD_DLY,200, + + CMD_LOOP_NM,3, + + CMD_VALVE,0, + CMD_DLY,1, + CMD_VALVE,1, + CMD_DLY,1, + CMD_LOOP,-4, + + CMD_VALVE,0, + CMD_RUN,1068, + CMD_PRESS,1000, //mbar --> 1000 = 100% work, 4000 = 200% work, 350 = 20% work + CMD_DLY,150, + CMD_LBL,1, + CMD_PRESS,2000, //mbar --> 2000 = 100% work, 4000 = 200% work, 350 = 20% work + CMD_DLY,60, + CMD_LBL,2, + CMD_PRESS,3000, + CMD_DLY,60, // to limit + CMD_STOP,0, + CMD_VALVE,1, + CMD_END,3, +}; + + +Int32[] Up_Table = new int [] +{ + CMD_VALVE,1, + CMD_PRESL,200, + CMD_DLY,200, + + CMD_PRESS,3000, //mbar --> 1000 = 100% work, 4000 = 200% work, 350 = 20% work + CMD_RUN,534, // 100% + CMD_DLY,120, + CMD_STOP,0, + CMD_END,3, +}; +Int32 Dispenser_sample_rate= 1; + + string path = @"C:\Dispenser_setup\Log\"; +//---------------------- +const UInt32 I2C_ID = 4; //MCU_I2C4 +const UInt32 TCA9548A_address = 0xE2; +const UInt32 I2C_Slave_Low_Add = 0xA0; //eeprom address - 64k low +const UInt32 I2C_Slave_High_Add = 0xA2; //eeprom address - 64k High +//---------------------- +byte [] EEPROM_Data = new byte [128]; + + +//---------------------End Command ---------------- + +const Int32 Dispenser_Motor1 = 6; +const Int32 Dispenser_Motor2 = 7; +const Int32 Dispenser_Motor3 = 8; +const Int32 Dispenser_Motor4 = 9; +const Int32 Dispenser_Motor5 = 10; +const Int32 Dispenser_Motor6 = 11; +const Int32 Dispenser_Motor7 = 12; +const Int32 Dispenser_Motor8 = 13; + +const Int32 AN_IDS_PRESSENS_1 = 2; +const Int32 AN_IDS_PRESSENS_2 = 3; +const Int32 AN_IDS_PRESSENS_3 = 4; +const Int32 AN_IDS_PRESSENS_4 = 5; +const Int32 AN_IDS_PRESSENS_5 = 6; +const Int32 AN_IDS_PRESSENS_6 = 7; +const Int32 AN_IDS_PRESSENS_7 = 8; +const Int32 AN_IDS_PRESSENS_8 = 9; + +const Int32 F2_LS_01_Direct = 0x60000420 ; // Reads the direct values that are currently being sent to the fpga. rsv rsv rsv rsv F2_LS_DISPENSER_UP_2 F2_LS_DISPENSER_25_2 F2_LS_DISPENSER_75_2 F2_LS_DISPENSER_DOWN_2 F2_LS_DISPENSER_50_2 F2_LS_DISPENSER_SPARE_2 F2_LS_DISPENSER_UP_1 F2_LS_DISPENSER_25_1 F2_LS_DISPENSER_75_1 F2_LS_DISPENSER_DOWN_1 F2_LS_DISPENSER_50_1 F2_LS_DISPENSER_SPARE_1 +const Int32 F2_LS_02_Direct = 0x60000430 ; // Reads the direct values that are currently being sent to the fpga. rsv rsv rsv rsv F2_LS_DISPENSER_UP_4 F2_LS_DISPENSER_25_4 F2_LS_DISPENSER_75_4 F2_LS_DISPENSER_DOWN_4 F2_LS_DISPENSER_50_4 F2_LS_DISPENSER_SPARE_4 F2_LS_DISPENSER_UP_3 F2_LS_DISPENSER_25_3 F2_LS_DISPENSER_75_3 F2_LS_DISPENSER_DOWN_3 F2_LS_DISPENSER_50_3 F2_LS_DISPENSER_SPARE_3 +const Int32 F2_LS_03_Direct = 0x60000440 ; // Reads the direct values that are currently being sent to the fpga. rsv rsv rsv rsv F2_LS_DISPENSER_UP_6 F2_LS_DISPENSER_25_6 F2_LS_DISPENSER_75_6 F2_LS_DISPENSER_DOWN_6 F2_LS_DISPENSER_50_6 F2_LS_DISPENSER_SPARE_6 F2_LS_DISPENSER_UP_5 F2_LS_DISPENSER_25_5 F2_LS_DISPENSER_75_5 F2_LS_DISPENSER_DOWN_5 F2_LS_DISPENSER_50_5 F2_LS_DISPENSER_SPARE_5 +const Int32 F2_LS_04_Direct = 0x60000480 ; // Reads the direct values that are currently being sent to the fpga. rsv rsv rsv rsv F2_LS_DISPENSER_UP_8 F2_LS_DISPENSER_25_8 F2_LS_DISPENSER_75_8 F2_LS_DISPENSER_DOWN_8 F2_LS_DISPENSER_50_8 F2_LS_DISPENSER_SPARE_8 F2_LS_DISPENSER_UP_7 F2_LS_DISPENSER_25_7 F2_LS_DISPENSER_75_7 F2_LS_DISPENSER_DOWN_7 F2_LS_DISPENSER_50_7 F2_LS_DISPENSER_SPARE_7 + +const Int32 Dispenser_Valve1 = 0; +const Int32 Dispenser_Valve2 = 1; +const Int32 Dispenser_Valve3 = 2; +const Int32 Dispenser_Valve4 = 3; +const Int32 Dispenser_Valve5 = 4; +const Int32 Dispenser_Valve6 = 5; +const Int32 Dispenser_Valve7 = 6; +const Int32 Dispenser_Valve8 = 7; + +const ushort MinPress_Mbar_Add =0x5c ; +const ushort MaxPress_Mbar_Add =0x60 ; + +const Int32 F3_VALVE_OUT = 0x600000e2; + +//string path = "C:\\Dispenser_setup\\Log\\"; + + +//Int32[] Start_Table; + +Int32[] Start_Table = new Int32 [10000]; + +UInt32 [] Motor_Dir=new UInt32 [8] {0,0,0,0,0,0,0,0}; + +string Dispenser_Fname ; + +Int32 Dispenser_ptr =-1; + +Int32 [] Dispenser_press= new Int32[8]{0,0,0,0,0,0,0,0}; +Int32 max_pressure_level = 20000; +Int32 min_pressure_level = -20000; + +Int32 [] A2D_Dispenser= new Int32[8]{0,0,0,0,0,0,0,0}; +Int32 Loop_cnt= 1; +Int32 Loop_length=1; + +Int32 PressureSensorType= 1; //1- new -1up +10 . 0-old 0 to +10 +Int32 Temp_Delay=0; + + +UInt32 RD_LS_01_Direct; +UInt32 RD_LS_02_Direct; +UInt32 RD_LS_03_Direct; +UInt32 RD_LS_04_Direct; + +long Lebel1_time; +long Lebel2_time; + +long time_Table; + +Int32 msec_index=0; + +Int32 MaxPress_Mbar; +Int32 MinPress_Mbar; +string state; + + public Int32 OnExecute(IProcedureContext context) + { + long Max_PBU; + Int32 Index=0; + Int32 speed=0; + Int32 Dispenser_Nm; + this.context = context; + + string box_msg = "Make sure Mixer Hot "; + MessageBox.Show(box_msg); + + var response1 = context.RequestUserInputFor("Dispenser Number", "Enter Dispenser number to make priming (1-8):"); + context.WriteLine(response1); + Dispenser_Nm = Int32.Parse(response1); + + check_Min_Max_Mbar(Dispenser_Nm); + + if (Dispenser_Nm==8) + Max_PBU=6000; + else + Max_PBU=4000; + + + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + context.WriteLine(path); + + context.Send("ProgressRequest" ,0xe0, 1); + + Dispenser_Fname=path + "Dispenser_Nm_" + Dispenser_Nm+"_" + DateTime.Now.ToString("MM-dd-yy hh-mm")+ ".csv" ; + + context.WriteLine(Dispenser_Fname); + + context.WriteToFile(Dispenser_Fname,"Dispenser Nm," + Dispenser_Nm + "\n" ); + context.AppendToFile(Dispenser_Fname,"Pressure,Command,Value,DateTime,Remark\n" ); + for(int j=0; j<2;j++) + { + for(int i=0; i<4;i++) + { + state="PBU No. "+ (4*j+i+1 ); + Start_Table=BuildUp_Table; + Table_Run(Dispenser_Nm ); + if (time_Table>300000) + { + context.AddResult(ResultType.Failed,"PBU", "PBU No."+ (4*j+i+1 ) + " Fail"); + return 0; + } + context.AddResult(ResultType.Passed,"PBU","PBU No."+ (4*j+i+1 ) + " Pass"); + + } + state="Flow No."+ (j+1 ) ; + Start_Table=Up_Table; + Table_Run(Dispenser_Nm ); + if (time_Table<115000) + { + context.WriteLine("time_Table= " +time_Table); + context.AddResult(ResultType.Failed,"Flow", "Flow No."+ (j+1) + " Fail"); + return 0; + } + context.AddResult(ResultType.Passed,"Flow","Flow No."+ (j+1 ) + " Pass"); + + } + state="Last PBU " ; + Start_Table=BuildUp_Table; + Table_Run(Dispenser_Nm ); + long Time=Lebel2_time-Lebel1_time; + if (Time>Max_PBU) + { + context.AddResult(ResultType.Failed,"PBU", "PBU = " +Time + "msec "); + state="PBU = " +Time + "msec \tFail"; + } + else + { + context.AddResult(ResultType.Passed,"PBU", "PBU = " +Time + "msec "); + state="PBU = " +Time + "msec \tPass"; + } + return 0; + + } + +///////////////////////////////////////////// +void check_Min_Max_Mbar(Int32 i ) +{ + int k; + string s ; + i--; + + context.WriteLine("-------------- write Enable Channel ------------"); //debug + enable_channel(i); // Chanel 0-7 => Disp0enser 0-7 + context.WriteLine("-------------- Read_header ------------"); //debug + + context.WriteLine("-------------- write_address_eeprom ------------"); //debug + write_address_eeprom (I2C_Slave_Low_Add,MinPress_Mbar_Add); + context.WriteLine("-------------- read_data_from_eeprom ------------"); //debug + read_data_from_eeprom (I2C_Slave_Low_Add,1); + if (EEPROM_Data[0]==0 ) + { PressureSensorType=0; + context.WriteLine("PressureSensorType=0" ); //debug + } + else + { + PressureSensorType=1; + context.WriteLine("PressureSensorType=1" ); //debug + } + +} +//----------------write address eeprom ------------------------- +public void write_address_eeprom (UInt32 I2C_Add, UInt32 Eeprom_Add) +{ + StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest(); + stubI2CWriteBytesRequest.I2CId = I2C_ID; + stubI2CWriteBytesRequest.SlaveAddress = I2C_Add; + + UInt32 uInt32 = new UInt32(); + stubI2CWriteBytesRequest.BytesTWrite.Add(Convert.ToByte( (Eeprom_Add & 0xff00) >>8)); //Byte High add to write + stubI2CWriteBytesRequest.BytesTWrite.Add(Convert.ToByte(Eeprom_Add & 0xff)); //Byte Low add to write + context.WriteLine( (Eeprom_Add & 0xff00) >>8) ; //debug + context.WriteLine( Eeprom_Add & 0xff); //debug + + context.Send(stubI2CWriteBytesRequest); +} +//------------------- read Data from EEprom-------------------------- + +public void read_data_from_eeprom ( UInt32 I2C_Add, UInt32 cnt ) +{ + StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest(); + stubI2CReadBytesRequest.I2CId = I2C_ID; + stubI2CReadBytesRequest.SlaveAddress = (I2C_Add + 1); + stubI2CReadBytesRequest.NumberOfBytesToRead = cnt; // Number of bytes to read + + var response1 = context.Send(stubI2CReadBytesRequest); + + for(int i=0; i(stubI2CWriteBytesRequest); + + return 1; +} + + +////////////////////////////////////////////////////////////// +Int32 Table_Run(Int32 Dispenser ) + +{ + Int32 COMMAND=0; + Int32 Data=0; + Int32 count=0; + + Dispenser--; //check from 0-7 + + int j=0; + var stopwatch = new Stopwatch(); + stopwatch.Start(); + + long elapsed_time = stopwatch.ElapsedMilliseconds; + context.WriteLine(elapsed_time); + + while (count!=-1) + { + msec_index=msec_index+1; + + if (Dispenser<2) + { + var response1 = context.Send("StubFpgaReadRegRequest" ,F2_LS_01_Direct); + RD_LS_01_Direct=response1.Value ; + } + else if ( (Dispenser<4) ) + { + var response1 = context.Send("StubFpgaReadRegRequest" ,F2_LS_02_Direct); + RD_LS_02_Direct=response1.Value ; + } + else if ( (Dispenser<6) ) + { + var response1 = context.Send("StubFpgaReadRegRequest" ,F2_LS_03_Direct); + RD_LS_03_Direct=response1.Value ; + } + else + { + var response1 = context.Send("StubFpgaReadRegRequest" ,F2_LS_04_Direct); + RD_LS_04_Direct=response1.Value ; + } + if (Dispenser<4) + { + var response2 = context.Send("StubIntADCReadRequest" ,0x8000 + AN_IDS_PRESSENS_1); + A2D_Dispenser[0]=(response2.SamplingInBits)>>16; + A2D_Dispenser[1] =(response2.SamplingInBits) & 0x0000ffff; + A2D_Dispenser[2] =(response2.VoltageSamplingMv)>>16; + A2D_Dispenser[3] =(response2.VoltageSamplingMv) & 0x0000ffff; + } + else + { + var response3 = context.Send("StubIntADCReadRequest" ,0x8000 + AN_IDS_PRESSENS_5); + A2D_Dispenser[4] =(response3.SamplingInBits)>>16; + A2D_Dispenser[5] =(response3.SamplingInBits)& 0x0000ffff; + A2D_Dispenser[6] =(response3.VoltageSamplingMv)>>16; + A2D_Dispenser[7] =(response3.VoltageSamplingMv)& 0x0000ffff; + } + + COMMAND=Start_Table[count]; + Data=Start_Table[(count+1)]; + //Index=Index+2; + switch (COMMAND) + { + case CMD_RUN: + Motor_Run(Data,Dispenser); + count = count+2; + break; + + case CMD_VALVE: + Valve_3W(Data,Dispenser); + count = count+2; + break; + + case CMD_STOP: + Motor_Stop(Data,Dispenser); + count = count+2; + break; + + case CMD_DLY: + Delay_on_second(Data,Dispenser); + if (Temp_Delay ==0) + { + max_pressure_level=20000; + min_pressure_level=-20000; + count = count+2; + } + break; + + case CMD_TIME: + Print_Time(); + count = count+2; + break; + + case CMD_PRESS: + max_pressure_level=Data; + context.AppendToFile(Dispenser_Fname,",Max_pressure_level is, " + Data +","+DateTime.Now+"\n"); + count = count+2; + break; + + case CMD_PRESL: + min_pressure_level=Data; + context.AppendToFile(Dispenser_Fname,",Min_pressure_level is, " + Data +","+DateTime.Now+"\n"); + count = count+2; + break; + + case CMD_LBL: + context.AppendToFile(Dispenser_Fname,",Label," + Data+","+DateTime.Now+"\n"); + if(Data==1) + Lebel1_time=stopwatch.ElapsedMilliseconds; + if(Data==2) + Lebel2_time=stopwatch.ElapsedMilliseconds; + count = count+2; + break; + + + case CMD_SMP: + context.AppendToFile(Dispenser_Fname,",SampleRate," + Data+","+DateTime.Now+"\n"); + Dispenser_sample_rate =Data; + count = count+2; + break; + + case CMD_END: + count=-1; + context.AppendToFile(Dispenser_Fname,",End testing,,"+DateTime.Now+"\n"); + break; + + case CMD_MTV_OPEN: + open_midtank_valve(Data,Dispenser); + context.AppendToFile(Dispenser_Fname,",OPEN MIDTANK, " + Dispenser+","+DateTime.Now+"\n"); + count = count+2; + break; + + case CMD_MTV_CLOSE: + close_midtank_valve(Data,Dispenser); + context.AppendToFile(Dispenser_Fname,",CLOSE MIDTANK, " + Dispenser+","+DateTime.Now+"\n"); + count = count+2; + break; + + case CMD_LOOP_NM: + + Loop_cnt=Data-1; + context.AppendToFile(Dispenser_Fname,",Counter Loop,"+ Data+","+DateTime.Now +"\n"); + count = count+2; + break; + + case CMD_LOOP: + + if (Loop_cnt!=0) + { + context.AppendToFile(Dispenser_Fname,"Counter Loop,"+ Loop_cnt+","+DateTime.Now+"\n" ); + count = count+2*Data; + Loop_cnt--; + + } + else + { + context.AppendToFile(Dispenser_Fname,",End loop,,"+DateTime.Now +"\n"); + count = count+2; + } + break; + + default: + break; + + } + + long elapsed_time1 = stopwatch.ElapsedMilliseconds; + long elapsed_time2= elapsed_time1-elapsed_time; + if (elapsed_time2>95) + elapsed_time2=95; //minimum time + Thread.Sleep(100-(int )(elapsed_time2)); + + elapsed_time = stopwatch.ElapsedMilliseconds; + + + j++; + if (j==10) + { + j=0; + context.WriteLine(Dispenser_press[Dispenser]+ " mBar\t"+state + "\tTime-" + (elapsed_time/1000)); + } + } + time_Table=elapsed_time; + return 0; +} + +/////////////////////////////////////////////////////////////////// +Int32 Motor_Run(Int32 speed,Int32 Dispenser) + +{ + + switch (Dispenser) + { + case 0: + if ( speed<0) + { + Motor_Dir[0]=2; + if ((RD_LS_01_Direct & 0x04)!=0x04) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + + context.Send("StubMotorRunRequest" ,Dispenser_Motor1, false, (-speed)); + } + else + { + Motor_Dir[0]=1; + if ((RD_LS_01_Direct & 0x20)!=0x20) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor1, true, (speed)); + } + break; + + case 1: + if ( speed<0) + { + Motor_Dir[1]=2; + if ((RD_LS_01_Direct & 0x100)!=0x100) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor2, false, (-speed)); + } + else + { + Motor_Dir[1]=1; + if ((RD_LS_01_Direct & 0x800)!=0x800) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor2, true, (speed)); + } + break; + + case 2: + if ( speed<0) + { + Motor_Dir[2]=2; + if ((RD_LS_02_Direct & 0x04)!=0x04) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor3, false, (-speed)); + } + else + { + Motor_Dir[2]=1; + if ((RD_LS_02_Direct & 0x20)!=0x20) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now+ ",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor3, true, (speed)); + } + break; + + case 3: + if ( speed<0) + { + Motor_Dir[3]=2; + + if ((RD_LS_02_Direct & 0x100)!=0x100) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now+ ",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor4, false, (-speed)); + } + else + { + Motor_Dir[3]=1; + + if ((RD_LS_02_Direct & 0x800)!=0x800) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor4, true, (speed)); + } + break; + + case 4: + if ( speed<0) + { + Motor_Dir[4]=2; + if ((RD_LS_03_Direct & 0x04)!=0x04) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now+ ",Warning Motor on Limit\n"); + return 0; + } + + context.Send("StubMotorRunRequest" ,Dispenser_Motor5, false, (-speed)); + } + else + { + Motor_Dir[4]=1; + if ((RD_LS_03_Direct & 0x20)!=0x20) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now+ ",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor5, true, (speed)); + } + break; + + case 5: + if ( speed<0) + { + Motor_Dir[5]=2; + if ((RD_LS_03_Direct & 0x100)!=0x100) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor6, false, (-speed)); + } + else + { + Motor_Dir[5]=1; + if ((RD_LS_03_Direct & 0x800)!=0x800) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now+ ",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor6, true, (speed)); + } + break; + + case 6: + if ( speed<0) + { + Motor_Dir[6]=2; + if ((RD_LS_04_Direct & 0x04)!=0x04) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor7, false, (-speed)); + } + else + { + Motor_Dir[6]=1; + if ((RD_LS_04_Direct & 0x20)!=0x20) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor7, true, (speed)); + } + break; + + case 7: + if ( speed<0) + { + Motor_Dir[7]=2; + + if ((RD_LS_04_Direct & 0x100)!=0x100) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor8, false, (-speed)); + } + else + { + Motor_Dir[7]=1; + + if ((RD_LS_04_Direct & 0x800)!=0x800) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Motor on Limit\n"); + return 0; + } + context.Send("StubMotorRunRequest" ,Dispenser_Motor8, true, (speed)); + } + break; + + default: + break; + + } + context.AppendToFile(Dispenser_Fname,",Run," +speed+","+DateTime.Now +"\n" ); + + return 1; +} + + + Int32 Valve_3W(Int32 Valve_Value,Int32 Dispenser) +{ + if ( Valve_Value==1) + context.Send("StubValveRequest" ,Dispenser_Valve1+Dispenser, 3, true); //3 3Way + else + context.Send("StubValveRequest" ,Dispenser_Valve1+Dispenser, 3, false); //3 3Way + + context.AppendToFile(Dispenser_Fname,",Dispenser Valve position is, " + Valve_Value+","+DateTime.Now +"\n" ); + + return 1; +} +//--------------------------------------- + + Int32 Motor_Stop(Int32 Stop_Value,Int32 Dispenser ) +{ + context.Send("StubMotorStopRequest" ,Dispenser_Motor1+Dispenser, Stop_Value); + + context.AppendToFile(Dispenser_Fname,",Motor Stop," + Stop_Value+","+DateTime.Now +"\n"); + Motor_Dir[Dispenser]=0; + return 1; +} + +//--------------------------------------- + + Int32 Delay_on_second(Int32 Delay,Int32 Dispenser ) +{ +//Int32 temp1; +Int32 pressure_om_mBAR=0; + if (Temp_Delay ==0) + { + context.AppendToFile(Dispenser_Fname,",DLY, " + Delay +","+DateTime.Now+"\n"); + Temp_Delay = Delay *10 -1; +// context.Write("A"); //debug + } + else + Temp_Delay--; + + if ( LimitSW_Dispenser(Dispenser)==0) + { + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now+",Warning Motor on Limit\n"); + MotorStop(Dispenser); + Temp_Delay =0; //end delay +// context.Write("C"); //debug + + return 0 ; + } + + pressure_om_mBAR=Calc_mBAR(Dispenser,true); + if (pressure_om_mBAR > max_pressure_level) + { + // MotorStop(Dispenser); + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Pressure too high\n"); + Temp_Delay =0; //end delay +// context.Write("D"); //debug + + return 0; + } + if (pressure_om_mBAR < min_pressure_level) + { + // MotorStop(Dispenser); + context.AppendToFile(Dispenser_Fname,",,,"+DateTime.Now +",Warning Pressure too low\n"); + Temp_Delay =0; //end delay +// context.Write("D"); //debug + + return 0; + } + + + return 1; +} + +Int32 LimitSW_Dispenser(Int32 Dispenser) +{ + + if (Dispenser==0) + + { + +// var response1 = context.Send("StubFpgaReadRegRequest" ,F2_LS_01_Direct); + + if (((RD_LS_01_Direct & 0x04)!=0x04) && (Motor_Dir[0]==2)) + return 0; + else + if (((RD_LS_01_Direct & 0x20)!=0x20) && (Motor_Dir[0]==1)) + return 0; + else + return 1; + } + + if (Dispenser==1) + + { +// var response2 = context.Send("StubFpgaReadRegRequest" ,F2_LS_01_Direct); + if (((RD_LS_01_Direct & 0x100)!=0x100) && (Motor_Dir[1]==2)) + return 0; + else + if (((RD_LS_01_Direct & 0x800)!=0x800) && (Motor_Dir[1]==1)) + return 0; + else + return 1; + } + + + if (Dispenser==2) + + { + + //var response3 = context.Send("StubFpgaReadRegRequest" ,F2_LS_02_Direct); + if (((RD_LS_02_Direct & 0x04)!=0x04) && (Motor_Dir[2]==2)) + return 0; + else + if (((RD_LS_02_Direct & 0x20)!=0x20) && (Motor_Dir[2]==1)) + return 0; + else + return 1; + + } + + if (Dispenser==3) + + { + var response4 = context.Send("StubFpgaReadRegRequest" ,F2_LS_02_Direct); + if (((RD_LS_02_Direct & 0x100)!=0x100) && (Motor_Dir[3]==2)) + return 0; + else + if (((RD_LS_02_Direct & 0x800)!=0x800) && (Motor_Dir[3]==1)) + return 0; + else + return 1; + } + + + + + if (Dispenser==4) + + { + +// var response1 = context.Send("StubFpgaReadRegRequest" ,F2_LS_01_Direct); + if (((RD_LS_03_Direct & 0x04)!=0x04) && (Motor_Dir[4]==2)) + return 0; + else + if (((RD_LS_03_Direct & 0x20)!=0x20) && (Motor_Dir[4]==1)) + return 0; + else + return 1; + } + + if (Dispenser==5) + + { +// var response2 = context.Send("StubFpgaReadRegRequest" ,F2_LS_01_Direct); + if (((RD_LS_03_Direct & 0x100)!=0x100) && (Motor_Dir[5]==2)) + return 0; + else + if (((RD_LS_03_Direct & 0x800)!=0x800) && (Motor_Dir[5]==1)) + return 0; + else + return 1; + } + + + if (Dispenser==6) + + { + + //var response3 = context.Send("StubFpgaReadRegRequest" ,F2_LS_02_Direct); + if (((RD_LS_04_Direct & 0x04)!=0x04) && (Motor_Dir[6]==2)) + return 0; + else + if (((RD_LS_04_Direct & 0x20)!=0x20) && (Motor_Dir[6]==1)) + return 0; + else + return 1; + + } + + if (Dispenser==7) + + { +// var response4 = context.Send("StubFpgaReadRegRequest" ,F2_LS_02_Direct); + if (((RD_LS_04_Direct & 0x100)!=0x100) && (Motor_Dir[7]==2)) + return 0; + else + if (((RD_LS_04_Direct & 0x800)!=0x800) && (Motor_Dir[7]==1)) + return 0; + else + return 1; + } + + + return 0; +} + + +Int32 Print_Time() +{ + context.AppendToFile(Dispenser_Fname,",Time is\t,,"+ DateTime.Now +"\n" ); + + return 1; +} + + + +Int32 Calc_mBAR(Int32 Dispenser, bool save_press) +{ +Int32 Data; +Int32 Sense1; +Int32 temp=0; + + Data =A2D_Dispenser[Dispenser]; + if (Data<100) + temp=-1; + Data=Data-710; + if (Data<0) + Data=0; + + Data=Data*(10000+PressureSensorType*1000)/2840; // for -1 to 10 bar Press_Sensor_Type=1 else 0 + Data=Data-1000*PressureSensorType; // for -1 to 10 bar + + if (temp==-1) //if SamplingInBits <100 then No pressure sensor exist + Sense1=-9999 ; + else + Sense1=Data ; + if ( ((msec_index) % (Dispenser_sample_rate)) == 0) + { + context.AppendToFile(Dispenser_Fname,"" + Sense1+"\n"); + } + Dispenser_press[Dispenser]=Sense1; + return Sense1; + + } + + +//-------------------------------- +int open_midtank_valve (Int32 valve_type,Int32 valve_nm) //valve_type=0 is Air ,1 is Ink ; valve_nm 0-7 +{ + SetBit (F3_VALVE_OUT,((valve_type+1)*8)- valve_nm-1, 1); + return 1; + +} +//-------------------------------- +int close_midtank_valve (Int32 valve_type,Int32 valve_nm) //valve_type=0 is Air ,1 is Ink ; valve_nm 0-7 +{ + SetBit (F3_VALVE_OUT,((valve_type+1)*8)- valve_nm-1, 0); + return 1; +} +//-------------------------------- +Int32 SetBit(Int32 Adr, Int32 BitNo, Int32 Bit) +{ + Int32 BitMask; + + var response = context.Send("StubFpgaReadRegRequest" , F3_VALVE_OUT); + Int32 RV = (Int32) response.Value & 0xffff; + + + if (Bit == 0x1) + { + BitMask = 0x1 << BitNo; + RV = RV | BitMask; + context.Send("StubFpgaWriteRegRequest" ,F3_VALVE_OUT , RV); + } + else if (Bit == 0x0) + { + BitMask = ~(0x1 << BitNo); + RV = RV & BitMask; + context.Send("StubFpgaWriteRegRequest" ,F3_VALVE_OUT , RV); + } + return 1; +} +//---------------------------------- + void MotorStop(Int32 i) +{ + +context.Send("StubMotorStopRequest" ,Dispenser_Motor1+i, 2); +Motor_Dir[i]=0; //0 stop 1- up 2-dn + +} + +} \ No newline at end of file diff --git a/Software/Stubs Collection/Procedures/WHS_waste_Tank_Calibration_Save_V0.pproj b/Software/Stubs Collection/Procedures/WHS_waste_Tank_Calibration_Save_V0.pproj new file mode 100644 index 000000000..3bd4b1f84 --- /dev/null +++ b/Software/Stubs Collection/Procedures/WHS_waste_Tank_Calibration_Save_V0.pproj @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Drawing; +using Google.Protobuf; +using Tango.BL.Entities; +using Tango.BL.Enumerations; +using Tango.PMR.Stubs; +using Tango.PMR.Diagnostics; +using Tango.FSE.Common.Connection; +using Tango.FSE.Common.Diagnostics; +using Tango.FSE.Procedures; + + +public class Program +{ + double V0_default_ml = 8.7433; + + public void OnExecute(IProcedureContext context) + { + + var response1 = context.RequestUserInputFor("Warning - you are going to change the value of Vo in the eeprom !!!\nPlease Enter Password to confirme:",""); + if (response1=="Aa123456") + { + context.WriteLine(response1); + + //Write_0_Vo_in_ml_to_eeprom + context.WriteLine("\nWrite_0_Vo_in_ml_to_eeprom"); + StubWhsEEpromRequest stubWhsEEpromRequest = new StubWhsEEpromRequest(); + stubWhsEEpromRequest.BurnRequest = true; //write + StubWhsEEpromData stubWhsEEpromData = new StubWhsEEpromData(); + stubWhsEEpromData.Orifice1Flow = 0; + stubWhsEEpromRequest.WhsEEprom = stubWhsEEpromData; + var response = context.Send(stubWhsEEpromRequest); + + //wait_10mSec + context.WriteLine("\nwait_10mSec"); + Thread.Sleep(100); //Sleep for 10 milli. + + //Read_Vo_in_ml_from_eeprom & verify it is 0 + context.WriteLine("\nRead_Vo_in_ml_from_eeprom & verify it is 0"); + stubWhsEEpromRequest.BurnRequest = false; //write + stubWhsEEpromRequest.WhsEEprom = stubWhsEEpromData; + var response2 = context.Send(stubWhsEEpromRequest); + + //Read_Vo_in_mV + context.WriteLine("\nRead_Vo_in_mV"); + var response3 = context.Send("ProgressRequest" ,0x3EC, 0x01); + //Print_Vo_in_mV + context.WriteLine(response3.Progress); + + //check validity + context.WriteLine("\ncheck validity"); + if((response3.Progress <= 800) || (response3.Progress >=1200)) + { + response3.Progress = 1076; //default + context.Write("\nERROR ------ Vreading value outside the defined range !!! ------"); + context.AddResult(ResultType.Failed , "Error", "ERROR ------ Vreading value outside the defined range !!! ------"); + } + else + { + //calculate_V0_in_ml + context.WriteLine("\ncalculate_V0_in_ml"); + V0_default_ml = V0_default_ml * response3.Progress; + + //print_Vo_in_ml + context.WriteLine("\nprint_Vo_in_ml"); + context.WriteLine(V0_default_ml); + context.WriteLine(""); + + //Write_Vo_in_ml_to_eeprom + context.WriteLine("\nWrite_Vo_in_ml_to_eeprom"); + stubWhsEEpromRequest.BurnRequest = true; //write + + stubWhsEEpromData.Orifice1Flow = V0_default_ml; + stubWhsEEpromRequest.WhsEEprom = stubWhsEEpromData; + var response4 = context.Send(stubWhsEEpromRequest); + + //wait_10mSec + context.WriteLine("\nwait_10mSec"); + Thread.Sleep(100); //Sleep for 10 milli. + + //Read_Vo_in_ml_from_eeprom + context.WriteLine("\nRead_Vo_in_ml_from_eeprom"); + stubWhsEEpromRequest.BurnRequest = false; //write + stubWhsEEpromRequest.WhsEEprom = stubWhsEEpromData; + var response5 = context.Send(stubWhsEEpromRequest); + + //Check if we read the correct value + context.WriteLine("\nVerify that we read the correct value of Orifice1Flow!!"); + context.AddResult(ResultType.Passed , "Pass", "Calibration Pass."); + + } + } + else + { + context.AddResult(ResultType.Failed , "Error", "Password Fail."); + } + context.WriteLine("\n -- END OF SCRIPT -- "); + } +} + -- cgit v1.3.1