//======================================================================== //ISODAT NT SCRIPT LANGUAGE (ISL) : Short Script //======================================================================== // // (c) 2002, Thermo Finnigan MAT // // // // // History list // // Author Date Reason changes // --------------------------------------------------------------------------------------------------------------------- // H. Jeglinski 23.02.2003 Created // Alexander Duhr 08.04.2004 Kochi Bellow init, _connectDevice // J. Broedje Feb. 2005 add valve switch delay for preventing pressure air collapse (avoid unintended valve opening) // J. Broedje Feb. 2005 wrong expansion threshold fixed // schauer 130213 bGas bug fixing // //------------------------------------------------------------------------------------------------------------------------- include "lib\DualInlet_lib_schauer.isl" include "lib\MicroVolume_lib_schauer.isl" //------------------------------------------------------------------------------------------------------------------------- //......................................................................................................................... //Multiport //......................................................................................................................... external string sMultiportName ="Multiport"; external string sMSInstMultiportName ="Pressure MP"; external string sTubeCrackerName ="Tube Cracker"; external number MP_SampleTransferTime =5000; external number MP_PressureThreshold =64; //bellows pressure after expansion from multiport, this value is set in the method // under peripherals tab as expansion threshold const number mp_upper = 340; //multiport pressure upper threshold for manual tube crackers (300 yields 100 in bellows) (360 is gauge max) const number mp_lower = 25; //multiport pressure lower threshold, 50 yields 16, not really sure about this limit //------------------------------------------------------------------------------------------------------------------------- external string g_sPortName =""; external number g_ExpansionDelay =5000; //------------------------------------------------------------------------------------------------------------------------- function MpReadMultiportPressure() : number { // string sGauge=sMultiportName; // sGauge+="/Pressure"; string sGauge="Isotope MS/"; sGauge+=sMSInstMultiportName; number nPressure=_GetCalc(sGauge); return nPressure; } //------------------------------------------------------------------------------------------------------------------------- function MpSwitchValve(string sValveName,int nState) { string sValve=sMultiportName; sValve+="/"; sValve+=sValveName; _Set(sValve,nState); } //------------------------------------------------------------------------------------------------------------------------- function MpCrackTube(string sPort) { string sNumber=_strright(sPort,(_strlen(sPort) - 6)); string sCracker=sTubeCrackerName; sCracker+="/Cracker"; sCracker+=sNumber; _Set(sCracker,1); _Delay(1000); _Set(sCracker,0); } //------------------------------------------------------------------------------------------------------------------------- function MpSampleValve(string sPort,int nState) { string sNumber=_strright(sPort,(_strlen(sPort) - 6)); string sSwitch=sMultiportName; sSwitch+="/Valve"; sSwitch+=sNumber; _Set(sSwitch,nState); } //------------------------------------------------------------------------------------------------------------------------- function MpConnect(bool bConnect) { int nState=bConnect; _ConnectDev("Multiport",bConnect); call MpSwitchValve("Bank",nState); } //------------------------------------------------------------------------------------------------------------------------- function MpPump() { _UserInfo("Pump Sample Side",0,1); _Set("Dual Inlet System/Valve 23",0); _Set("Dual Inlet System/Valve 26",0); //....................................................................................................................... //Micro volume option //....................................................................................................................... //call MvPreparePump(); //....................................................................................................................... //Multiport //....................................................................................................................... call DiSetVolume(Dual_Inlet_Sample,100); call MpConnect(1); //....................................................................................................................... //if tubecracker installed pump port //....................................................................................................................... if (_IsDeviceAvailable("Tube Cracker")) { call MpSampleValve(g_sPortName,1); } call MpSwitchValve("Waste",1); call DiPumpSide(Dual_Inlet_Sample,Dual_Inlet_Fore_Vacuum_Threshold); _Delay(Dual_Inlet_Fore_Vacuum_Pump_Time,1,"Pump Multiport with Rough Pump"); call DiPumpHigh(); if (_IsDeviceAvailable("Tube Cracker")) { call MpSampleValve(g_sPortName,0); } call MpSwitchValve("Waste",0); call MpConnect(0); call DiCloseSide(Dual_Inlet_Sample); call MvFinishPump(); _Delay(200); } //------------------------------------------------------------------------------------------------------------------------- function ExpansionPump() : number { call MpSwitchValve("Bank",0); _ConnectDev("Multiport",1); call DiPumpSide(Dual_Inlet_Sample,Dual_Inlet_Fore_Vacuum_Threshold); call DiPumpHigh(); call DiCloseSide(Dual_Inlet_Sample); _ConnectDev("Multiport",0); call MpSwitchValve("Bank",1); _Delay(g_ExpansionDelay,1); number nPressure=call MpReadMultiportPressure(); return nPressure; } //------------------------------------------------------------------------------------------------------------------------- function MpBankExpansion(number nTreshold) { call MpSwitchValve("Bank",1); _Delay(g_ExpansionDelay,1); number nPressure=call MpReadMultiportPressure(); _UserInfo("Expanding ( Bank ) Pressure %.2f mBar",0,0,nPressure); while (nPressure>nTreshold) { nPressure=call ExpansionPump(); } } //------------------------------------------------------------------------------------------------------------------------- function MpLineExpansion(number nTreshold) { number nPressure=call MpReadMultiportPressure(); _UserInfo("Expanding ( Bank + Transferline Mode ) Pressure %.2f mBar",0,0,nPressure); call MpSwitchValve("Bank",1); _Delay(g_ExpansionDelay,1); nPressure=call MpReadMultiportPressure(); while (nPressure>nTreshold) { nPressure=call MpReadMultiportPressure(); if (nPressure>nTreshold) { call MpConnect(TRUE); _Delay(g_ExpansionDelay,1); } nPressure=call ExpansionPump(); } } //------------------------------------------------------------------------------------------------------------------------- function MpBellowExpansion(number nTreshold,number nBellowPos) { number nPressure=call MpReadMultiportPressure(); _UserInfo("Expanding ( Bank + Transferline + Bellow Mode ) Pressure %.2f mBar",0,0,nPressure); call MpSwitchValve("Bank",1); _Delay(g_ExpansionDelay,1); nPressure=call MpReadMultiportPressure(); while (nPressure>nTreshold) { call DiSetVolume(Dual_Inlet_Sample,nBellowPos); call MpSwitchValve("Bank",1); _Delay(g_ExpansionDelay,1); nPressure=call MpReadMultiportPressure(); if (nPressure>nTreshold) { call MpConnect(TRUE); _Delay(g_ExpansionDelay,1); nPressure=call MpReadMultiportPressure(); if (nPressure>nTreshold) { call DiSwitchX(Dual_Inlet_Sample,4,1,0); _Delay(g_ExpansionDelay,1); } } nPressure=call ExpansionPump(); } } //------------------------------------------------------------------------------------------------------------------------- function GetPortName() : bool { bool bResult=FALSE; g_sPortName=_GetSequenceText("Multiport Inlet","None"); number nTest=_strcmp(g_sPortName,"None"); if (nTest==0) { g_sPortName=_GetSequenceText("Multiport Ext Inlet","None"); nTest=_strcmp(g_sPortName,"None"); if (nTest!=0) { sMultiportName ="Multiport Ext"; sMSInstMultiportName = "Pressure MP Ext"; sTubeCrackerName="Tube Cracker Ext"; bResult=TRUE; } } else { bResult=TRUE; } return bResult; } //------------------------------------------------------------------------------------------------------------------------- function MpFreezeSample() { number nPressure=call MpReadMultiportPressure(); if (nPressure>MV_dFreezeAllThreshold){call MpSampleValve(g_sPortName,0);} _UserInfo("MP: Transfer Sample to uVolume, Set uVolume Temp to %2.0f °C",0,1,MV_dInitialTransferTemperature); call MvSetTemperature(MV_dInitialTransferTemperature,TRUE); _Set("MicroVolume/Left",1); //-----------------------Broedje------------------- _Delay(200); //----------------------------------- call MpSwitchValve("Bank",1); call MvSetTemperature(MV_dFreezeTemperature,TRUE); _Delay(MV_dwFreezeTime,1,"Freezing..."); call MpSampleValve(g_sPortName,0); _Set("MicroVolume/Left",0); call MpSwitchValve("Bank",0); _UserInfo("MP: Prepare Sample Measurement, Set uVolume Temp to %2.0f °C",0,1,MV_dHeatTemperature); call MvSetTemperature(MV_dHeatTemperature,TRUE); g_bMicroVolumeUsed=TRUE; } //------------------------------------------------------------------------------------------------------------------------- function MpExpandSample() { //....................................................................................................................... //close sample valve - the sample is in the bank line now //....................................................................................................................... call MpSampleValve(g_sPortName,0); number nPressure=call MpReadMultiportPressure(); if (nPressure>MV_dFreezeBankThreshold) { if (MV_iExpansionVolume==EV_BANK) { call MpBankExpansion(MV_dFreezeBankThreshold); } if (MV_iExpansionVolume==EV_LINE) { call MpLineExpansion(MV_dFreezeBankThreshold); } if (MV_iExpansionVolume==EV_BELLOW) { call MpBellowExpansion(MV_dFreezeBankThreshold,MV_dBellowPosition); } _Delay(MV_dwSampleEqualibrationTime,1,"Equilibrating after expansion..."); call MpSwitchValve("Bank",0); } nPressure=call MpReadMultiportPressure(); _UserInfo("Pressure after expansion %.2f mBar",0,0,nPressure); } //------------------------------------------------------------------------------------------------------------------------- function MpTransferMicrovolume() : bool { bool bOk=FALSE; if (_IsDeviceAvailable("MicroVolume")) { if (MV_bDirectFreeze==FALSE) { number nPressure=call MpReadMultiportPressure(); //--------------------------------------Broedje---------------------------- // if (nPressure>MV_dFreezeAllThreshold) if (nPressure>MV_dFreezeBankThreshold) //-------------------------------------------------------------- { call MpExpandSample(); call ExpansionPump(); // ftheine + jbroedje nPressure=call MpReadMultiportPressure(); } if (nPressuremp_upper) { _UserInfo("Multiport sample pressure too HIGH to let into bellows...abandon sample",0,1); call MpSampleValve(g_sPortName,0); call EvacuateMP1(); bGas=FALSE; bOk = TRUE; } else { bGas=TRUE; } if (nPressure