#hpf control algorithm -- nmd #Revision history (ha ha) # 6 jul 96 (nmd) porting to tma2 State Standby{ > Telemetry start { if ( runHasBegun(HPFStat) ){ if ( maskVal(HPFStat,PLUME_BIT) ){ Validate Plume; } else if ( maskVal(HPFStat,ZERO_BIT) ){ Validate Zero; } else if ( maskVal(HPFStat,LASER_BIT) ){ Validate ProductRun; } else{ Validate Run; } } } } State Between_Runs{ { if ( runWasAborted(HPFStat) ) validate Standby; } 1:44 > Log Check for run in queue. 1:45 { if ( ! runPending() ) validate Standby; } 1:59 > Log Start the run 2:00 { Validate Run; } } State Run{ { if ( runHasEnded(HPFStat) ) Validate Between_Runs; } > Run Begin 0:05 > XS Reagent Select From File 0:30 > Laser Background 1:30 > Laser Online 2:00 > XS Reagent Auto Inject 5:00 > Laser Background 5:15 > Laser Online 8:00 > Laser Background 9:00 > Laser Online 10:00 > Run End { Validate Between_Runs; } } State Zero "zero.alg" { { if ( runHasEnded(HPFStat) ) Validate Standby; } } State Plume{ { if ( runHasEnded(HPFStat) ) Validate Standby; } "Log Type Run End to end the plume run"; } State LaserCheck{ { validate Chopping; } 1:00 { validate noChopping; } 1:01 > Laser Online 1:10 > Run End Validate Standby; } State ProductRun{ { if ( ! initScanInfo(&scanInfo) ) Validate Standby; } 0:01 Validate InitializeScanning; 0:05 Validate CheckProductCycle; } State CheckProductCycle{ { if ( runHasEnded(HPFStat) ) Validate Standby;} { if (scanInfo.scanNumber > scanInfo.maxScans ) Validate Standby; } 0:05 Validate ModulationStage0; } State ModulationStage0 "modulationStage0.alg" { {if ( runHasEnded(HPFStat) ) Validate Standby; } 0:01 Hold until valid (ScanningComplete); {if ( runHasEnded(HPFStat) ) Validate Standby; } } State ModulationStage1 "modulationStage1.alg" { {if ( runHasEnded(HPFStat) ) Validate Standby; } 0:01 Hold until valid (ScanningComplete); {if ( runHasEnded(HPFStat) ) Validate Standby; } } State ModulationStage2 "modulationStage2.alg" { {if ( runHasEnded(HPFStat) ) Validate Standby; } 0:01 Hold until valid (ScanningComplete); {if ( runHasEnded(HPFStat) ) Validate Standby; } } State ModulationStage3 "modulationStage3.alg" { {if ( runHasEnded(HPFStat) ) Validate Standby; } 0:01 Hold until valid (ScanningComplete); {if ( runHasEnded(HPFStat) ) Validate Standby; } } State ModulationStage4 "modulationStage4.alg" { {if ( runHasEnded(HPFStat) ) Validate Standby; } 0:01 Hold until valid (ScanningComplete); {if ( runHasEnded(HPFStat) ) Validate Standby; } } partition ############################################################ # # This defines the modulation cycles # ############################################################ State EnqueueFromScanInfo { {scanInfo.resolutionNumber++;} {if (scanInfo.resolutionNumber > scanInfo.numberOfResolutions ) Validate ScanningComplete;} {readScanInfo(&scanInfo); } +0:01 {enqueueFTIRScan(&scanInfo);} Validate ScanInProgress; } State ScanInProgress { depending on (1 Hz){ if ( ++delayCounter == scanInfo.pollingInterval ) { delayCounter = 0; if ( scanCompleted(&scanInfo) ){ Validate EnqueueFromScanInfo; } } } "Waiting for scan to end"; } State ScanningComplete { {scanInfo.scanNumber++; } {scanInfo.resolutionNumber=0;} } State InitializeScanning { {scanInfo.scanNumber = 0; } Validate scanningComplete; } partition ############################################################ # # This defines the chop mode for the laser # ############################################################ State noChopping{ } State Chopping{ > Laser Background +0:15 > Laser Online +0:15 {Validate Chopping;} }