Jascal-Programs

Jascal is a programming language for Jeol-Spectrometers. Here I have some useful little programs I wrote during my work at ISASline's spectrometer. If they can help you, just copy and paste the program text and save it (as it is explained in the commands section below). And be sure to delete previously existent programs, otherwise you might produce a mixture of both programs.
back to my physics page


STAGE.JCL (21.07.2005)
Version 1.0
Program to move goniometer motors
1.1 COMMENT clear all variables
1.2 ERASE

2.1 T !,"Sample Position (microns): X =",GP(1)," Y =",GP(2)," Z =",GP(3),!
2.2 T "Enter motor number (X=1,Y=2,Z=3, abort=0) "
2.3 T "and new position in microns",!
2.4 ASK "Motor ",MO,"Position in microns ",PO
2.5 IF (MO) 3.9,3.9,2.6
2.6 IF (MO-1) 2.7,3.1,2.7
2.7 IF (MO-2) 2.8,3.2,2.8
2.8 IF (MO-3) 2.9,3.3,2.9
2.9 T "Please enter 0, 1, 2 or 3",!; GO 2.1

3.1 LINK DSG(PO-GP(1),0,0); L WAIT(0); GO 2.1
3.2 LINK DSG(0,PO-GP(2),0); L WAIT(0); GO 2.1
3.3 LINK DSG(0,0,PO-GP(3)); L WAIT(0); GO 2.1
3.9 QUIT


XYMAP.JCL (18.08.2005)
Version 1.0
Program to do a mapping scan in the x-y-plane (z constant)
1.1 COMMENT clear all variables
1.2 ERASE

2.10 T "X-Y-Mapping procedure (Y=rows, X=columns)"
2.20 T !,"Sample Position (microns): X =",^I(GP(1))," Y
=",^I(GP(2))," Z =",^I(GP(3)),!
2.30 ASK "Y starting position in microns ",Y1
2.35 ASK "Y stopping position in microns ",Y2
2.40 ASK "Number of Y steps ",YS
2.45 SET YS=(Y2-Y1)/YS
2.50 ASK "X starting position in microns ",X1
2.55 ASK "X stopping position in microns ",X2
2.60 ASK "Number of X steps ",XS
2.65 SET XS=(X2-X1)/XS
2.70 ASK "Measuring time per point in sec ",TI

3.1 FOR NY=Y1,YS,Y2; T !; L DSG(0,NY-GP(2),0); L WAIT(0)
3.2 FOR NX=X1,XS,X2; DO 4
3.3 QUIT

4.1 L DSG(NX-GP(1),0,0); L WAIT(0); L MSR(TI*10); L WAIT(0)
4.2 T "X=",^I(GP(1))," Y=",^I(GP(2))," CH1=",^I(XR(1))," CH2=",^I(XR(2)),!


LINEX.JCL (18.08.2005)
Version 1.0
Linescan in X direction
1.1 COMMENT clear all variables
1.2 ERASE

2.10 T "X-Line Scan procedure"
2.20 T !,"Sample Position (microns): X =",^I(GP(1))," Y
=",^I(GP(2))," Z =",^I(GP(3)),!
2.30 ASK "Desired Y position in microns ",Y0
2.50 ASK "X starting position in microns ",X1
2.55 ASK "X stopping position in microns ",X2
2.60 ASK "Number of X steps ",XS
2.65 SET XS=(X2-X1)/XS; T "Stepsize=",XS,!
2.70 ASK "Measuring time per point in sec ",TI

3.10 L DSG(0,Y0-GP(2),0); L WAIT(0)
3.15 T "Y=",GP(2),!
3.20 FOR NX=X1,XS,X2; DO 4
3.30 QUIT

4.10 L DSG(NX-GP(1),0,0); L WAIT(0); L MSR(TI*10); L WAIT(0)
4.20 T "X=",^I(GP(1))," CH1=",^I(XR(1))," CH2=",^I(XR(2)),!


LINEY.JCL (18.08.2005)
Version 1.0
Linescan in Y direction
1.1 COMMENT clear all variables
1.2 ERASE

2.10 T "Y-Line Scan procedure"
2.20 T !,"Sample Position (microns): X =",^I(GP(1))," Y
=",^I(GP(2))," Z =",^I(GP(3)),!
2.30 ASK "Desired X position in microns ",X0
2.50 ASK "Y starting position in microns ",Y1
2.55 ASK "Y stopping position in microns ",Y2
2.60 ASK "Number of Y steps ",YS
2.65 SET YS=(Y2-Y1)/YS; T "Stepsize=",YS,!
2.70 ASK "Measuring time per point in sec ",TI

3.10 L DSG(X0-GP(1),0,0); L WAIT(0)
3.15 T "X=",GP(1),!
3.20 FOR NY=Y1,YS,Y2; DO 4
3.30 QUIT

4.10 L DSG(0,NY-GP(2),0); L WAIT(0); L MSR(TI*10); L WAIT(0)
4.20 T "Y=",^I(GP(2))," CH1=",^I(XR(1))," CH2=",^I(XR(2)),!



Useful Jascal commands
ERASE ALL - erase all existing programs from memory (should be done before starting a new program)
ERASE - erase all varibles
V SAVE TEST - save program (as TEST.JCL)
V GET TEST - load program TEST.JVL
GO - run loaded program
V RUN TEST - load and run program
V R MJOB - show all possible comands
FITR(X) - integer of X (with zeros after comma)
^I(X) - integer of X (without zeros after comma)
WRITE - show whole program text
MODIFY 2.1 - modify program line 2.1
/ - abort