Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust records to allow restore of values on start #7

Merged
merged 3 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 135 additions & 23 deletions dg645Sup/dg645.db
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,40 @@ record(bo, "$(P)$(R)DISABLE")
field(ONAM, "COMMS DISABLED")
}

record(mbbo, "$(P)$(R)MODE:SP")
{
field(DTYP, "Raw Soft Channel")
field(DESC, "Enable Local or Remote Mode")
field(ZRST, "REMOTE")
field(ONST, "LOCAL")
field(ZRVL, "3")
field(ONVL, "12")
field(OUT, "$(P)$(R)MODE:SEQ.SELN")
field(FLNK, "$(P)$(R)MODE:SEQ.PROC")
field(UDFS, "NO_ALARM")
}

record(seq, "$(P)$(R)MODE:SEQ")
{
field(SHFT, "0")
field(SELM, "Mask")
field(DOL0, "1")
field(DOL1, "0")
field(DOL2, "1")
field(DOL3, "1")
field(LNK0, "$(P)$(R)GotoRemoteBO PP")
field(LNK1, "$(P)$(R)DISABLE PP")
field(LNK2, "$(P)$(R)DISABLE PP")
field(DLY3, "0.1")
field(LNK3, "$(P)$(R)GotoLocalBO PP")
}

## Trigger settings and readback + suplementary records for reading
## T0 and T1 that are not implemented by Delaygen

# Trigger set

record(mbbo,"$(P)$(R)TRIGGERSOURCE:SP")
{
field(DESC, "Trigger source")
field(SCAN, "Passive")
field(ZRST, "Internal")
field(ONST, "External Rising Edges")
field(TWST, "External Falling Edges")
field(THST, "SS External Rising Edges")
field(FRST, "SS External Falling Edges")
field(FVST, "Single Shot")
field(SXST, "Line")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(DTYP, "Soft Channel")
field(OUT, "$(P)$(R)TriggerSourceMO")
field(FLNK, "$(P)$(R)TriggerSourceMO")
info(dgconfig, "VAL")
}
alias("$(P)$(R)TriggerSourceMO","$(P)$(R)TRIGGERSOURCE:SP")

# Trigger actual

Expand Down Expand Up @@ -116,6 +122,71 @@ record(mbbi,"$(P)$(R)T1ReferenceMI")
info(INTEREST, "HIGH")
}

record(mbbo,"$(P)$(R)T0ReferenceMO")
{
field(DESC, "Chan T0 Ref")
field(SCAN, "Passive")
field(ZRST, "T0")
field(ONST, "T1")
field(TWST, "A")
field(THST, "B")
field(FRST, "C")
field(FVST, "D")
field(SXST, "E")
field(SVST, "F")
field(EIST, "G")
field(NIST, "H")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(EIVL, "8")
field(NIVL, "9")
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT)) T0_REF")
field(SIML, "$(P)$(R)SIM")
field(SIOL, "$(P)$(R)SIM:T0REFERENCEMI")
field(SDIS, "$(P)$(R)DISABLE")
info(dgconfig, "VAL")
}

record(mbbo,"$(P)$(R)T1ReferenceMO")
{
field(DESC, "Chan T1 Ref")
field(SCAN, "Passive")
field(ZRST, "T0")
field(ONST, "T1")
field(TWST, "A")
field(THST, "B")
field(FRST, "C")
field(FVST, "D")
field(SXST, "E")
field(SVST, "F")
field(EIST, "G")
field(NIST, "H")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(EIVL, "8")
field(NIVL, "9")
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT)) T1_REF")
field(SIML, "$(P)$(R)SIM")
field(SIOL, "$(P)$(R)SIM:T1REFERENCEMI")
field(SDIS, "$(P)$(R)DISABLE")
info(dgconfig, "VAL")
}


# These records two must follow Delaygen's naming standard
# as they are extension of Delaygen's functionality

Expand Down Expand Up @@ -151,6 +222,47 @@ record(ai,"$(P)$(R)T1DelayAI")
info(INTEREST, "HIGH")
}


record(ao,"$(P)$(R)T0DelayAO")
{
field(DESC, "T0 Delay")
field(PREC, "12")
field(EGU, "s")
field(OUT, "$(P)$(R)T0DelayWriteAO PP")
info(dgconfig, "VAL")
}

record(ao,"$(P)$(R)T0DelayWriteAO")
{
field(PREC, "12")
field(EGU, "s")
field(DTYP, "asynFloat64")
field(OUT, "@asyn($(PORT)) T0_DELAY")
field(SIML, "$(P)$(R)SIM")
field(SIOL, "$(P)$(R)SIM:T0DelayAI")
field(SDIS, "$(P)$(R)DISABLE")
}

record(ao,"$(P)$(R)T1DelayAO")
{
field(DESC, "T1 Delay")
field(PREC, "12")
field(EGU, "s")
field(OUT, "$(P)$(R)T1DelayWriteAO PP")
info(dgconfig, "VAL")
}

record(ao,"$(P)$(R)T1DelayWriteAO")
{
field(PREC, "12")
field(EGU, "s")
field(DTYP, "asynFloat64")
field(OUT, "@asyn($(PORT)) T1_DELAY")
field(SIML, "$(P)$(R)SIM")
field(SIOL, "$(P)$(R)SIM:T0DelayAI")
field(SDIS, "$(P)$(R)DISABLE")
}

## Total delay widths (for the graphs)

record(calc,"$(P)$(R)TRGDELAYWIDTH")
Expand Down
70 changes: 57 additions & 13 deletions dg645Sup/dg645_delay.db
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ record(bo, "$(P)$(R)$(Q)DISABLE")

# Delay set

record(stringout,"$(P)$(R)$(Q)DELAY:SP")
record(ao,"$(P)$(R)$(Q)DELAY:SP")
{
field(DESC, "Chan $(Q) setpoint")
field(SCAN, "Passive")
field(EGU, "")
info(dgconfig, "VAL")
}

record(mbbo,"$(P)$(R)$(Q)DELAYUNIT:SP")
Expand All @@ -31,6 +33,7 @@ record(mbbo,"$(P)$(R)$(Q)DELAYUNIT:SP")
field(THVL, "9")
field(FRVL, "12")
field(DTYP, "Soft Channel")
info(dgconfig, "VAL")
}

record(calcout,"$(P)$(R)$(Q)DELAYUNITOUT")
Expand All @@ -40,8 +43,7 @@ record(calcout,"$(P)$(R)$(Q)DELAYUNITOUT")
field(INPA, "$(P)$(R)$(Q)DELAY:SP")
field(INPB, "$(P)$(R)$(Q)DELAYUNIT:SP.RVAL")
field(CALC, "A*(10^(-1*B))")
field(OUT, "$(P)$(R)$(Q)DelayAO")
field(FLNK, "$(P)$(R)$(Q)DelayAO.PROC")
field(OUT, "$(P)$(R)$(Q)DelayAO PP")
field(ASG, "READONLY")
}

Expand All @@ -53,56 +55,98 @@ record(fanout,"$(P)$(R)$(Q)DELAYBUTTON")
field(LNK2, "$(P)$(R)$(Q)REFERENCESEQUENCE")
}

record(stringout,"$(P)$(R)$(Q)REFERENCE:SP")
record(mbbo,"$(P)$(R)$(Q)REFERENCE:SP")
{
field(DESC, "Chan $(Q) setpoint ref")
field(SCAN, "Passive")
info(dgconfig, "VAL")
field(ZRST, "T0")
field(ONST, "A")
field(TWST, "B")
field(THST, "C")
field(FRST, "D")
field(FVST, "E")
field(SXST, "F")
field(SVST, "G")
field(EIST, "H")
}

record(sseq,"$(P)$(R)$(Q)REFERENCESEQUENCE")
{
field(DESC, "Chan $(Q) Reference set")
field(SCAN, "Passive")
field(DOL1, "$(P)$(R)$(Q)REFERENCE:SP")
field(LNK1, "$(P)$(R)$(Q)ReferenceMO")
field(FLNK, "$(P)$(R)$(Q)ReferenceMO.PROC")
field(LNK1, "$(P)$(R)$(Q)ReferenceMO PP")
}

record(stringout,"$(P)$(R)$(Q)REFERENCE:INIT")
{
field(PINI, "YES")
field(SCAN, "Passive")
field(OMSL, "closed_loop")
field(DOL, "$(P)$(R)$(Q)ReferenceMO")
field(OUT, "$(P)$(R)$(Q)REFERENCE:SP PP")
}

# Delay actual

record(calc,"$(P)$(R)$(Q)DELAYCONVERT")
record(calcout,"$(P)$(R)$(Q)DELAYCONVERT")
{
field(PINI, "YES")
field(DESC, "$(Q) value conversion")
field(SCAN, "Passive")
field(PREC, "12")
field(INPA, "$(P)$(R)$(Q)DelayAI CP")
field(CALC, "(A>1)?A:((A*1e3>1)?A*1e3:((A*1e6>1)?A*1e6:((A*1e9>1)?A*1e9:A*1e12)))")
field(ASG, "READONLY")
field(OUT, "$(P)$(R)$(Q)DELAY:RB PP")
}

record(ai,"$(P)$(R)$(Q)DELAY:RB")
{
field(DESC, "$(Q) value input")
field(SCAN, "Passive")
field(PREC, "8")
field(INP, "$(P)$(R)$(Q)DELAYCONVERT CP")
field(ASG, "READONLY")
info(INTEREST, "HIGH")
field(EGU, "")
}

record(scalcout,"$(P)$(R)$(Q)DELAYUNIT:RB")
record(calcout,"$(P)$(R)$(Q)DELAY:INIT")
{
field(PINI, "YES")
field(DESC, "$(Q) unit conversion")
field(SCAN, "Passive")
field(INPA, "$(P)$(R)$(Q)DelayWriteAO")
field(CALC, "(A>1)?A:((A*1e3>1)?A*1e3:((A*1e6>1)?A*1e6:((A*1e9>1)?A*1e9:A*1e12)))")
field(ASG, "READONLY")
field(OUT, "$(P)$(R)$(Q)DELAY:SP PP")
}

record(scalcout,"$(P)$(R)$(Q)DELAYUNIT:RB_")
{
field(SCAN, "Passive")
field(INPA, "$(P)$(R)$(Q)DelayAI CP")
field(CALC, "(A>1)?'s':((A*1e3>1)?'ms':((A*1e6>1)?'us':((A*1e9>1)?'ns':'ps')))")
field(ASG, "READONLY")
field(OUT, "$(P)$(R)$(Q)DELAYUNIT:RB PP")
}

record(stringin,"$(P)$(R)$(Q)DELAYUNIT:RB")
{
field(DESC, "$(Q) unit conversion")
field(SCAN, "Passive")
info(INTEREST, "HIGH")
}

record(scalcout,"$(P)$(R)$(Q)DELAYUNIT:INIT")
{
field(PINI, "YES")
field(SCAN, "Passive")
field(INPA, "$(P)$(R)$(Q)DelayWriteAO")
field(CALC, "(A>1)?'s':((A*1e3>1)?'ms':((A*1e6>1)?'us':((A*1e9>1)?'ns':'ps')))")
field(ASG, "READONLY")
field(OUT, "$(P)$(R)$(Q)DELAYUNIT:SP PP")
}

# Delay width

record(calc,"$(P)$(R)$(Q)DELAYWIDTH")
Expand All @@ -125,14 +169,14 @@ record(calc,"$(P)$(R)$(Q)DELAYWIDTH")
field(INPL, "$(P)$(R)$(Q)DelayAI CP")
field(CALC, "L+(K=0?A:(K=1?B:(K=2?C:(K=3?D:(K=4?E:(K=5?F:(K=6?G:(K=7?H:(K=8?I:J)))))))))")
field(ASG, "READONLY")
field(FLNK, "$(P)$(R)$(Q)DELAYWIDTHUNIT:RB.PROC")
}

record(scalcout,"$(P)$(R)$(Q)DELAYWIDTHUNIT:RB")
{
field(PINI, "YES")
field(DESC, "$(Q) Width unit convert")
field(SCAN, "Passive")
field(INPA, "$(P)$(R)$(Q)DELAYWIDTH CP")
field(INPA, "$(P)$(R)$(Q)DELAYWIDTH")
field(CALC, "(A>1)?'s':((A*1e3>1)?'ms':((A*1e6>1)?'us':((A*1e9>1)?'ns':'ps')))")
field(ASG, "READONLY")
info(INTEREST, "HIGH")
Expand Down
3 changes: 2 additions & 1 deletion dg645Sup/dg645_delay_width_shared.db
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ record(calc,"$(P)$(R)$(Q)DELAYWIDTHCONVERT")
field(INPA, "$(P)$(R)$(Q)DELAYWIDTH CP")
field(CALC, "(A>1)?A:((A*1e3>1)?A*1e3:((A*1e6>1)?A*1e6:((A*1e9>1)?A*1e9:A*1e12)))")
field(ASG, "READONLY")
field(FLNK, "$(P)$(R)$(Q)DELAYWIDTH:RB.PROC")
}

record(ai,"$(P)$(R)$(Q)DELAYWIDTH:RB")
{
field(DESC, "$(Q) Width value output")
field(SCAN, "Passive")
field(PREC, "8")
field(INP, "$(P)$(R)$(Q)DELAYWIDTHCONVERT CP")
field(INP, "$(P)$(R)$(Q)DELAYWIDTHCONVERT")
field(ASG, "READONLY")
info(INTEREST, "HIGH")
field(EGU, "")
Expand Down
14 changes: 1 addition & 13 deletions dg645Sup/dg645_logic.db
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,7 @@ record(bo, "$(P)$(R)$(Q)DISABLE")

# Logic set

record(mbbo,"$(P)$(R)$(Q)OUTPUTPOLARITY:SP")
{
field(DESC, "$(Q) polarity")
field(SCAN, "Passive")
field(ZRST, "Negative")
field(ONST, "Positive")
field(ZRVL, "0")
field(ONVL, "1")
field(DTYP, "Soft Channel")
field(OUT, "$(P)$(R)$(Q)OutputPolarityBO")
field(FLNK, "$(P)$(R)$(Q)OutputPolarityBO")
info(dgconfig, "VAL")
}
alias("$(P)$(R)$(Q)OutputPolarityBO", "$(P)$(R)$(Q)OUTPUTPOLARITY:SP")

record(seq,"$(P)$(R)$(Q)LOGICTTL:SP")
{
Expand Down
Loading