Software
7.2 PEARL-Example Program to Generate Lissajous-Figures on an
Oscilloscope
MODULE DAC812;
SYSTEM;
/* für 'xx' jeweils VMEbus Adresse einsetzen */
dac0 : BU(xxE20000,02) ->; /* DA-Wandler Nr. 1 */
dac1 : BU(xxE20002,02) ->; /* DA-Wandler Nr. 2 */
dac2 : BU(xxE20004,02) ->; /* DA-Wandler Nr. 3 */
dac3 : BU(xxE20006,02) ->; /* DA-Wandler Nr. 4 */
dac4 : BU(xxE20008,02) ->; /* DA-Wandler Nr. 5 */
dac5 : BU(xxE2000A,02) ->; /* DA-Wandler Nr. 6 */
dac6 : BU(xxE2000C,02) ->; /* DA-Wandler Nr. 7 */
dac7 : BU(xxE2000E,02) ->; /* DA-Wandler Nr. 8 */
dacmode: BU(xxE20000,02) <- ; /* DAC-Revision, read only */
PROBLEM;
SPC (dac0,dac1,dac2,dac3,dac4,dac5,dac6,dac7)
DATION OUT BASIC;
SPC dacmode DATION IN BASIC;
SPC PI FLOAT GLOBAL;
...
lissajous: TASK;
/* Lissajous-Figuren mit DAC_0=x und DAC_1=y auf einem
Oszilloskope
! unipolar- oder bipolar-Mode beachten ! */;
DCL (a, r, b) FLOAT;
DCL (sinus, cosin) FIXED;
DCL speed FIXED INIT(5);
b=TOFIXED '0800'B4-0.5;
REPEAT;
r=PI/speed;
FOR i FROM -speed TO speed REPEAT;
sinus=ROUND((SIN(i*r)+1.0)*b);
cosin=ROUND((COS(i*r)+1.0)*b);
SEND sinus TO dac0;
SEND cosin TO dac1;
END;
END;
END; /* of Task "lissajous" */
...
MODEND;
Page 36 of 50
Manual • Doc. No.: V.1706.21 / Rev. 1.2
VME-DAC1612