# File: dpstart.src
#
# This procedure turns on all the devices normally on.  Use this control file
# if the DEP has been reset/reloaded with the instrument fully on.  The
# commands in this file gets the DEP status to a state consistant with the
# "ON" instrument.

program "@(#) MODULE: dpstart.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/dpstart.src"
descr "  dpstart - Informs the DEP that the instrument is on."

if !GS9 = "" then                         
  display "Opening logfile from dpstart"
  perform  "openlog_v01"                                                   
end if                                    

display "Executing procedure dpstart."
write  !GS9 "Executing procedure dpstart :"
write  !GS9 " %s" !DATE
writen !GS9 " %s" !TIME
writen !GS9 " "

tcblock mbpwaeon
# Reset all motor controllers.
tcblock mbshrs
tcblock mbm1rs
tcblock mbm2rs
tcblock mbpars
tcblock mbc1rs
tcblock mbc2rs
tcblock mbfdrs
tcblock mbam1rs
tcblock mbam2rs

# .... The following is the important part of lipon .....

tcblock mbpwipon
tcblock mbiprsal
tcblock mbcmhdr1 0x4040 0x4040 0 1 0

# .... The following is the important part of lcmpon .....

tcblock mbpwcmon
tcblock mbcmres
# Set A ampifier & CCD offset (aadc=3 for flight electronics)
tcblock mbcmaadc 3

# .... The following is the important part of lmchson .....

tcblock mbpwshon
tcblock mbpwm1on
tcblock mbpwm2on
tcblock mbpwpaon
tcblock mbpwc1on
tcblock mbpwc2on

display "Finished procedure dpstart : %s" !TIME
writen !GS9 "Finished procedure dpstart : %s" !TIME
writen !GS9 " "
return
