CAEN C671 CFD initialization
Added on sept. 28th, 2005
The example assumes that two CAEN C671 Constant Fraction Discriminators (CFD) are present in slots 16 and 18.
This Lua fragment may be saved and run at powerup by setting the ROB (Run-On-Boot) flag.
-- definiton of labels for inputs 1-4
-- CAMAC stations in which the two CFD are inserted
cfd1 = 16
cfd2 = 18
-- Threshold, pulse width and dead time definition.
thr = 14
width= 200
dead = 10
-- Crate initialization
CCCC()
CCCZ()
jn_led(1,0)
--Threshold set-up
for i = 0,15 do
q,d = CSSA(16,cfd1,i,thr)
q,d = CSSA(16,cfd2,i,thr)
end
-- Channels enable
q,d = CSSA(18,cfd1,0,65535)
q,d = CSSA(18,cfd2,0,65535)
-- Output pulse width set-up
q,d = CSSA(20,cfd1,6,width)
q,d = CSSA(20,cfd1,7,width)
q,d = CSSA(20,cfd2,6,width)
q,d = CSSA(20,cfd2,7,width)
-- Dead time set-up
q,d = CSSA(20,cfd1,4,dead)
q,d = CSSA(20,cfd1,5,dead)
q,d = CSSA(20,cfd2,4,dead)
q,d = CSSA(20,cfd2,5,dead)
pause(100)
-- Turn on Led 1 of the CAMAC controller
-- to indicate completion of the initialization procedure
jn_led(1,1)