epics-modules / mrfioc2

EPICS driver for Micro Research Finland event timing system devices
http://epics-modules.github.io/mrfioc2/
Other
8 stars 29 forks source link

fix: fix several mtca evm db errors #141

Closed Insomnia1437 closed 3 months ago

Insomnia1437 commented 3 months ago
jerzyjamroz commented 3 months ago

New related PR will be added soon following some comments.

Insomnia1437 commented 3 months ago

@jerzyjamroz For the DESC of embedded EVR's output PV, how about using conditional operator? $(T)FP0->(EVGIN[$(T)==D?0:8] &!$(T)FPIN0), in this way the length is 32 which is within the maximum string length of DESC (40).

file "mrmevrout.db"
{pattern
{ON, OBJ, DESC}
{"\$(P)OutFP0", "$(EVG):EVR$(T):FrontOut0", "$(T)FP0->(EVGIN[$(T)==D?0:8] &!$(T)FPIN0)"}
{"\$(P)OutFP1", "$(EVG):EVR$(T):FrontOut1", "$(T)FP1->(EVGIN[$(T)==D?1:9] &!$(T)FPIN1)"}
{"\$(P)OutFP2", "$(EVG):EVR$(T):FrontOut2", "$(T)FP2->(EVGIN[$(T)==D?2:10]&!$(T)FPIN2)"}
{"\$(P)OutFP3", "$(EVG):EVR$(T):FrontOut3", "$(T)FP3->(EVGIN[$(T)==D?3:11]&!$(T)FPIN3)"}
{"\$(P)OutFP4", "$(EVG):EVR$(T):FrontOut4", "$(T)FP4->(EVGIN[$(T)==D?4:12]&!$(T)FPIN4)"}
{"\$(P)OutFP5", "$(EVG):EVR$(T):FrontOut5", "$(T)FP5->(EVGIN[$(T)==D?5:13]&!$(T)FPIN5)"}
{"\$(P)OutFP6", "$(EVG):EVR$(T):FrontOut6", "$(T)FP6->(EVGIN[$(T)==D?6:14]&!$(T)FPIN6)"}
{"\$(P)OutFP7", "$(EVG):EVR$(T):FrontOut7", "$(T)FP7->(EVGIN[$(T)==D?7:15]&!$(T)FPIN7)"}
}
prjemian commented 3 months ago

Consider the maximum number of characters allowed for a DESC field. With the $(T) macro, this might exceed the maximum.

Insomnia1437 commented 3 months ago

@prjemian
Thanks for your comment. I thought user should follow this rule, https://github.com/epics-modules/mrfioc2/blob/d757be7b294034c8b39068830dddd17599ff05ec/evgMrmApp/Db/evm-mtca-300-evr.uv.substitutions#L6-L7

then T is either U or D, there is no problem. But if T = EVRU/EVRD, then it will exceed the maximum. Perhaps $(T)FP7->EVGIN[$(T)==D?7:15]&!$(T)FPIN7 is better. Even EVRU/D is used, the length is 39.

jerzyjamroz commented 3 months ago

@Insomnia1437 ,