' this little program creates a stimulation protocol for trains of stimuli to a sequencer file var aus,ontime,repts,LoopA,LoopB,offtime,frequ,n,z,dacport,spike[10000],delay$,pulsedura,zaehl,logfilename$,pulseamp, log%; n:=1; frequ:=input("what is the stimulus frequency?",15); ' holds stimulus frequency ontime:=input("How long is the stimulus on for (in sec)?",6); ' holds the ontime of the train offtime:=input("How log is the pause between stimuli (in sec)?",4); ' hold the off time of the train repts:=input("How many repeats?",10); ' total number of trains dacport:=input("which DAC port of the 1401?",1); ' the port of the 1401 that is used for stimulation delay$:=input$("give character for start of sequencer","t"); 'character key to start stimulation in the sequencer pulsedura:=input("pulseduration for single event in ms?",5); 'pulseduration in sequencer pulsedura:=pulsedura/1000; pulseamp:=input("pulseamplitude for stimulation (in Volt)?",1); 'pulseamplitude for stimulation (should be superthresold) LoopA:=ontime*frequ; LoopB:=repts; aus:=1/frequ; ' write the sequencer file Printlog("SET 0.5,1,0","\n"); Printlog(" ","VAR V1,LoopA=0"); Printlog(" ","VAR V2,LoopB=0"); Printlog(" ","DAC ",dacport,",0"); Printlog(" ","MOVI LoopA,",LoopA); Printlog(" ","MOVI LoopB,",LoopB); Printlog(" ","HALT"); Printlog("EA: '",delay$," DAC ",dacport,",0"); Printlog(" ","DAC ",dacport,",",pulseamp); Printlog(" ","DELAY s(",pulsedura,")-1"); Printlog(" ","DAC ",dacport,",0"); Printlog(" ","DELAY s(",aus,")-1"); Printlog(" ","DBNZ LoopA,EA"); Printlog(" ","DELAY s(",offtime,")-1"); Printlog(" ","MOVI LoopA,",LoopA); Printlog(" ","DBNZ LoopB,EA"); Printlog(" ","MOVI LoopB,",LoopB); Printlog(" ","HALT"); ' and save the file log%:=LogHandle(); 'get the logfile handle View(log%); ' show it FileSaveAs(logfilename$,1); ' save it