MARS ChannelMap and Calibrations
This doc is a capture of notes fro Rich on how to change MARS NPC channel and a/d sensor cals rebuild the iospecdb.
Dated approx 11/22/2014
11-25-2007 MARS_whattoDo.doc
To add “sensors” to pmacs-sever
CHANNEL MAPPING
pmacs-server appears to get the atod channel mappings from an embedded “Berkeley db3” database at startup. This is a binary file named iospecdb by default. That database can be rebuilt when needed using the python script buildiospec.py to process an ascii text file called iodesc
iodesc establishes the mapping of an atod channel to an ‘id’ (a name, prob. needs to be unique) in pmacs-sever.
TODO: 1. Make safety copies of iodesc and iospecdb 2. In file iodesc, add entry to structure “sensors” for each new board/channel./id/units. As of this writing there are 14 sensor entries. 3. run buildiospec.py iodesc 4. verify iospecdb is in correct location
CALIBRATION
It looks like there are two calibration files, a defcal.csv and cal.csv. defcal.csv has the defaults for all known devices, cal.csv can override the defaults. Both are only read in at startup. Calibrations appear to only be first-order ( y=mx+b ). It looks like one might safely enter additional coeffiecients. However it looks line the NPCdata.py script is hard coded to only perform a first-order correction using the first two coeffecients of the calibration entry for each. Sensor calibrations are ‘looked up’ using the id (name) field from the Channel Mappings above.
TODO: 1. edit defcal.csv to have appropriate default calibration entry for each “sensor” added above. Fields are id, offset (b), slope(m) and units label
Restart pmacs server.
Look at getSensor soap messages with vb.net client
In pmacs client:
1) Add controls needed to PMACSengsensor.vb Could be on the mV panel???
2) In Initialization.vb Region "Initialize Engineering Sensors" handle sensor updates to gui. This is where we could do the math looks like we could use controls like MVHP and MVT_0 …n if they are not being used,’Note MVHP and MVT_6 and MVT_7 appear to be direct controls, MVT_0-5 are part of a control array MVT, looks like this is an artifact of upgrading from a vb6 proj?
Note: PMACSmain.vb calls SensorInitialize when the soap thread has new data.