91 lines
1.8 KiB
Plaintext
91 lines
1.8 KiB
Plaintext
# This code integrates the beam intensity signal during the
|
|
# time where the integration is activated (SWITCH = 1).
|
|
# It also counts the time during which the integration occured.
|
|
|
|
|
|
# this is a switch which can be set to activate/deactivate the counting
|
|
record(bi, "$(P)SWITCH")
|
|
{
|
|
field(DTYP,"Soft Channel")
|
|
field(ZNAM,"Low")
|
|
field(ONAM,"High")
|
|
}
|
|
|
|
## This is an accumulator for the beam intensity integral
|
|
record(ai, "$(P)ACCINT")
|
|
{
|
|
field(DTYP, "Soft Channel")
|
|
field(LINR, "LINEAR")
|
|
}
|
|
|
|
# field for a beam copy
|
|
record(ai, "$(P)BEAMCPY")
|
|
{
|
|
field(DTYP, "Soft Channel")
|
|
field(LINR, "LINEAR")
|
|
field(INP, "$(AI) CP")
|
|
field(SCAN, "Passive")
|
|
}
|
|
|
|
# This is for holding a preset
|
|
record(ai, "$(P)PRESET")
|
|
{
|
|
field(DTYP, "Soft Channel")
|
|
field(LINR, "LINEAR")
|
|
}
|
|
#
|
|
#
|
|
#
|
|
## This is an accumulator for the exposure time
|
|
record(ai, "$(P)ACCTIME")
|
|
{
|
|
field(DTYP, "Soft Channel")
|
|
field(LINR, "LINEAR")
|
|
}
|
|
#
|
|
## This record computes the integral of the beam intensity
|
|
## (gated by the SWITCH signal)
|
|
record(calcout, "$(P)BEAMINT")
|
|
{
|
|
field(SCAN,"Passive")
|
|
field(INPA,"$(AI) CP")
|
|
field(INPB,"$(P)SWITCH")
|
|
field(INPD,"$(P)ACCINT")
|
|
field(CALC,"(B >= 1) ? D + A : D")
|
|
field(OUT,"$(P)ACCINT PP")
|
|
field(OOPT,"On Change")
|
|
field(DOPT,"Use CALC")
|
|
field(FLNK, "$(P)COUNTER")
|
|
}
|
|
|
|
# This record stops counting when the preset has been reached
|
|
record(calcout, "$(P)COUNTER")
|
|
{
|
|
field(SCAN,"Passive")
|
|
field(INPA,"$(P)BEAMINT")
|
|
field(INPB,"$(P)SWITCH")
|
|
field(INPD,"$(P)PRESET")
|
|
field(CALC,"(B >= 1 && A >= D) ? 0 : 1")
|
|
field(OUT,"$(P)SWITCH PP")
|
|
field(OOPT,"When Zero")
|
|
field(DOPT,"Use CALC")
|
|
}
|
|
|
|
|
|
#
|
|
#
|
|
#
|
|
## This record computes the total exposure time
|
|
## (gated by the SWITCH signal)
|
|
record(calcout, "$(P)COUNTTIME")
|
|
{
|
|
field(SCAN,".1 second")
|
|
field(INPA,"$(AI)")
|
|
field(INPB,"$(P)SWITCH")
|
|
field(INPD,"$(P)ACCTIME")
|
|
field(CALC,"(B >= 1) ? D + 0.1 : D")
|
|
field(OUT,"$(P)ACCTIME PP")
|
|
field(OOPT,"On Change")
|
|
field(DOPT,"Use CALC")
|
|
}
|