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

Superlogics: fix various issues #7058

Closed
FreddieAkeroyd opened this issue Mar 2, 2022 · 4 comments
Closed

Superlogics: fix various issues #7058

FreddieAkeroyd opened this issue Mar 2, 2022 · 4 comments
Assignees
Labels
5 for release Required for next release

Comments

@FreddieAkeroyd
Copy link
Member

FreddieAkeroyd commented Mar 2, 2022

As a developer i would like various issues with superlogics fixed before the next deployment. Currently SANS2D has a locally modified iocBoot/iocSPRLG-IOC-01/st-common.cmd , and modified sprlg.proto in support/superlogics The superlogics device is also used on ENGINX, so any changes to e.g. protocol must work there too.

  • it assumes modules have addresses 01 and 02, but on sans2d it has address 00
  • it assumes modules 01 has one channel and 02 has 8 channels
  • it uses HAS_CHAN1 and HAS_CHAN2 macros, but these should really be HAS_MOD as these are module not channels
  • get_8_values in protocol file did not work on sans as seperator of , was not seen and and initial '>' is sent. Using a repeated %7f worked.
  • units are hard-coded in st.cmd for devices
  • address 00 is really supposed to be used for INIT mode and not in general according to the manual, you enable this mode, assign an address, then disable it. Address 01 is the default according to the manual, so either it was reassigned to 00 ir has been left in INIT mode?

each module has an address. We could have HAS_MOD0, HAS_MOD1 etc or have MOD_ADDR0, MOD_ADDR1 etc. The different will be in PV names e.g. is you only have one module with address 2 should PVS have :0: or :2: in them? You could use the $(MOD_ADDR0) in the PV name, so either scheme is equally possible

Acceptance criteria

  • issues resolved so SANS2D does not need to be hotfixed on next ibex release and ENGINX superlogics still works
@ThomasLohnert
Copy link
Contributor

Question for @LilithCole ?

@FreddieAkeroyd
Copy link
Member Author

Current changes on sans2d are in support/superlogics:

diff --git a/support/superlogics/master/data/sprlg.proto b/support/superlogics/master/data/sprlg.proto
index 8b9a18817..5c0e2d782 100644
--- a/support/superlogics/master/data/sprlg.proto
+++ b/support/superlogics/master/data/sprlg.proto
@@ -3,12 +3,12 @@ ReplyTimeout = 2000;
 
 get_8_values {
     out "#\$2";
-    in "%f,%(\$1\$2:2:RAW)f,%(\$1\$2:3:RAW)f,%(\$1\$2:4:RAW)f,%(\$1\$2:5:RAW)f,%(\$1\$2:6:RAW)f,%(\$1\$2:7:RAW)f,%(\$1\$2:8:RAW)f";
+    in ">%7f%(\$1\$2:2:RAW)7f%(\$1\$2:3:RAW)7f%(\$1\$2:4:RAW)7f%(\$1\$2:5:RAW)7f%(\$1\$2:6:RAW)7f%(\$1\$2:7:RAW)7f%(\$1\$2:8:RAW)7f";
 }
 
 get_1_values {
     out "#\$2";
-    in "%f";
+    in ">%f";
 }
 
 get_version {

And in ioc/master

diff --git a/ioc/master/SPRLG/iocBoot/iocSPRLG-IOC-01/st-common.cmd b/ioc/master/SPRLG/iocBoot/iocSPRLG-IOC-01/st-common.cmd
index f249c2f46..1b28e5725 100644
--- a/ioc/master/SPRLG/iocBoot/iocSPRLG-IOC-01/st-common.cmd
+++ b/ioc/master/SPRLG/iocBoot/iocSPRLG-IOC-01/st-common.cmd
@@ -31,13 +31,13 @@ $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("L0",0,"ixoff","N")
 ## Load our record instances
 
 # Address 01 has 1 channel, and is not necessarily present on all instruments
-stringiftest("CHANNEL1", "$(HAS_CHAN1=Y)", 5, "Y")
-$(IFCHANNEL1) dbLoadRecords("${SPRLG}/db/superlogics_address.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0),ADDR=01,COUNT=1,UNITS=V")
+#stringiftest("CHANNEL1", "$(HAS_CHAN1=Y)", 5, "Y")
+#$(IFCHANNEL1) dbLoadRecords("${SPRLG}/db/superlogics_address.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0),ADDR=00,COUNT=1,UNITS=V")
 
 # Address 02 has 8 channels
 stringiftest("CHANNEL2", "$(HAS_CHAN2=Y)", 5, "Y")
-$(IFCHANNEL2) dbLoadRecords("${SPRLG}/db/superlogics_address.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0),ADDR=02,COUNT=8,UNITS=C")
-$(IFCHANNEL2) dbLoadRecords("${SPRLG}/db/superlogics_channel.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0),ADDR=02,UNITS=C")
+dbLoadRecords("${SPRLG}/db/superlogics_address.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0),ADDR=00,COUNT=8,UNITS=C")
+dbLoadRecords("${SPRLG}/db/superlogics_channel.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0),ADDR=00,UNITS=C")
 
 # Top-level DBs e.g. DISABLE, SIM, which channels are present
 dbLoadRecords("${SPRLG}/db/superlogics.db","P=$(MYPVPREFIX)$(IOCNAME):, PORT=L0, RECSIM=$(RECSIM=0), DISABLE=$(DISABLE=0)")
@@ -49,7 +49,7 @@ cd "${TOP}/iocBoot/${IOC}"
 iocInit
 
 dbpf $(MYPVPREFIX)$(IOCNAME):HAS_CHAN1 $(HAS_CHAN1=Y)
-dbpf $(MYPVPREFIX)$(IOCNAME):HAS_CHAN2 $(HAS_CHAN2=Y)
+dbpf $(MYPVPREFIX)$(IOCNAME):HAS_CHAN2 1
 
 ## Start any sequence programs
 #seq sncxxx,"user=hgv27692Host"

@KathrynBaker KathrynBaker added this to the SPRINT_2023_01_05 milestone Jan 4, 2023
@FreddieAkeroyd FreddieAkeroyd added the for release Required for next release label Jan 6, 2023
@NikolaRoev
Copy link

ENGINX is not using the IOC.

@rerpha
Copy link
Contributor

rerpha commented Jan 11, 2023

I wonder if it's worth moving the tests and emulator into the support module in this, as per #6556? ignore me, hadn't properly looked yet! though i will say - we have lost the commit history of the files in system_tests i think? If you follow #6556 (comment) you should be able to retain it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 for release Required for next release
Projects
None yet
Development

No branches or pull requests

5 participants