ISISComputingGroup / IBEX

Top level repository for IBEX stories
5 stars 2 forks source link

lakeshore 336 units warnings #1760

Closed FreddieAkeroyd closed 7 years ago

FreddieAkeroyd commented 7 years ago

Are these a problem?

WARNING: Multiple instances of $(P):HEATER1:RANGE in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):OUT_MODE1:SP in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):OUT_MODE2 in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):HEATER1:RANGE:SP in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):HEATER2:RANGE:SP in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):HEATER2:RANGE in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):OUT_MODE1 in ......\ioc\master\LKSH336\db\lakeshore336.db WARNING: Multiple instances of $(P):OUT_MODE2:SP in ......\ioc\master\LKSH336\db\lakeshore336.db

mattclarke commented 7 years ago

Two are declared:

## 
## Read the range parameter (the heater output power range).
## This is output specific and is defined in another file.
##
record(mbbi, "$(P):HEATER1:RANGE") {
  field(DESC, "Output 1 Heater Output Power Range")
  field(DTYP, "stream")
  field(SDIS, "$(P):DISABLE")
  field(ZRVL, "0")
  field(ONVL, "1")
  field(TWVL, "2")
  field(THVL, "3")
  field(FRVL, "4")
  field(FVVL, "5")
  field(SCAN, "$(SCAN) second")
  field(INP, "@ls336.proto getRANGE(1) $(PORT) $(ADDR)")
  field(SIML, "$(P):SIM")
  field(SIOL, "$(P):SIM:HEATER1:RANGE")
  info(INTEREST, "HIGH")
  info(archive, "VAL")
}

and

## 
## Define the strings and values for this record.
##
record(mbbi, "$(P):HEATER1:RANGE") {
  field(ZRST, "Off")
  field(ONST, "Low")
  field(TWST, "Medium")
  field(THST, "High")
}

They come from different template files.

mattclarke commented 7 years ago

This change is where they were renamed (but they were the same anyway):

https://github.com/ISISComputingGroup/EPICS-lakeshore/commit/9357fa08d53ac2c0d28205ba097565d9f660f05e

mattclarke commented 7 years ago

I don't think all the templates are supposed to be included. I think you just include the top one which then includes the others, see:

https://github.com/ISISComputingGroup/EPICS-lakeshore/blob/9357fa08d53ac2c0d28205ba097565d9f660f05e/lakeshore336/lakeshore336App/Db/lakeshore336.template

Try this on Monday

IsabellaRey commented 7 years ago

For clarity: the warnings are about duplicate PVs in separate files. It is possible to spread the defintion of a PV through multiple files, EPICS will just join them together. Technically, this is only a problem if the same field is defined multiple times. In this case they are not, just the string values are separated out. There is a maintenance problem in that if the PVs are renamed, we have to do it in multiple files.

The PVs were setup like that in the third-party driver we got originally, and which is still in the vendor branch. The reason is that the Lakeshore 336 has two types of output. Some common functionality is in lakeshore336output.template, the parts that are specific to each output type are in lakeshore336loop.template and lakeshore336analog.template. In this case, some mbbis are defined as common, but the meaning of the strings are separated because they are specific to the type of output.

However, in Ibex we're only using one type of output (the loop)! In addition, when adapting the vendor driver, the PVs were also renamed, but only in the files actually in use...! So the warnings appear for the duplicates in lakeshore336output and lakeshore336loop, but not for lakeshore336analog (which has the original names).

In conclusion, the duplication itself is intentional (which answer the question of the ticket). One could tidy up the support module to delete the files not in use, but you can see what is in use from the substitutions file. After discussion with Matt, we decided it was not worth changing this. Rather, it would be nice to have a way of flagging a PV duplicate as intentional, so the db checker doesn't warn about it.