The scripting language in Fastmatics is one of the the most powerful aspects of the program. It enables programmatic evaluation of system conditions and enables the altering of program flow based on the evaluation. The Scripting environment is compiled but the evaluations are based real time, error checked, and input-reading-verified data at run time.
Signal settings in scripts are entirely safe from presenting interlocked conditions to the system. Any script based settings that violate the interlocks are trapped before the illegal condition makes it to the equipment and an error event is triggered. Your programming can be done without the encumbrance of this error checking.
Each script is named by the user and compiled. Your system can contain as many scripts as you want and up to twenty scripts may run simultaneously in a true multitasking environment. Practically speaking a few scripts running at the same time handles the typical most complex situations.
The Scripting language in Fastmatics has a wealth of features including error reporting, handling, and numerous intrinsic functions. There are OnError, OnInterrupt convenience functions. In addition when a script calls or spawns one or more other scripts, the parent or child can kill the entire thread's (parents and children) scripts using an OnErrorKillThread function. This is great for automatic recovery of undesirable situations. The KillThread functions do not interrupt other scripts that are not related to the present thread so the rest of the processing can proceed without interruption.
Examples:
----------------------------------------------------------------------
if ( HighVacValveOpenReading == 1.0 ){
IonGaugeSetting = 1.0;
Broadcast ( "Ion Gauge now on" );
} else {
}
----------------------------------------------------------------------
if ( RoughPumpOnSetting == 0.0 ){
RoughPumpOnSetting = 1.0;
Broadcast ( "Rough Pump on - Pump down sequence begin" );
WaitFor ( 90, ConvectronReading < 0.15 ) {
Broadcast ( "A few more lines of code and your
pump down script is complete!" );
} else {
RoughPumpOnSetting = 0.0;
Error ( 2057, 2, "System won't pump", "" );
}
} else {}
----------------------------------------------------------------------
if ( arg0 == 1.0 ){ // arguments passed to a routine are arg0 to 39
Broadcast ( "Debug 2: arg0 = 1" );
} else {}
----------------------------------------------------------------------
In addition to many standard constructs, Fastmatics has several productivity enhanced functions that are unique to process control requirement:
Examples of the WaitForTolerance Construct:
----------------------------------------------------------------------
WaitForTolerance ( 1200.0 ; HeaterSetpoint, HeaterReading, 0.5 ) {
Broadcast ( "Set point temperature reached. Process continues." );
MFCValvesOpen = 1.0;
} else {
Spawn Halt ();
Broadcast ( "Set point temperature NOT reached. Process halted." );
}
----------------------------------------------------------------------
WaitForTolerance ( 90.0, Axis1.ReadPosition, MotorHomeDatum, 0.05 ){
Broadcast ( "Motor Home complete" );
} else {
Error ( 2056, 2, "Motor not within 0.05 in. of home after 90 sec." );
}
The above waits for the HeaterReading or Axis1.ReadPosition to reach the value of the other signal's value within the tolerance specified. If the condition is not reached within the specified amount of time a corrective action is taken.
This and other constructs within the program boost productivity.
When developing a script, the intrinsic commands can be accessed by right clicking in the editor pane. A code example can be automatically inserted directly into your script and a usage windows then optionally pops up. This makes the scripting process very time efficient during installation. In addition, if you can store notes within the code examples for future use.