29.06.2015 Views

AvaRaman Operating manual AvaSoft Raman 7.3 November 2008

AvaRaman Operating manual AvaSoft Raman 7.3 November 2008

AvaRaman Operating manual AvaSoft Raman 7.3 November 2008

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

You can refer to the other history channels with the predefined variables F1 to F8. If you want to<br />

use data from the spectrometer, you will need to assign other history channels to e.g. wavelength<br />

values or integrals. The following script defines the function value for F3 as the quotient of F1 and<br />

F2.<br />

Function F3(value)<br />

F3=F1/F2<br />

End Function<br />

Please do not refer to the function value for the script itself. You can also not refer to other<br />

functions, if these are themselves assigned to a script. This will result in a scripting run-time error.<br />

If you want to use code from another script, please copy the necessary lines from that script into<br />

the one your working with.<br />

Please understand that a script is executed by an interpreter, on a line by line basis. If you make a<br />

syntax error in your script, it will usually only show at the moment the line with the error is<br />

executed, as a run-time error.<br />

Nothing will stop you, for instance, from entering the following script for function 3:<br />

Function F3(value)<br />

F3=F1/0<br />

End Function<br />

Running this script will result in<br />

the run-time error at the right:<br />

If you refer to channels that are undefined (Function Type ‘None’), they will be handled as<br />

uninitialized variables by VBScript, with value 0. This is the case for all uninitialized variables you<br />

might use in your scripts.<br />

Finally, a small example to monitor the integral of a peak between 522 cm -1 and 550 cm -1 , in which<br />

an offset is subtracted. The offset area is the area below of the straight line between the output at<br />

522 cm -1 and the output at 550 cm -1 .<br />

F1 is defined as a user defined input function: m(522)<br />

F2 is defined as a user defined input function: m(550)<br />

F3 is defined as the zero-based integral between 522 cm -1 and 550 cm -1 .<br />

The script for function F4 can then be written as:<br />

Function F4(value)<br />

If F1 > F2 Then<br />

offset = 28*(F2 + (0.5*(F1-F2)))<br />

Else<br />

offset = 28*(F1 + (0.5*(F2-F1)))<br />

End If<br />

F4 = F3 - offset<br />

End Function<br />

48 AvaRAMAN <strong>manual</strong>.doc Nov-08<br />

Avantes www.avantes.com info@avantes.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!