Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -rc20c77ef196a760a7642d2426e509995e4a98e01 -r43ab88c9ad8435e0a0a3df0adde1de150c582305 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision c20c77ef196a760a7642d2426e509995e4a98e01) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 43ab88c9ad8435e0a0a3df0adde1de150c582305) @@ -677,6 +677,26 @@ /*********************************************************************//** * @brief + * The syringePumpVerifyForceSensorDACCalibration function verifies that the + * syringe pump force sensor DAC has been calibrated and is reporting no force + * as would be expected when fully retracted (caller should not call this function + * until the syringe pump is homed first). + * @details Inputs: none + * @details Outputs: + * @return none + *************************************************************************/ +void syringePumpVerifyForceSensorDACCalibration( void ) +{ + F32 DACDeltaV = fabs( forceSensorCalRecord.hdHeparinForceSensorDACVoltage - getSyringePumpForceV() ); + + if ( DACDeltaV < SYRINGE_PUMP_DAC_VOLTAGE_MAX_ERROR ) + { + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_SYRINGE_PUMP_SELF_TEST_FAILURE, DACDeltaV ) + } +} + +/*********************************************************************//** + * @brief * The getSyringePumpVolumeDelivered function gets the current syringe pump * volume delivered. * @details Inputs: syringePumpVolumeDelivered @@ -1145,26 +1165,21 @@ SELF_TEST_STATUS_T execSyringePumpSelfTest( void ) { SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; - F32 DACDeltaV; // Read/check force sensor calibration BOOL calStatus = getNVRecord2Driver( GET_CAL_HEPARIN_FORCE_SENSOR, (U08*)&forceSensorCalRecord, sizeof( HD_HEPARIN_FORCE_SENSOR_CAL_RECORD_T ), 0, ALARM_ID_HD_HEPARIN_FORCE_SENSOR_INVALID_CAL_RECORD ); - // Verify calibration - DACDeltaV = fabs( forceSensorCalRecord.hdHeparinForceSensorDACVoltage - getSyringePumpForceV() ); - #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) #endif { - if ( ( TRUE == calStatus ) && ( DACDeltaV < SYRINGE_PUMP_DAC_VOLTAGE_MAX_ERROR ) ) + if ( TRUE == calStatus ) { result = SELF_TEST_STATUS_PASSED; } else { result = SELF_TEST_STATUS_FAILED; - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_SYRINGE_PUMP_SELF_TEST_FAILURE, DACDeltaV ) } } Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -r8b73263b38f449dacc0795c67a7cf6240cb79026 -r43ab88c9ad8435e0a0a3df0adde1de150c582305 --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 8b73263b38f449dacc0795c67a7cf6240cb79026) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 43ab88c9ad8435e0a0a3df0adde1de150c582305) @@ -95,6 +95,7 @@ BOOL startHeparinContinuous( void ); BOOL setSyringePumpDACVref( void ); void syringeDetectionRequired( BOOL req ); +void syringePumpVerifyForceSensorDACCalibration( void ); BOOL isSyringeDetected( void ); BOOL isSyringePumpHome( void ); Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rc20c77ef196a760a7642d2426e509995e4a98e01 -r43ab88c9ad8435e0a0a3df0adde1de150c582305 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision c20c77ef196a760a7642d2426e509995e4a98e01) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 43ab88c9ad8435e0a0a3df0adde1de150c582305) @@ -523,6 +523,7 @@ *************************************************************************/ static HD_STANDBY_STATE_T handleStandbyModeStartState( void ) { + static BOOL homingInitiated = FALSE; HD_STANDBY_STATE_T state = STANDBY_START_STATE; // Wait for door to be closed so we can home actuators @@ -540,18 +541,28 @@ homeDialOutPump(); retractSyringePump(); - // Go to wait for treatment state - state = STANDBY_WAIT_FOR_TREATMENT_STATE; + homingInitiated = TRUE; } else { // Trigger door open alarm to prompt user to close the door activateAlarmNoData( ALARM_ID_CARTRIDGE_DOOR_OPENED ); + homingInitiated = FALSE; } + // If homing has been initiated, wait for syringe pump to home and the verify force sensor calibration + if ( ( TRUE == homingInitiated ) && ( TRUE == isSyringePumpHome() ) ) + { + syringePumpVerifyForceSensorDACCalibration(); + homingInitiated = FALSE; // reset for next time + state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check + } + return state; } +// Verify calibration + /*********************************************************************//** * @brief * The handleStandbyModeWaitForTreatmentState function handles wait for