Closed klauer closed 5 years ago
I can't reproduce the original exception with master (v1.1.2). However, pytmc
erroneously outputs records such as:
record(bo,"TV2K4_VGC_1:OPN_SW field: ZNAM CLOSE field: ONAM OPEN io: io"){
info(asyn:READBACK,"1")
field(PINI, "1")
field(TSE, -2)
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),0,1)ADSPORT=851/GVL_DEVICES.TV2K4_VGC_1.iq_stValve.pv_xOPN_SW?")
field(SCAN, "Passive")
field(ONAM, One)
field(ZNAM, Zero)
}
Note, specifically, the record name: "TV2K4_VGC_1:OPN_SW field: ZNAM CLOSE field: ONAM OPEN io: io"
OK, it appears that the above is due to improperly formatted tags in the .tmc file itself:
Problematic version: https://github.com/craigmcchesney/XTES-SXR-vacuum-PLC-prototype/blob/ebcb0d355e9bfae8835a790c94ab54b61616547a/XtesSxrPlcProto/XtesSxrPlc/XtesSxrPlc.tmc#L75
The recent master corrects this: https://github.com/craigmcchesney/XTES-SXR-vacuum-PLC-prototype/blob/c275fe633f27adfab86f31c001725f9b06342b52/XtesSxrPlcProto/XtesSxrPlc/XtesSxrPlc.tmc#L81
Resulting in:
record(bo,"TV2K4_VGC_1:OPN_SW"){
info(asyn:READBACK,"1")
field(ONAM, OPEN)
field(PINI, "1")
field(TSE, -2)
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),0,1)ADSPORT=851/GVL_DEVICES.TV2K4_VGC_1.iq_stValve.pv_xOPN_SW?")
field(SCAN, "Passive")
field(ZNAM, Zero)
}
It seems like the parsing could be a bit smarter in detecting section breaks (either raising an error or parsing it correctly), but that's probably a separate issue.
OK to close this @craigmcchesney @n-wbrown @mdavidsaver?
I think this is good to close. The fix has come in two parts:
Unless this error has occurred in a new or exciting way, It's safe to close this issue.
I like the suggestion of alerting the user to these issues or automatically correcting them.
With 6c8a5305aa5efbd08132e48bf32db0e3bda1fb92 I can now generate a database which loads without error.
Originally posted by @mdavidsaver in https://github.com/slaclab/pytmc/issues/23#issuecomment-473076602
With 619562e9dde4731716bd797c735219c8c6bb94c1
Trying again with https://github.com/craigmcchesney/XTES-SXR-vacuum-PLC-prototype/commit/ebcb0d355e9bfae8835a790c94ab54b61616547a/XtesSxrPlcProto/XtesSxrPlc/XtesSxrPlc.tmc
I get: