E. DONG, G. C. M. WIEDERHOLD 
1101 
17.990 y = 100 *(outbuf (l)-min2)/rat2+xoffs; 
17.991 y = limit ( y,600,xoff ) ; 
17.993 call plot(plotout,x,y,pendraw) ; end; 
17.995 call plot(plotout,0,0,penfin) ; 
18.000 end drawnew; 
i 18.500 
19.000 test: procedure; /* test stimuli, called from terminal */ 
19.500 pulse = 0; pulsel = 0; /* 500 pulses at 2 millisecs each */ 
, 20.000 pulse(l),pulse(4) = onevolt; 
21.000 do k = 1 to 1000; 
22.000 call write(p — out,pulse) ; call write (p — out.pulsel); 
23.000 end; 
24.000 end test; 
25.000 hit: procedure; /* set up and send two buffers (1 sec.) of stimuli */ 
26.000 do s = 1 to ns; 
27.000 if s=l then do; if (q+step)>250 then cflag = 250; else cflag = 0; end; 
, 28.000 c = q+step+(5*(s-l))-cflag; 
j 29.000 if c>250 then pulsel(c— 250) = onevolt; else pulse(c) = onevolt; 
Ij 30.000 end; 
31.000 call write(p — out,pulse) ; call write(p — out, pulsel) ; 
r 32.000 ncnt = 50; 
33.000 end hit; 
34.000 initial : procedure; 
I 35.000 call close (EKGin) ; call close (P —in) ; 
36.000 a,b,pulse,pulsel,rcnt,counter,rtime,bflag' = 0; 
37.000 i.lastcount = 1; 
38.000 ncnt = 3; 
39.000 end initial; 
39.100 dispy:procedure(INCR,RATR,DIV,OFFS,VMINR,TITLEY) ; 
I 39.110 declare TITLEY char, SC char(4); 
I 39.120 xoffs = 100*OFFS; 
I 39.130 call plotsymbol(plotout,border,xoffs+border,let— size, TILLEY,90,0) ; 
39.140 do j = 0 to DIV by INCR; SC = CHAR(VMINR+j*RATR) ; 
39.150 call plotsymbol(plotout,border+10,xoffs— 10+j*100,let— size,SC,0,0) ; 
39.160 end; 
39.170 call plot(plotout,0,0,penfin) ; end dispy; 
39.200 dispt:procedure(M,TITLET) ; 
39.210 declare TITLET char,TIME char(4) ; 
39.220 do j = 1 to 20; 
39.230 if M>j*100 & M<=(j4-l)*100 then do; 
39.240 NODR = j+1; go to LEP; end; 
39.250 end; 
39.260 LEPrdo j = 0 to NODR; jjj = 100*j+l; 
39.270 call plot(plotout,jjj,border+30,penmove) ; 
39.280 call plot(plotout,jjj,border+55,pendraw) ; 
39.290 TIME = char(trunc(j*T*100+.005) ) ; 
39.300 call plotsymbol(plotout,jjj— 25,25,let — size,TIME,0,0) ; 
39.310 end; 
39.320 call plotsymbol(plotout,300,0,let— size,TITLET,0,0) ; 
39.330 call plot(plotout,100,0,penfin) ; 
39.340 end dispt; 
39.500 
40.000 threshold,step,z = 0; blank = 250; 
41.000 get dataCnumber of steps to skip', nstep) ; 
42.000 get dataCnumber of stimuli to increment', nsstep); 
43.000 get data ('starting number of stimuli'.ns) ; 
44.000 get data ('filename (8 characters) ',name) ; 
45.000 get dataCnumber of tests before incrementing stimulus ',nburst ) ; 
46.000 begin: call initial; 
46.500 call drawframe; 
