###CHECKPOINT ARGS:  -nostartlog -nolog-flow -nolog-blocks -queue=0
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/sim/src/take_pic.src"
descr "take_pic - takes verification images (in 4x4)"
# program take_pic.src, created 96.01.31 Igor Zayer 
#
# Part of alignment procedure: takes verification images;
# usually called by 'alignit.src'
#
# Variable usage:
#----------------
# !GI0: exposure time (ticks)
# !GS7: 'enable calling the leg routine' string (is set once picture is taken)
# !GS8: name of 160k file
# !GS9: name of user logfile
#
# !LI0: loop count variable
# !LS0: answer string
#----------------


##  SET HEADER TO INVOKE 4x4 IP SUMMING (table index 30)
tcblock mbcmhdr1 0x4040 0x4040 0 1 30
writen !GS9 " loading header for QPROG_TAP_CONT_4X4BIN, index = 30"

##  SET EXPOSURE TIME TO 600 TICKS
set !GI0 = 600

##  NOW TAKE PICTURE(S)
for !LI0 = 0 to 32000
  tcblock mbcmtp1 0x8042 0 !GI0
  write !GS9 " taking exposure with %d" !GI0
  writen !GS9 " ticks"
  setstr !GS7 = "enable legs"
  menu !LS0 "ANOTHER PICTURE?" "YES, another one..." "NO, enough!"
  exit if !LS0 = "NO, enough!"
end for

return
