//======================================================================== //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 // // // //------------------------------------------------------------------------------------------------------------------------- const string PaPageName ="PressAdjust"; const number nMaxPumpCycles =300; const number nMaxExpansionTries =20; //schauer changed from 10 to 20 on 150305 //------------------------------------------------------------------------------------------------------------------------- external bool g_bDoAutoFocus =1; //------------------------------------------------------------------------------------------------------------------------- include "lib\math.isl" include "lib\stdisl.isl" include "lib\instrument.isl" //------------------------------------------------------------------------------------------------------------------------- //......................................................................................................................... //Method Parameter MS //......................................................................................................................... external number Ms_IntegrationTime =8000; external number Ms_PeakCenterPostDelay =0; external number Ms_PeakCenterPreDelay =5000; external number Ms_PeakCenterChannel =2; external number Ms_PostSamplePeakCenterChannel =0; //......................................................................................................................... //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.01; 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; //Reference Refill and Zero added by Schauer external number samP =0; external number refP =0; //external number zeroP =40; //set to be read from sequence text external string mpi =""; external string id2 =""; // PBL constants external number PBLoffset =525; external number stepsperkV =6553.5; external number peakcenterkV =0; external number pblkV =0; external number onpeakcenter =0; external number pblHV =0; //Pre-Acquisition Conditioner etc const number postpressdelay =30000; const number cndtnrdelay =30000; //......................................................................................................................... //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); //schauer - 131215 - trying to prevent venting when multiport tube leaks on initial pumpdown _Set("Multiport/Valve 1",0); _Set("Multiport/Valve 2",0); _Set("Multiport/Valve 3",0); _Set("Multiport/Valve 4",0); _Set("Multiport/Valve 5",0); _Set("Multiport/Valve 6",0); _Set("Multiport/Valve 7",0); _Set("Multiport/Valve 8",0); _Set("Multiport/Valve 9",0); _Set("Multiport/Valve 10",0); _UserInfo("All multiport valves closed for safety",0,1); _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;nTriesrefP) { refP=call DiReadVolumePressure(DI_RIGHT); if (samP<=refP) { _Set("Dual Inlet System/Valve 22",0); _Set("Dual Inlet System/Valve 24",0); } } call DiSwitchX(Dual_Inlet_Standard,4,0,0); //call DiSwitchX(Dual_Inlet_Standard,5,1,0); _ConnectDev("Reference Refill",0); if (Dual_Inlet_Standard==0) // 0 Standard is left { nVacuum=_GetCalc("Dual Inlet System/Volume Pressure left"); } else { nVacuum=_GetCalc("Dual Inlet System/Volume Pressure right"); } _UserInfo("DI: Reference Refill finished with pressure %2.1f mbar",0,1,nVacuum); _UserInfo("RR pressure %2.1f",0,2,nVacuum); } else { _UserInfo("DI: Reference Refill skipped",1,1); } return TRUE; } //------------------------------------------------------------------------------------------------------------------------- function BufferedRefill() :bool { bool bReferenceRefill=_GetSequenceFlag("Buffered Refill",TRUE); if (bReferenceRefill==TRUE) { _UserInfo("Start Buffered Refill",0,1); call DiSwitchX(Dual_Inlet_Standard,5,0,0); call DiSetVolume(Dual_Inlet_Standard,100); call DiSwitchX(Dual_Inlet_Standard,4,1,0); _ConnectDev("Buffered Refill",1); _Delay(BB_Refill_Time); _ConnectDev("Buffered Refill",0); call DiSwitchX(Dual_Inlet_Standard,4,0,0); call DiSwitchX(Dual_Inlet_Standard,5,1,0); _UserInfo("Buffered Refill finished",0,1); } else { _UserInfo("Buffered Refill skipped",1,1); } return TRUE; } //------------------------------------------------------------------------------------------------------------------------- function Background() :bool { string csResult="?"; string csInfo="Background: "; bool bBackground=_GetSequenceFlag("Background",FALSE); if (bBackground==TRUE) { _UserInfo("Start Background",0,1); call ChangeOverClose(); if (_ObjectBackground(DualInlet_Background,csResult)) { csInfo+=csResult; _UserInfo(csInfo,0,0); } else { _UserInfo("Background failed",0,0); } _UserInfo("Background finished",0,1); call SwitchChangeOver(Dual_Inlet_Standard); } else { if (_ReportBackground(DualInlet_Background,csResult)) { csInfo+=csResult; _UserInfo(csInfo,0,0); } } return TRUE; } //------------------------------------------------------------------------------------------------------------------------- function Background_PBL() :bool { string csResult="?"; string csInfo="Background: "; bool bBackground=_GetSequenceFlag("Background",FALSE); if (bBackground==TRUE) { _UserInfo("Start PBL Background",0,1); call ChangeOverRight(); if (_ObjectBackground(DualInlet_Background,csResult)) { csInfo+=csResult; _UserInfo(csInfo,0,0); } else { _UserInfo("Background failed",0,0); } _UserInfo("PBL Background finished",0,1); call SwitchChangeOver(Dual_Inlet_Standard); } else { if (_ReportBackground(DualInlet_Background,csResult)) { csInfo+=csResult; _UserInfo(csInfo,0,0); } } return TRUE; } //------------------------------------------------------------------------------------------------------------------------- function PeakCenter() : number //modified by Schauer 130116 { bool bPeakCenterOn=_GetSequenceFlag("Peak Center",FALSE); bool bDoAutoFocus = _GetSequenceFlag("AutoFocus",FALSE); if (g_bDoAutoFocus==FALSE) { bDoAutoFocus = FALSE; } bool bAutoFocusSuccess = TRUE; number nResult=0; if (bPeakCenterOn==TRUE) { _UserInfo("Start Peak Center",0,1); call SwitchChangeOver(Dual_Inlet_Standard); call DiSwitchX(Dual_Inlet_Standard,5,1,0); _Delay(Ms_PeakCenterPreDelay); nResult=_PeakCenter(Ms_PeakCenterChannel); pblHV = nResult; if (nResult<0) { _ScriptError("Peak Center failed <%0.0f>",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_PostSamplePeakCenterChannel); } 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 (pblHV); } //------------------------------------------------------------------------------------------------------------------------- function PostSamplePeakCenter() : bool { bool bPeakCenterOn=_GetSequenceFlag("Peak Center",FALSE); number nResult=0; if (bPeakCenterOn==TRUE) { _UserInfo("Start Post Sample Peak Center",0,1); call SwitchChangeOver(Dual_Inlet_Standard); call DiSwitchX(Dual_Inlet_Standard,5,1,0); _Delay(Ms_PeakCenterPreDelay); nResult=_PeakCenter(Ms_PeakCenterChannel); if (nResult<0) { _ScriptError("Post Sample Peak Center failed <%0.0f>",ERROR_TYPE_SCR_SEQ, nResult); } else { _UserInfo("Post Sample Peak Center found at [%0.0f]",0,0,nResult); } _Delay(Ms_PeakCenterPostDelay); call ChangeOverClose(); } return (nResult>=0); } //------------------------------------------------------------------------------------------------------------------------- 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); _UserInfo("Post pressure adjustment delay...30s",0,1); _Delay(postpressdelay,1,"Post pressure adjustment delay"); } else { _UserInfo("Pressure Adjustment skipped",1,1); } if (g_bMicroVolumeUsed) {call DiSwitchX(Dual_Inlet_Standard,5,0,0);} return TRUE; } //------------------------------------------------------------------------------------------------------------------------- function Pressureadjust_Schauer() :bool { number nInty = 16000; channel nChan=2; number nTol=100; call SwitchChangeOver(Dual_Inlet_Standard); _Delay(500); _SetBellowVolt(DI_RIGHT,nInty,nChan,nTol); call SwitchChangeOver(Dual_Inlet_Sample); _Delay(500); _SetBellowVolt(DI_LEFT,nInty,nChan,nTol); 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