Creating Algos - nthallen/keutsch-hcho GitHub Wiki

Purpose

It's possible for the user to create their own algos in order to perform routine tasks (such as calibrations) automatically. Additionally, maybe you want a gas cylinder to start flowing at a certain time in the morning so that the gas has passivated all surfaces by the time you start an experiment. Whatever the reason, Norton's programming language allows the user to combine commands with timing sequences in order to simplify instrument operation.

Files to Edit

The two source code files you will be editing are hcho.tma and hcho.sws. Talking with Norton Allen or Josh Shutter can help with making your life easier.

Example

Sometimes the best way of understanding how to create your own algos is by seeing an example of one that works. Below is an algo created to automatically perform stepped and zero calibrations.

In hcho.tma

Partition
# This partition controls calibration sequences

State Cal_Idle {}

State Cal_Zero_60min{
        > Valve 1 On
        > Flow Zero Set SCCM 2500
        > Flag Set 99
 +20:00	> Flag Set 1. # Comment: We're waiting 20 min to allow the zero air to flush out whatever is in the system
 +60:00 > Flow Zero Set SCCM 0
        > Flag Set 0
        > Valve 1 Off
        Validate Cal_Idle;
}

State Cal_Span_StepConc{ # Comment: This is an outdated stepped cal sequence. Nowadays, I usually set the zero flow to 4000 sccm and adjust the span flow accordingly.
        > Valve 1 On
        > Valve 2 On
        > Flow Zero Set SCCM 4000
        > Flag Set 99
 +20:00	> Flag Set 1
 +30:00	> Flow Span Set SCCM 100
        > Flag Set 99
+120:00	> Flag Set 2
+180:00	> Flow Zero Set SCCM 1500
        > Flag Set 3
+180:00	> Flow Zero Set SCCM 2250
        > Flag Set 4
+180:00 > Flow Span Set SCCM 0
        > Valve 2 Off
        > Flag Set 1
+180:00	> Flow Zero Set SCCM 0
        > Flag Set 0
        > Valve 1 Off
        Validate Cal_Idle;
}

In hcho.sws

SWS_CAL_IDLE          16  Cal Idle: Validate Cal_Idle; break;
SWS_CAL_ZERO_60MIN    17  Cal Zero 60min: Validate Cal_Zero_60min; break;
SWS_CAL_SPAN_STEPPED  20  Cal Span StepConc: Validate Cal_Span_StepConc; break;