Scripting Language and Scripting Engine Programming Guide Document Number 013-RD000-000-12- 201010 Offices: OcOcean Optics, Inc. 830 Douglas Ave., Dunedin, FL, USA 34698 Phone 727.733.2447 Fax 727.733.3962 8 a.m.– 8 p.m. (Mon-Thu), 8 a.m.– 6 p.m. (Fri) EST E-mail: Info@OceanOptics.com (General sales inquiries) Orders@OceanOptics.com (Questions about orders) TechSupport@OceanOptics.
Additional Offices: Ocean Optics Asia 666 Gubei Road, Kirin Tower, Suite 601B, Changning District, Shanghai, 200336 PRC Phone 86.21.6295.6600 Fax 86.21.6295.6708 E-Mail Sun.Ling@OceanOptics.com Ocean Optics EMEA (Europe, Middle East & Africa) Geograaf 24, 6921 EW DUIVEN, The Netherlands Phone 31-(0)26-3190500 Fax 31-(0)26-3190505 E-Mail Info@OceanOptics.eu Regional Headquarters Maybachstrasse 11 73760 Ostfildern Phone 49-711 34 16 96-0 Fax 49-711 34 16 96-85 E-Mail Sales@Mikropack.
Table of Contents About This Manual......................................................................................................... vii Document Purpose and Intended Audience.............................................................................. vii Document Summary.................................................................................................................. vii Product-Related Documentation .................................................................................
Table of Contents Chapter 6: Functions Reference.......................................................17 ACOS ............................................................................................................................ 17 Adapt............................................................................................................................. 17 Add................................................................................................................................
Table of Contents Scale ............................................................................................................................. 35 SetDisplayPrecision....................................................................................................... 36 SetIntegrationTime ........................................................................................................ 36 SetLampIntensity.........................................................................................
Table of Contents vi 013-RD000-000-12- 201010
About This Manual Document Purpose and Intended Audience This document provides you with instructions to install and use the Jaz Scripting Engine. Document Summary Chapter Description Chapter 1: Introduction Provides an overview of the Jaz Scripting Language (JSL) software. Chapter 2: Jaz Scripting Engine Describes the structure of JSL. Architecture Chapter 3: Installation Provides installation instructions for JSL on a Windows or Linux operating system.
About This Manual viii 013-RD000-000-12- 201010
Chapter 1 Introduction Overview Jaz is a community of smart sensing instruments that consists of a high-performance miniature spectrometer that accommodates USB and Ethernet connectivity (for PC-free performance), battery operation, multi-spectrometer channel capability, and a selection of light sources.
1: Introduction Operating System Support Microsoft Windows – Windows 7, 2000, XP; 32-bit and 64-bit Linux – Red Hat 9 or later, Fedora (any version), Debian 3.1 or later (Sarge), SUSE (9.
Chapter 2 Jaz Scripting Engine Architecture Overview The Jaz Scripting engine comprises the linguistic analyzer for the language as well as the runtime driver for script execution. The engine is invoked in the standard UNIX command line format with command flags and arguments which determine modes of actions and the source of input. Jaz Scripts A script is an ASCII text file which can be composed by whatever means a user wishes to employ.
2: Jaz Scripting Engine Architecture All variables are global in scope. That means that all variables to be used in the entire script must be declared in the Variable Declaration section. All variables are visible from both the main program and from user-defined procedures. A variable is declared as Where: type = one of the data types in the following Data Types table optional count = the way an array is declared. See the example below.
2: Jaz Scripting Engine Architecture TEXT Literals A literal of type text may need to have carriage returns inserted within them to make screen text readable. For example, to have the string Test1Test2Test3 show up on separate lines, insert the '$' character wherever a new line is desired. Internally, the scripting engine inserts the carriage returns as in Test1$Test2$Test3.
2: Jaz Scripting Engine Architecture Symbol Name Type > Greater than Boolean < Less than Boolean := Assignment Arithmetic Main Program The Main Program section typically defines the main logic flow of the script. The Main Program begins with the keyword START and is terminated with the keyword END. The keyword STOP marks the end of the script and is logically paired with the keyword SCRIPT. Labels can be placed before a statement to make that statement a destination for a GoTo statement.
2: Jaz Scripting Engine Architecture The DO ... DONE construct is a special iteration construct. It behaves exactly like a FOR loop, but with one special caveat: a DO ... DONE loop cannot have GOTO statements in it. CALL statements are allowed in a DO … DONE loop. Built-In Variables The intent of built-in variables is to make system-wide setting values available to the developer. For example, INTEGRATION_TIME_SECONDS establishes an integration time of 1 second by default.
2: Jaz Scripting Engine Architecture Variable Type Constant ELECTRIC_DARK INT_16 0 STRAY_LIGHT INT_16 0 DISPLAY_BRIGHTNESS INT_16 0 DISPLAY_WIDTH INT_16 8 DISPLAY_PRECISION INT_16 3 INTEGRATION_TIME_SECONDS INT_32 1 INTEGRATION_TIME_NANOSEC INT_32 0 STROBE_DELAY_USEC INT_16 0 LAMP_CONTROL INT_16 0 SPECTROMETER_CHANNEL_NUMBER INT_16 0 PROCESSING_FLAG INT_16 STROBE_ENABLE INT_16 SPECTROMETER TEXT YES "SPECTROMETER" LAMP TEXT YES "LAMP" BULB1 INT_16 YES 1 BULB2
Chapter 3 Installation Overview The JSL can be run under Jaz, Linux or Windows and installed from either the JSL CD or from the Ocean Optics Software Downloads page. See Operating System Support to determine if your computer operating system is supported by JSL. Retrieving from a CD Your JSL software is shipped to you from Ocean Optics on a CD. You will need the password located on the jacket of the CD containing your JSL software to complete the installation. ► Procedure 1.
3: Installation Downloading from the Ocean Optics Website Installing on a Windows Platform Total download is approximately 3.4 MB. ► Procedure 1. Close all other applications running on the computer. 2. Start Internet Explorer. 2. Browse to the Software Downloads page on the Ocean Optics website at http://www.oceanoptics.com/technical/softwaredownloads.asp. 3. Click on the JSL software for your Windows operating system. 4. Save the software to the desired location.
Chapter 4 Windows Scriptor Launcher Introduction Scriptor Launcher provides a graphical interface for Ocean Optics’ Jaz Scripting Language Engine (JSL) when used with Windows. The scripting engine is the program that parses and executes user scripts for Jaz. By using the launcher, you need not interact with the system at a command line level.
4: Windows Scriptor Launcher Running the Application Scriptor Launcher Main Window Double-click the launcher icon to display the application window. The fields are populated with the settings last used so that you need only change the parameters necessary for the current operation.
Script Options Option Meaning Verbose Corresponds to the -v option and provides the most detailed output Compile Only Corresponds to the -c option and compiles but does not run the script Trace Execution Corresponds to the -t option and provides a full script engine output Capture Output Captures script engine output in the file you specify as the capture file and will open the capture file in WordPad.exe when script execution terminates.
4: Windows Scriptor Launcher 14 013-RD000-000-12- 201010
Chapter 5 Using the Jaz Scripting Engine Overview The scripting engine is a program named Scriptor. Scriptor contains all the functionality needed to communicate with a Jaz unit and execute user scripts. Scriptor has several arguments that may be passed to it on the command line to modify its behavior. The scripting engine has two script file input modes: In one mode, the names of the script(s) are provided on the command line.
5: Using the Jaz Scripting Engine Flag Arguments Meaning -p IP Port number of Jaz unit Specifies the IP port the Jaz unit is listening on. If not provided, engine uses the default. Default: 6626 -f directory name If the engine is to fetch scripts from a directory then this flag specifies the directory to fetch from. Tethered Mode In this mode, the engine runs on a PC and is connected to a Jaz unit via ethernet. All functionality is available on the Jaz.
Chapter 6 Functions Reference ACOS Syntax: ACos(A,B) Arguments Name Type A INT_16 or REAL variable or literal B REAL variable Special Considerations B = arccos(A) Adapt Syntax: Adapt(Channel) Arguments Name Channel Type Integer Special Considerations Desired spectrometer channel The algorithm begins with the built-in variables INTEGRATION_TIME_SECONDS and INTEGRATION_TIME_NANOSEC as the integration time.
6: Functions Reference Arguments Name Type A Spectral B Spectral C Spectral Special Considerations A + B Pixel Values Intent: Add the pixel values of spectra A and B and store in C ASIN Syntax: ASin(A,B) Arguments Name Type A INT_16 or REAL variable or literal B REAL variable Special Considerations B = arcsin(A) AssignLampType Syntax: AssignLampType(LAMP_CONSTANT,X) Arguments Name Type Special Considerations LAMP_CONSTANT INT_16 Built-in like UV_VIS X Integer variable Intent: If
6: Functions Reference Call -- UserFunctionInvocation Syntax: Call MyProcedure Arguments Name Type Special Considerations MyProcedure User-defined procedure A subroutine call Intent: To invoke user-defined code as a unit of execution.
6: Functions Reference Name Type Special Considerations IN Operator for membership OUTSIDE Operator for non-membership [a,b] Numeric range (real or integer) A
6: Functions Reference Comp Syntax: Comp(A,B,C) Arguments Name Type A Spectral B Spectral C Real variable Special Considerations C = Sum(Ai - Bi) Intent: Compute the sum of the pixel value differences of A and B and store in C. Compabs Syntax: CompAbs(A,B,C) Arguments Name Type A Spectral B Spectral C Real variable Special Considerations C = Sum( Abs(Ai - Bi) ) Intent: Compute the sum of the absolute values of the pixel values of A and B and store in C.
6: Functions Reference Arguments Name Type A INT_16 or REAL variable or literal B REAL variable Special Considerations B = cos(A) Display Syntax: Display(Legend,Value,Units) Arguments Name Type Legend TEXT Value REAL Units TEXT Special Considerations Intent: Display output value message on Jaz OLED display. Displaymsg Syntax: DisplayMsg(Message) Arguments Name Type Message TEXT Special Considerations Intent: Show the message on the Jaz OLED display.
6: Functions Reference Do … Done Syntax: Do V SV,EV,SS Done Example: Do I 1,10,1 Sum := Sum + I Done This is the basic loop iteration structure where the loop body is delimited by the keywords DO and DONE.
6: Functions Reference Arguments Name Type A INT_16 or REAL variable or literal B REAL variable Special Considerations B = e to the power of A GetIntegrationTime Syntax: GetIntegrationTime(R) Arguments Name Type R REAL variable Special Considerations Value of INTEGRATION_TIME_SECONDS + INTEGRATION_TIME_NANOSECS Intent: Get current value of Integration Time variables.
6: Functions Reference Intent: Fetch current value of light source bulb intensity setting. GetLampShutter Syntax: GetLampShutter(L,V) Arguments Name Type Special Considerations L Integer variable or literal Lamp unit’s number V Integer variable Intent: Get the current light source shutter setting.
6: Functions Reference Arguments Name Type Special Considerations Label A labeled statement in the script Labels are local to main or a userdefined procedure If Syntax: If(conditional expression) GOTO Label If(conditional expression) Procedure Name If(conditional expression) HALT Arguments Name Type Special Considerations Conditional expression Boolean expression Example (A <> B) Label User defined Label Procedure Name Name of a user-defined procedure HALT Termination of script Call user
6: Functions Reference Arguments Name Type Special Considerations Label Name Tagged instruction in the script defined by the user Target for Goto expressions LocateWavelength Syntax: LocateWavelength (A, B, C) Arguments Name Type A Spectral B INT_16 or REAL variable or literal C INT_16 literal Special Considerations Intent: Finds location in spectrum of B wavelength.
6: Functions Reference Intent: Compute the element-wise logarithm base 10 of A and store in elements of B. If an element of A is ≤0 , then the value stored in INF (infinity) and is not computationally useful. Log10 Syntax: Log10(A,B) Arguments Name Type Special Considerations A INT_16 or REAL variable or literal Greater than 0 B Real B = Log10(A) Intent: Compute the base 10 log of the scalar variable, A. Do not confuse this with LOG(), which operates only on spectral data.
6: Functions Reference Arguments Name Type A Spectral B Spectral C Spectral Special Considerations Ci = Ai * Bi Intent: Compute the DOT-PRODUCT of A,B and store in C. Norm Syntax: Norm(A,B) Arguments Name Type A Spectral B Spectral Special Considerations Bi = Ai/Max(Ai) Intent: Normalize the pixel values of A by dividing through by the maximum pixel value in A and store the ratio in B. If Max(A) is zero then the result is INF and is not computationally useful.
6: Functions Reference Arguments Name Type Special Considerations ButtonSelection INT_16 Variable holding user's selection and -1 if timed out or some other selection activity was done. If TimeToWait is zero and a button press occurred the keycode value +1000 will be returned as the ButtonSelection. TimeToWait INT_16 The number of seconds the script should wait for user input.
6: Functions Reference Arguments Name Type Special Considerations Label A labeled statement in the script Labels are local to main or a userdefined procedure Procedure The name of a user-defined procedure HALT Terminate the script Intent: The engine maintains a global error indicator that is set whenever a consistency error is detected and referenced by this function to determine whether to take the action specified.
6: Functions Reference Name Type Special Considerations Sequence INT_16 variable or literal Use if this parameter is not mandatory. If used and F was declared with name myfile.txt, then the actual file name becomes myfile.txt.nnn where : nnn is a three digit numerical field derived from this argument. User is responsible for setting, incrementing and contents of this parameter. Intent: Registers file variable with operating system controlled file.
6: Functions Reference Arguments Name Type A INT_16 or REAL variable or literal B INT_16 or REAL variable or literal C REAL Special Considerations C = A to the power of B Prompt Syntax: Prompt(Message) Arguments Name Type Message TEXT Special Considerations Intent: Display a prompt message on the Jaz OLED display (usually to prompt the user to perform an action).
6: Functions Reference ReadRealVector Syntax: ReadRealVector(F,V,Length) Arguments Name Type F FILE V Real Array variable Length Integer variable or literal Special Considerations Number of elements to read Intent: Read in a vector of real values from a user-supplied file. Useful in creating tables, references, lists, etc.
6: Functions Reference Intent: To read in a 2-dimensional array of real numbers from a file. The array columns represent reference spectra for use in pattern matching with a sample spectrum. The number of rows will typically be 2048, which is the default length of a spectrum.
6: Functions Reference SetDisplayPrecision Syntax: SetDisplayPrecision(W,P) Arguments Name Type Special Considerations W INT_16 W is width of numeric field P INT_16 P is number of digits precision Intent: To set the display precision of real numbers. SetIntegrationTime Syntax: SetIntegrationTime(R) Arguments Name Type R REAL variable or literal Special Considerations Set value of INTEGRATION_TIME_SECONDS + INTEGRATION_TIME_NANOSECS Intent: Set value of Integration Time variables.
6: Functions Reference Arguments Name Type Special Considerations L Integer variable or literal Lamp unit’s number M BULB1, BULB2, ALLBULBS Target bulb of the source to effect V Integer variable or literal Setting (must be in range) Intent: Change the intensity of bulb in the light source by a given amount.
6: Functions Reference ShowMenu Syntax: ShowMenu(s1{,s2,s3,s4}) Where: s = a string or a text variable. s2 through s4 are optional and may be omitted for a 1 line menu. Each string constitutes a line on the display and is associated automatically with the navigation buttons on the Jaz unit. Arguments Name Type Special Considerations s1 TEXT Mandatory field s2 ... s4 TEXT Optional arguments Intent: To display user input prompts on the Jaz screen.
6: Functions Reference Arguments Name Type A Spectral B Spectral C Spectral Special Considerations A -B Pixel values Intent: Subtract the pixel values of spectra A and B and store in C.
6: Functions Reference Arguments Name Type A Spectral V Integer value or variable B Real Special Considerations Wavelength of pixel at location V Intent: To get the wavelength corresponding to a pixel location. WriteFile Syntax: WriteFile(F,X) WriteFile(F,A,M,N) Arguments Name Type Special Considerations F FILE X Variable A Spectral M Low index Literal or variable N High Index Literal or variable Any type supported Intent: Send data to user-defined file.
6: Functions Reference WriteSpectrum Syntax: WriteSpectrum(F,A) Arguments Name Type Special Considerations F FILE Type determines the format of the output (wavelength,pixel value) A Spectral Intent: Write spectral data to user-defined file.
6: Functions Reference 42 013-RD000-000-12- 201010
Appendix A Example Scripts Bare Script Template SCRIPT Testing1 VERSION 1.0.
A: Example Scripts A script must have a name and a 3-digit version number. As the product evolves, new script engines will be produced, so it is important that a script targeted for a later version is not sent to an earlier version engine. The intention is that all script engines be backward compatible with version 1.0.0. The script writer adjusts this version tag to guarantee a match between script engines and the script. SCRIPT Simple_test_of_scriptor Version 0.0.
A: Example Scripts // // Set the integration time // Display("Setting$Integration$time to$",integrationtime,"secs") pause(2) SetIntegrationTime(integrationtime) // // set a label so that we can return to this location.
A: Example Scripts //////////////////////////////////////////////////////// // // //////////////////////////////////////////////////////// [PROCESS MYGETSPECTRUM] MySendPacket[10] := -1956.0 RealDumb[19] := MySendPacket[10] myname := "SPECTRUM" LampIndex := 6 GetLampShutter(LampIndex,LampShutter) SetLampShutter(LampIndex, 20) END STOP pH Measurement Script SCRIPT pH_Module_Pittcon Version 0.3.1 Variables MaxFile FILE "MaxFile.txt" csv DarkFile FILE "DarkFile.txt" csv LowFile FILE "LowFile.
A: Example Scripts FiveSpectrumDark SPECTRAL SixSpectrumDark SPECTRAL SevenSpectrumDark SPECTRAL EightSpectrumDark SPECTRAL pH REAL LowPeak REAL LowIntensityPeak INT_16 LowIntensityBase INT_16 SampleIntensityPeak INT_16 SampleIntensityBase INT_16 SamplePeakRatio REAL SampleBaseRatio REAL SamplePeakAbsorbance REAL SampleBaseAbsorbance REAL SampleAbsorbance REAL MaxIntensityPeak INT_16 MaxIntensityBase INT_16 MaxPeakRatio REAL MaxBaseRatio REAL MaxPeakAbsorbance REAL MaxBaseAbsorbance REAL MaxAbsorbance REAL
A: Example Scripts SixBaseRatio REAL SixPeakAbsorbance REAL SixBaseAbsorbance REAL SixAbsorbance REAL SevenIntensityPeak INT_16 SevenIntensityBase INT_16 SevenPeakRatio REAL SevenBaseRatio REAL SevenPeakAbsorbance REAL SevenBaseAbsorbance REAL SevenAbsorbance REAL EightIntensityPeak INT_16 EightIntensityBase INT_16 EightPeakRatio REAL EightBaseRatio REAL EightPeakAbsorbance REAL EightBaseAbsorbance REAL EightAbsorbance REAL LogArgument REAL LogTerm REAL LogArgumentFive REAL LogTermFive REAL LogArgumentSix
A: Example Scripts Slope1 REAL Slope2 REAL Slope3 REAL Slope4 REAL Slope5 REAL Slope6 REAL SlopeSum REAL imax1 INT_16 MaxIntensityPeak1 INT_16 LowIntensityPeak1 INT_16 MaxPeakRatio1 REAL MaxPeakAbsorbance1 REAL QuickIntensityPeak1 INT_16 QuickPeakRatio1 REAL QuickPeakAbsorbance1 REAL QuickAbsorbance1 REAL FiveIntensityPeak1 INT_16 FivePeakRatio1 REAL FivePeakAbsorbance1 REAL FiveAbsorbance1 REAL SixIntensityPeak1 INT_16 SixPeakRatio1 REAL SixPeakAbsorbance1 REAL SixAbsorbance1 REAL SevenIntensityPeak1 INT_
A: Example Scripts LightPeak INT_16 MaxPeak INT_16 QuickPeak INT_16 FivePeak INT_16 SixPeak INT_16 SevenPeak INT_16 EightPeak INT_16 SamplePeak INT_16 END CONSTANTS TimeOutSeconds = 60 MaxPasses = 100 END START PassCount := 0 SetDisplayPrecision(6,2) // Set Integration Time, Averaging, BoxCar, and default pK and Slope SPECTROMETER_CHANNEL_NUMBER := 0 INTEGRATION_TIME_SECONDS := 0 INTEGRATION_TIME_NANOSEC := 3000 AVERAGES := 15 BOX_CAR := 15 pK := 6.0 Slope := 1.
A: Example Scripts Light1 := 4000 LABEL LightLoop SetLampIntensity(0,ALLBULBS,Light1) GetSpectrum(0,LightSpectrum) LocateWavelength(LightSpectrum,566,LightPeak) IF(LightSpectrum[LightPeak] > 32000) GOTO Again GOTO EndLight LABEL Again Light1 := Light1 - 100 SetLampIntensity(0,ALLBULBS,Light1) GOTO LightLoop LABEL EndLight DisplayMsg("Light adjustment$complete") Pause(2) Display("Max Int = ",LightSpectrum[LightPeak],"") Pause(2) // Main User Interface Label Top CALL MainMenu If(UserChoice = 0) GOTO Standard
A: Example Scripts Call Refresh GOTO TOP LABEL QUIT DisplayMsg("Ending$Session") Pause(2) END //Menu to standardize [Process GetStandards] LABEL TOP ShowMenu("Take Dark Ref","Take Low pH Ref","Take Max pH Ref","Back") OnButtonClick(UserSelection,TimeOutSeconds) If(UserSelection = 0) GOTO Dark If(UserSelection = 1) GOTO Low If(UserSelection = 2) GOTO Max If(UserSelection = 3) GOTO EXIT LABEL Dark Call GetTheDarkRef GOTO TOP LABEL Low Call GetTheLowRef GOTO TOP LABEL Max Call GetTheMaxRef GOTO TOP LABEL EX
A: Example Scripts LABEL TOP ShowMenu("Standardize","View pH","Refresh pK","Exit") OnButtonClick(UserSelection,TimeOutSeconds) If(UserSelection <> 0) GOTO Check1 UserChoice := 0 GOTO EXIT LABEL Check1 If(UserSelection <> 1) GOTO Check2 UserChoice := 1 GOTO EXIT LABEL Check2 If(UserSelection <> 2) GOTO Check3 UserChoice := 2 GOTO EXIT LABEL Check3 If(UserSelection <> 3) GOTO Bummer UserChoice := 3 GOTO EXIT LABEL bummer PassCount := PassCount + 1 If(PassCount > MaxPasses) GOTO QUIT DisplayMsg("Please select
A: Example Scripts Pause(1) GetSpectrum(0,DarkSpectrum) DisplayMsg("Taking Dark$Reference") Pause(2) SetLampShutter(0,1) SetLampIntensity(0,ALLBULBS,Light1) END [PROCESS GetTheLowRef] // Prompts user to insert buffer sample, takes low reference DisplayMsg("pH = 1 Buffer$Should Be$Present") Pause(3) GetSpectrum(0,LowpHSpectrum) Sub(LowpHSpectrum, DarkSpectrum, LowpHSpectrumDark) Pause(3) END [PROCESS GetTheMaxRef] /// Prompts user to insert buffer sample, takes max reference DisplayMsg("pH = 11 Buffer$Shoul
A: Example Scripts OpenFile(LowFile, ForWrite) WriteSpectrum(LowFile,LowpHSpectrumDark) CloseFile(LowFile) LocateWavelength(MaxpHSpectrumDark, 750, MaxIntensityBase) LocateWavelength(LowpHSpectrumDark, 750, LowIntensityBase) MaxBaseRatio := MaxpHSpectrumDark[MaxIntensityBase] / LowpHSpectrumDark[LowIntensityBase] LOG10(MaxBaseRatio, MaxBaseAbsorbance) MaxBaseAbsorbance := -(MaxBaseAbsorbance) LocateWavelength(MaxpHSpectrumDark, 618, MaxIntensityPeak1) LocateWavelength(LowpHSpectrumDark, 618, LowIntensityPe
A: Example Scripts GOTO EXIT LABEL Manual //Not yet a feature in Scriptor DisplayMsg("Not yet a$usable feature") Pause(2) GOTO TOP //Quick single buffer calibration LABEL Quick DisplayMsg("Make sure Dark,$Low, and Max Refs$have been taken") Pause(3) DisplayMsg("pH = 7 Buffer$Should Be$Present") Pause(2) GetSpectrum(SPECTROMETER_CHANNEL_NUMBER, QuickSpectrum) Sub(QuickSpectrum, DarkSpectrum, QuickSpectrumDark) iMax1 := 596 LocateWavelength(QuickSpectrumDark, 750, QuickIntensityBase) LocateWavelength(LowpHSp
A: Example Scripts QuickAbsorbance1 := QuickPeakAbsorbance1 - QuickBaseAbsorbance if(QuickAbsorbance1 >= QuickAbsorbance) GOTO AssignQuick If(iMax1 < 645) GOTO Loop2 GOTO Calculate2 LABEL AssignQuick QuickAbsorbance := QuickAbsorbance1 QuickPeak := QuickIntensityPeak1 GOTO Loop2 LABEL Calculate2 LogArgumentRefresh := QuickAbsorbance/(MaxAbsorbance - QuickAbsorbance) if(LogArgumentRefresh> 0.0) GOTO OK6 GOTO ABORT Label OK6 LOG10(LogArgumentRefresh, LogTermRefresh) pK := -(1.9287 * LogTermRefresh) + 7.
A: Example Scripts DisplayMsg("Make sure Dark,$Low, and Max Refs$have been taken") Pause(3) DisplayMsg("You will need$pH 6 and 8$buffers") Pause(3) LABEL FullMenu ShowMenu("pH = 6","pH = 8") OnButtonClick(UserSelection,TimeOutSeconds) If(UserSelection = 0) GOTO Six If(UserSelection = 1) GOTO Eight LABEL Six DisplayMsg("pH = 6 Buffer$Should Be$Present") Pause(2) GetSpectrum(SPECTROMETER_CHANNEL_NUMBER, SixSpectrum) Sub(SixSpectrum, DarkSpectrum, SixSpectrumDark) LocateWavelength(SixSpectrumDark, 750, SixInt
A: Example Scripts GOTO FullMenu LABEL Eight DisplayMsg("pH = 8 Buffer$Should Be$Present") Pause(2) GetSpectrum(SPECTROMETER_CHANNEL_NUMBER, EightSpectrum) Sub(EightSpectrum, DarkSpectrum, EightSpectrumDark) LocateWavelength(EightSpectrumDark, 750, EightIntensityBase) LocateWavelength(LowpHSpectrumDark, 750, LowIntensityBase) EightBaseRatio := EightSpectrumDark[EightIntensityBase] / LowpHSpectrumDark[LowIntensityBase] LOG10(EightBaseRatio, EightBaseAbsorbance) EightBaseAbsorbance := -(EightBaseAbsorbance)
A: Example Scripts Display("pK = ",pK,"") Pause(2) Display("Slope = ",Slope,"") Pause(2) GOTO Top LABEL EXIT END [PROCESS ViewpH] // View pH Interface Label TOP ShowMenu("Measure Sample","Save pH","Back") OnButtonClick(UserSelection,TimeOutSeconds) If(UserSelection = 0) GOTO CALCULATE_IT If(UserSelection = 1) GOTO Save_pH If(UserSelection = 2) CALL MainMenu GOTO EXIT LABEL CALCULATE_IT CALL CalculatepH GOTO TOP LABEL Save_pH OpenFile(pH_Save,ForWrite) SaveReading(pH_Save,"pH = ",pH,"") CloseFile(pH_Save) D
A: Example Scripts [PROCESS CalculatepH] //Gets sample spectrum, calculates and displays pH, returns to previous screen GetSpectrum(SPECTROMETER_CHANNEL_NUMBER, SamplepHSpectrum) Sub(SamplepHSpectrum, DarkSpectrum, SamplepHSpectrumDark) LocateWavelength(SamplepHSpectrumDark, 750, SampleIntensityBase) LocateWavelength(LowpHSpectrumDark, 750, LowIntensityBase) SampleBaseRatio := SamplepHSpectrumDark[SampleIntensityBase] / LowpHSpectrumDark[LowIntensityBase] LOG10(SampleBaseRatio, SampleBaseAbsorbance) Sample
A: Example Scripts 62 013-RD000-000-12- 201010
Index A ACOS, 17 Adapt, 17 Add, 17 architecture, 3 arithmetic, 5 ASIN, 18 AssignLampType, 18 B built-in variables, 7 C Call MyProcedure, 19 Check, 19 CloseFile, 20 Comment, 20 Comp, 21 CompAbs, 21 constants, 3 COS, 21 cross-platform, 1 D data types, 4 Display, 22 Displaymsg, 22 Do…Done, 23 document audience, vii purpose, vii summary, vii documentation, vii DuplicateSpectrum, 23 E 013-RD000-000-12- 201010 example scripts, 43 EXP, 23 F flow control, 6 functions, 17 ACOS, 17 Adapt, 17 Add, 17 ASIN, 18 As
A: Example Scripts POW, 32 Prompt, 33 Ratio, 33 ReadRealVector, 34 ReadTable, 34 Savereading, 35 Scale, 35 SetDisplayPrecision, 36 SetIntegrationTime, 36 SetLampIntensity, 36 SetLampShutter, 37 ShowGraph, 37 ShowMenu, 38 SIN, 38 Sub, 38 Trim, 39 WaveLength, 39 WriteFile, 40 WriteSpectrum, 41 M main program, 6 Mult, 28 N Norm, 29, 38 O OnButtonClick, 29 OnError, 30 OnErrorGoto, 30 OpenFile, 31 operating systems supported, 2 operators, 5 P G Pause, 32 pH measurement example script, 46 POW, 32 Prompt, 3
Index template, 43 TEXT literals, 5 user-defined procedures, 6 variable declaration, 3 scripting engine arguments, 15 Jaz mode, 16 Tethered mode, 16 using, 15 scriptor, 15 scriptor launcher, 11 configuration, 11 main window, 12 prerequisites, 11 running application, 12 scriptor launcher window run section, 13 script options, 13 script settings, 13 tethered Jaz network settings, 13 SD card, 10 SetDisplayPrecision, 36 SetIntegrationTime, 36 SetLampIntensity, 36 SetLampShutter, 37 ShowGraph, 37 SIN, 38 Sub, 3
A: Example Scripts 66 013-RD000-000-12- 201010