;+
; NAME:
;	RD_PLAN_AREA
; PURPOSE:
;	reads image and history records of bcs micro parameter area
; CATEGORY:
; CALLING SEQUENCE:
;	rd_plan_area,plan_area,history,jhist,jhist_max
; INPUTS:
; OPTIONAL INPUT PARAMETERS:
; KEYWORD PARAMETERS:
; OUTPUTS:
;	plan_area		512 byte image of plan area
;	history			structure describing changes
;	jhist			no. of change records
;	jhist_max		max no of records (100)
; OPTIONAL OUTPUT PARAMETERS:
; COMMON BLOCKS:
; SIDE EFFECTS:
; RESTRICTIONS:
; PROCEDURE:
; MODIFICATION HISTORY:
;	rdb   5-may-94	written
;	RDB  17-May-94	Made file /xdr
;-

pro	rd_plan_area,plan_area,history,jhist,jhist_max

bcs_cpu_struct

plan_area = bytarr(512)
jhist=0 & jhist_max=0
ptime = bytarr(7)

print,'** Reading BCS Micro Plan Area'

openr,lunr,concat_dir('$DIR_BCS_MICRO','plan_area_image.dat'),/get_lun,/xdr
readu,lunr,plan_area
readu,lunr,ptime
readu,lunr,jhist,jhist_max
history = replicate({cpu_history_rec},jhist_max)
readu,lunr,history
free_lun,lunr

print,'** This plan area was stored: ',fmt_tim(ptime)

return
end
