pcdshub / pytmc

Generate EPICS IOCs and records from TwinCAT projects - along with many TwinCAT project tools
https://pcdshub.github.io/pytmc/
Other
10 stars 11 forks source link

FIX: fix autosave pass1 by setting PINI=YES #236

Closed ZLLentz closed 3 years ago

ZLLentz commented 3 years ago

closes #235

This is a workaround fix for autosave pass1 not behaving as expected for records where PINI=0

Implementation:

With the goal of being able to cleanly remove this method if we figure out why the expected behavior did not work at ads-ioc in https://github.com/pcdshub/ads-ioc/issues/65

Resulting diff on my test IOC (extended to show the full record):

$ git diff
diff --git a/iocBoot/ioc-tc-mot-example/tc_mot_example.db b/iocBoot/ioc-tc-mot-example/tc_mot_example.db
index 319a356..cd3628b 100644
--- a/iocBoot/ioc-tc-mot-example/tc_mot_example.db
+++ b/iocBoot/ioc-tc-mot-example/tc_mot_example.db
@@ -13,6 +13,7 @@ record(ai, "PLC:TST:PASS1_RBV") {

 record(ao, "PLC:TST:PASS1") {
   field(DESC, "Main.fAutoPass1")
+  field(PINI, "1")
   field(DTYP, "asynFloat64")
   field(OUT, "@asyn($(PORT),0,1)ADSPORT=851/Main.fAutoPass1=")
   field(PREC, "3")
   info(autosaveFields, "VAL")
   info(autosaveFields_pass0, "PREC")
   info(archive, "VAL")
 }
ZLLentz commented 3 years ago

I'd like to deploy the bandaid during the upcoming PAMM next week if we can't find the real culprit. This would help a lot with the tmo and fee vacuum systems.

klauer commented 3 years ago

Sounds like a plan. Will make a goal today to dive a bit deeper, ensuring there's enough time to tag/rebuild/release IOCs for the PAMM.

klauer commented 3 years ago

I'm convinced this is the correct fix, not a band-aid. Let's move forward with it.