Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio | Private | Search

 

Faux CL
Function
A library of faux CL (cathodoluminescence) functions to enable offline script development for CL-based scripts.
Version
version:20150901, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments
There is some script functionality available to users of Gatan's Cathodoluminescence systems. This library contains all the CL functions of which the author is aware. By installing the script as a Library, script development for CL sytems can be done offline, without tying up the SEM. The library functions herein have been tailored to return suitable responses from script calls. In the absence of this library, scripting offline will not work. You may need to edit the library functions, if you want a particular response from a function call. Obviously, this does not replace an actual CL system, but it will allow the script to be roughed out, before moving to the SEM to integrate it into the hardware.

 

System Requirements
This script should be compatible with all recent versions of DigitalMicrograph. These commands relate to a MonoCL 4 and GMS 2.3. Compatibility with other hardware/software is unknown.
Known Issues
-
Supported
Yes. If you are aware of additional CL scripting commands which are not included here, please forward them to the author.
Included Files
Main script.
Source Code

// A set of Faux CL functions. These can be installed as a Library

// or bundled into a package (with Package Creator), to add a set of

// Faux CL functions to an offline version of DigitalMicrograph. This

// enables offline CL script development to avoid wasting column time.

 

// Executing this script does nothing as there is no main script included

// to call any of these functions

 

// D. R. G. Mitchell, adminnospam@dmscripting.com (remove the nospam to make this work).

// version:150902, v1.0, Sept 2015, www.dmscripting.com

 

// If you know of other CL functions, please let the author know.

 

 

number clsetwavelength(number wavelength)

{

result("\nFaux CL - wavelength set to "+wavelength)

return 1

}

 

number clgetmaximumwavelength()

{

number maxwavelength=1200

return maxwavelength

}

 

 

number clgetwavelength()

{

number currentwavelength=350

return currentwavelength

}

 

number clgetdispersion()

{

number dispersion=1200

return dispersion

}

 

number clgetdispersionindex()

{

number dispersionindex=1

return dispersionindex

}

 

 

number clgetlambdamax()

{

number lambdamax=840.835

return lambdamax

}

 

number clgetht()

{

number ht=20

return ht

}

 

void clsetht(number ht)

{

Result("\nHT set to : "+ht)

}

 

void clsetgain(number gain)

{

Result("\nGain set to : "+gain)

}

 

number clgetgain()

{

number gain=51

return gain

}

 

void clsetoffset(number offst)

{

Result("\nOffset set to : "+offst)

}

 

number clgetoffset()

{

number offst=49

return offst

}

 

number clacquireserial(number dwelltime)

{

number serialvalue=6000+(gaussianrandom()*2000)

result("\nSerial value of "+serialvalue+" acquired in "+dwelltime+" s")

return serialvalue

}

 

number clacquireserial(number detectorinput, number detectormode, number locking, number dwelltime)

{

number serialvalue=6000+(gaussianrandom()*2000)

result("\nSerial value of "+serialvalue+" acquired in "+dwelltime+" s")

result("\nInput = "+detectorinput+" Mode = "+detectormode+" locking = "+locking)

return serialvalue

}

 

number clisinitialized()

{

result("\nCL is initialized")

return 1

}

 

number clismoving()

{

result("\nCL is moving")

return 1

}

 

void clsetspeedindex(number speedindex)

{

result("\nSpeed index set to "+speedindex)

}

 

void clstop()

{

result("\nCL has been stopped.")

}

 

number clgetopticaxischannel(void)

{

number optaxischan=640

return optaxischan

}

 

number clgetfocallength(void)

{

number focallength=300

return focallength

}

 

number clgetgratingorder(void)

{

number gratorder=1

return gratorder

}

 

number clatupperlimit(void)

{

result("\nCL is at upper limit.")

return 1

}

 

number clgetpmtmode(void)

{

number pmtmode=1

return pmtmode

}

 

void clsetserialmode(void)

{

result("\nSerial mode has been set.")

}

void clsetparallelmode(void)

{

result("\nParallel mode has been set.")

}

 

void clsetmonochromaticmode(void)

{

result("\nMonochromatic mode has been set.")

}

 

void clsetpanchromaticmode(void)

{

result("\nPanchromatic mode has been set.")

}

 

image clacquireparallel(number exposure, number nFrames, number SpectrumBinning, number VerticalBinning, Number top, number

left, number height, number width, number DarkSubtracted)

{

image parallelimg

 

if(width<1 || height<1)

{

result("\nWidth and/or Height parameters are incorrect.")

exit(0)

}

parallelimg=realimage("", 4, width, height)

parallelimg=sin(icol/90)

Parallelimg=(parallelimg+1)*10000

return parallelimg

}