//======================================================================== //ISODAT NT SCRIPT LANGUAGE (ISL) : Dual Inlet Basic Script //======================================================================== // // History list // // Author Date Reason changes // --------------------------------------------------------------------------------------------------------------------- // H. Jeglinski 23.02.2003 Created // Alexander Duhr 09.04.2004 Kochi pressAdjust Results printed correctly // Bo He (UoC) 06.08.2011 MicroVol mode // Bo He (UoC) 06.25.2011 MicroVol baseline // Bo He (UoC) 04.27.2012 default PeakCenter() not passing value to gas configuration, fixed. //------------------------------------------------------------------------------------------------------------------------- const string PaPageName ="PressAdjust"; const number nMaxPumpCycles =300; const number nMaxExpansionTries =10; //------------------------------------------------------------------------------------------------------------------------- external bool g_bDoAutoFocus =1; //------------------------------------------------------------------------------------------------------------------------- include "lib\math.isl" include "lib\stdisl.isl" include "lib\instrument.isl" //include "lib\UF Multiport_lib.isl" //include "lib\SingleInlet_lib.isl" //------------------------------------------------------------------------------------------------------------------------- //......................................................................................................................... //Method Parameter MS //......................................................................................................................... external number Ms_IntegrationTime =8000; external number Ms_PeakCenterPostDelay =0; external number Ms_PeakCenterPreDelay =5000; external number Ms_PeakCenterChannel =2; //......................................................................................................................... //Method Parameter Dual Inlet //......................................................................................................................... external number Dual_Inlet_Standard =DI_RIGHT; external number Dual_Inlet_Sample =DI_LEFT; external number Dual_Inlet_Idle =15000; external number Dual_Inlet_Cycles =8; external number Dual_Inlet_Slices =1; external number Dual_Inlet_Fore_Vacuum_Threshold=0.05; external number Dual_Inlet_High_Vacuum_Pump_Time=2000; external number Dual_Inlet_Fore_Vacuum_Pump_Time=6000; external channel Dual_Inlet_g_nPaChannel =0; external number Dual_Inlet_g_nPaInty =5000; //......................................................................................................................... //Reference Refill //......................................................................................................................... external number RR_Fore_Vacuum_Threshold =0.05; external number RR_High_Vacuum_Pump_Time =5000; external number RR_Refill_Time =1000; external number RR_Overlay_Time =1000; //......................................................................................................................... //Buffered Refill //......................................................................................................................... external number BB_Refill_Time =1000; //------------------------------------------------------------------------------------------------------------------------- external number g_bMicroVolumeUsed =FALSE; external number g_nWaitBeforeMeasurement=0; //------------------------------------------------------------------------------------------------------------------------- external CActionPressAdjust DualInlet_PressAdjust; external CActionBackground DualInlet_Background; //------------------------------------------------------------------------------------------------------------------------- function Switch_Valve39 (number nNewState) { number nSpectrometerType=_GetSpectrometerType(); bool bExtraValve=(nSpectrometerType>=10); handle hScript=NULL; number nCurrentState=_Get("Dual Inlet System/Valve 39"); if (bExtraValve) { if (nCurrentState!=nNewState) { hScript=_ExecuteScript("Dual Inlet/Valve39.isl"); } } else { _Set("Dual Inlet System/Valve 39",nNewState); } } //------------------------------------------------------------------------------------------------------------------------- function DiOpenHighVacPump() { // _Set("Dual Inlet System/Valve 39",0); call Switch_Valve39(0); _Set("Dual Inlet System/Valve 40",1); } //------------------------------------------------------------------------------------------------------------------------- function DiOpenForeVacPump() { _Set("Dual Inlet System/Valve 40",0); call Switch_Valve39(1); // _Set("Dual Inlet System/Valve 39",1); } //------------------------------------------------------------------------------------------------------------------------- function CloseVacPumps() { _Set("Dual Inlet System/Valve 40",0); call Switch_Valve39(0); // _Set("Dual Inlet System/Valve 39",0); } //------------------------------------------------------------------------------------------------------------------------- function DiPumpHigh() { if (Dual_Inlet_High_Vacuum_Pump_Time>0) { call DiOpenHighVacPump(); _Delay(Dual_Inlet_High_Vacuum_Pump_Time,1,"DI: Pump with Turbo Pump"); } call CloseVacPumps(); } //------------------------------------------------------------------------------------------------------------------------- function DiReadVolumePressure(int nSide) : number { number nResult; if (nSide == DI_RIGHT) { nResult=_GetCalc("Dual Inlet System/Volume Pressure right"); } else { nResult=_GetCalc("Dual Inlet System/Volume Pressure left"); } return nResult; } //------------------------------------------------------------------------------------------------------------------------- function DiSwitchX(int nSide,int nNo,bool bOpen,number nDelay) { string csValve; if (nSide == DI_RIGHT) { csValve=_strFormat("Dual Inlet System/Valve 2%0.0f",nNo); } else { csValve=_strFormat("Dual Inlet System/Valve 1%0.0f",nNo); } _Set(csValve,bOpen); if (nDelay){_Delay(nDelay);} } //------------------------------------------------------------------------------------------------------------------------- function DiWaitForForeVacuum(number nThreshold) //----------------------------Broedje------------------ //{ //---------------- if (_IsFake()==0) { number nVacuum=1000; number nCycle=0; while (nVacuum>nThreshold) { nVacuum=_GetCalc("Dual Inlet System/Fore Vacuum"); _Delay(500); _UserInfo("DI: Waiting to reach Threshold %0.4f mBar [ %0.0f sec ] : Pressure %0.4f mBar",19,3,nThreshold,nCycle,nVacuum); nCycle++; if (nCycle>nMaxPumpCycles) { string sInfo=_strFormat("DI: Pressure Threshold %0.4f mBar not reached : %0.4f mBar",nThreshold,nVacuum); _ScriptError(sInfo,ERROR_TYPE_SCR_SEQ); } } } //} //------------------------------------------------------------------------------------------------------------------------- function DiExpand(int nSide,number nThreshold,number nMaxTries) : bool { number nPressure; number nTries; bool bOk=FALSE; for (nTries=0;nTries",ERROR_TYPE_SCR_SEQ, nResult); } else { _UserInfo("Peak Center found at [%0.0f]",0,0,nResult); if (bDoAutoFocus) { _UserInfo("Start Auto Focus",0,1); bAutoFocusSuccess = _RunAutoFocusExt (FALSE, TRUE, TRUE); if (bAutoFocusSuccess) { _UserInfo("Auto Focus successfull finished.",0,1); nResult=_PeakCenter(Ms_PeakCenterChannel); } else { _UserInfo("Auto Focus failed.",0,1); } } } _Delay(Ms_PeakCenterPostDelay); call ChangeOverClose(); } else { _UserInfo("Peak Center skipped",1,1); if (bDoAutoFocus) { call OpenReference(TRUE); _Delay(Ms_PeakCenterPreDelay,1,"Auto Focus pre Delay"); _UserInfo("Start Auto Focus",0,1); bAutoFocusSuccess = _RunAutoFocusExt (FALSE, TRUE, TRUE); if (bAutoFocusSuccess) { _UserInfo("Auto Focus successfull finished.",0,1); } else { _UserInfo("Auto Focus failed.",0,1); } call OpenReference(FALSE); _Delay(Ms_PeakCenterPostDelay,1,"Auto Focus post Delay"); } } return (nResult>=0); } //------------------------------------------------------------------------------------------------------------------------- //Modified by Bo He on 2012-04-27------------------------------------------------------------------------------------------ function doAPeakCenter() { _UserInfo("Start Peak Center",0,1); call SwitchChangeOver(Dual_Inlet_Standard); call DiSwitchX(Dual_Inlet_Standard,5,1,0); _Delay(Ms_PeakCenterPreDelay); _PeakCenter(Ms_PeakCenterChannel); _SetGasConfValues(); _Delay(Ms_PeakCenterPostDelay); call ChangeOverClose(); } //------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------------------------- function Pressureadjust() :bool { bool bPressAdjustOn=_GetSequenceFlag("Pressadjust",FALSE); if (bPressAdjustOn) { if (g_bMicroVolumeUsed){_ChangePaMode(3);} call DiSwitchX(Dual_Inlet_Standard,5,1,0); _UserInfo("Start Pressure Adjustment",0,1); string csResult="?"; string csInfo=""; if (_ObjectPressAdjust(DualInlet_PressAdjust,csResult)) { csInfo="PressAdjust: "; csInfo+=csResult; _UserInfo(csInfo,0,0); } else { _UserInfo("Pressure Adjustment failed",0,0); } _UserInfo("Pressure Adjustment finished",0,1); } else { _UserInfo("Pressure Adjustment skipped",1,1); } if (g_bMicroVolumeUsed) {call DiSwitchX(Dual_Inlet_Standard,5,0,0);} return TRUE; } //------------------------------------------------------------------------------------------------------------------------- function TransferSample() { } //------------------------------------------------------------------------------------------------------------------------- function TransferReference() { if (_IsDeviceAvailable("Reference Refill")==TRUE) { call ReferenceRefill() } if (_IsDeviceAvailable("Buffered Refill")==TRUE) { call BufferedRefill() } } //------------------------------------------------------------------------------------------------------------------------- function SampleFromMultiport() { } //------------------------------------------------------------------------------------------------------------------------- function ClickCklack() { number nClickClackDlay=500; _UserInfo("...Click Clack...",0,1); call SwitchChangeOver(Dual_Inlet_Sample); _Delay(nClickClackDlay); call SwitchChangeOver(Dual_Inlet_Standard); _Delay(nClickClackDlay); call SwitchChangeOver(Dual_Inlet_Sample); _Delay(nClickClackDlay); call SwitchChangeOver(Dual_Inlet_Standard); } //-------------------------------------------------------------------------------------------------------------------------- function DiMeasurementLoop(number nCycles, number nPreDelay, number nStandardSide, number nIntegrationTime) { _UserInfo("DiMeasurementLoop Cy:%0.0f Prdl:%0.0f IT:%0.0f",0,1,nCycles,nPreDelay,nIntegrationTime); nIntegrationTime/=Dual_Inlet_Slices; //........................................................................................................................ //Close bellow valve on capilliry mode //........................................................................................................................ if (g_bMicroVolumeUsed) { _Set("Dual Inlet System/Valve 15",0); _Set("Dual Inlet System/Valve 25",0); } else { if ((Dual_Inlet_Standard==DI_LEFT) || (Dual_Inlet_Sample==DI_LEFT)) { _Set("Dual Inlet System/Valve 15",1); } if ((Dual_Inlet_Standard==DI_RIGHT) || (Dual_Inlet_Sample==DI_RIGHT)) { _Set("Dual Inlet System/Valve 25",1); } } /* //-------------------J.Broedje-------------------------11-2004 //High Vacuum readout Sample ----------- call SwitchChangeOver(Dual_Inlet_Sample); _Delay(5000); number nHighVac=_GetCalc("Isotope MS/High Vacuum"); _UserInfo("HighVacuumSample=%2.10f",1,0,nHighVac); //High Vacuum readoutStandard ----------- call SwitchChangeOver(Dual_Inlet_Standard); _Delay(5000); nHighVac=_GetCalc("Isotope MS/High Vacuum"); _UserInfo("HighVacuumStandard=%2.10f",1,0,nHighVac); */ //-----Delay before measuring--------Broedje?????------------------------------- _Delay(g_nWaitBeforeMeasurement); //----------------------------- collector colSmp; collector colStd; number nSampleSide=Dual_Inlet_Sample; nStandardSide =Dual_Inlet_Standard; //........................................................................................................................ //One pre standard //........................................................................................................................ call SwitchChangeOver(nStandardSide); _Delay(nPreDelay); _CollectorIntegrate(colStd,nIntegrationTime,Dual_Inlet_Slices,TRUE); _CollectorSend(colStd,1); //........................................................................................................................ //Now measure g_nCycles //........................................................................................................................ number nCount; for (nCount=0;nCount