UMN CDMS Wiki archive
start › cdms › k100 › procedure › midas

MIDAS

Temporary instructions for cdms1

Test instructions for cdms2

cdms2 MIDAQ DAQ instructions 2022

Note: on 2020-November-18, IT changed some things, so that the shared user “cdmssoft” was renamed “spa-u-cdmssoft”, and the home directory of the DAQ was changed from /home/hep/cdmssoft/ to /home/spa-u-cdmssoft. This required changing a lot of scripts and ODB values and things to update the path. As of this writing I think the DAQ is working again, but if there are problems it may be related to the wrong path or wrong username still in code somewhere.

Currently, MIDAS web interface can be found at cdms2.spa.umn.edu:8081, and all MIDAS DAQ code is in the directory: <blockquote>/home/spa-u-cdmssoft/scdmsDAQ/MidasDAQ/online</blockquote>

Before using MIDAS, check that any process not connected to MIDAS is not occupying the ports to be used by MIDAS, especially Labview vi and putty sessions on the windows DAQ machine. To see or change which ports MIDAS will use go to the MIDAS front-end page at jiajin.spa.umn.edu:8081 cdms2.spa.umn.edu:8081 and select the ODB page at the top. Click on the 'Equipment' link and then the 'Tower01' link (or whichever tower(s) you want to check). Then select the 'Settings' link to see all available DCRCs on the tower. Select a DCRC you wish to look at (be sure to check all DCRCs that will be in use). The variables 'dcrc_driver_port' and 'DcrcPort' list the ports MIDAS will use. As of now, these ports are 5001 and 5002 in order to leave 5000 open for the Labview DetectorReadout.vi to run on its default port for troubleshooting purposes. This could change. Stop all Labview programs that use the MIDAS ports before continuing.

To connect to the DCRC using the MIDAS website:

  1. Check that red ethernet plug is in the switch.
  2. On the website go to the “Programs” tab at the top. The programs “mhttpd” and “Logger” should already be running.
  3. Start “dcrc_driver01”, “towerfe3_01”, and “triggerfe2” in that order using the buttons to the right.
  4. Check the “Status” tab to ensure that the programs you started are now running and the “Messages” tab to ensure that no serious error messages occurred. If not, then you are now connected to the DCRC boards and are ready to run a sequence.

To Build and Execute a Sequence:

  1. You must be in the group spa-cdmssoft. If you are not, talk to Anthony Matt.
  2. In a terminal, open a shell in spa-u-cdmssoft by typing the command sudo -u spa-u-cdmssoft -s. At the prompt, enter your own password.
  3. Go to the directory /home/spa-u-cdmssoft/repositories/MidasDAQ/online. From this directory, all sequence files can be found in the sequencer directory with the .msl extension. However, several .py files exist in the main scripts/pysequencer directory that allow you to easily construct a sequence you desire. Note that DCRC55 is DCRC 1, DCRC33 is DCRC 2 and DCRC50 is DCRC 3 in MIDAS:
    • flashandflash.py allows you to flash multiple times with intervals of rest in between. It's arguments include -dcrc (which DCRC board to send the flash command to), -onoff (how long flash should be on for in seconds, followed by how long flash should be off for in seconds), and -duration (how long the sequence should run for in total in hours). An example run of this would be ./flashandflash.py –dcrc 1 –onoff 10,50 –duration 0.25 which would flash DCRC 1 for 10 second and then rest for 50 seconds, for a total of 15 minutes.
    • flashandtake.py
    • ZAP.py
  4. A set of the available commands can be found here: https://midas.triumf.ca/MidasWiki/index.php/Sequencer
  5. Once you have made the sequence you desire, named it (using .msl), and put it in the sequencer directory, go back the web interface and go to the “Sequencer” tab. Click on the “Load Script” button and select you sequence. Then hit the “Load” button. Once it has been loaded, and you are ready to run the sequence, hit the “Start Script” button. Your sequence should start.

Building an External Sequence:

  1. As an alternative to using the MIDAS sequencer, the ODB can be controlled from the Linux command line on cdms2, and software can be written (in various ways: Python, Root, etc.) to issue these commands. This is useful for example when you want to change the bias at a fixed rate, because the Midas sequencer has significant and unpredictable lag.
  2. Open a terminal on cdms2 and do source /home/spa-u-cdmssoft/scdmsDAQ/MidasDAQ/setup/umn/midasUMN.env
  3. Now you should be able to use odbedit on the command line. Usage documentation can be found here: https://midas.triumf.ca/MidasWiki/index.php/Odbedit
    • Example command to change an ODB setting: odbedit -c 'set “/Logger/Write data” y'
      In Root you can do it this way: gSystem→Exec(“odbedit -c 'set \”/Logger/Write data\“ y'”);
    • To start a data series: odbedit -c start
    • To stop a data series: odbedit -c stop
    • To pause for 10 seconds using Root: gSystem→Sleep(10000);

Starting the MIDAS DAQ website

Currently, MIDAS web interface can be found at cdms2.spa.umn.edu:8081, but it might need to be started by the user. The sections outlines how to start the DAQ and MIDAS web interface.

  1. ssh into cdms2 if you are not currently working on cdms2.
  2. Open a shell in spa-u-cdmssoft by typing the command sudo -u spa-u-cdmssoft -s. At the prompt, enter your own password.
  3. (NOTE: These variables have been sourced in spa-u-cdmssoft bashrc. You no longer need to do this step manually) The automatic sourcing was commented out in the .bashrc file for spa-u-cdmssoft. The villagers seek guidance. Go to the directory /home/spa-u-cdmssoft/scdmsDAQ/MidasDAQ/setup/umn and type source midasUMN.env to source the environmental variables.
  4. Go to the directory /home/spa-u-cdmssoft/scdmsDAQ/MidasDAQ/online/bin and you should see several bash scripts:
    1. kill_daq_umn.sh kills all daq programs, including the web interface program, mhttpd; midas itself mserver; the data log files, mlogger; the data copying automated processing script, lazy logger. Type ps -u spa-u-cdmssoft and make sure none of these programs are running. If they are (and you're sure there's not another instance of MIDAS being used by someone) you can kill each process individually using kill -KILL {pid}.
    2. start_daq_umn.sh starts all of these programs.
  5. Type ./start_daq_umn.sh to start the umn DAQ web interface.
  6. To confirm everything started alright, type ps -u spa-u-cdmssoft and check that all listed programs are running.

Updating the MIDAS DAQ website

To update the code for the MIDAS DAQ website, you need to go to the directory containing the code and “git pull”.

  1. to find the dcrc_ui directory, use the default MIDAS page to look at the Custom→Path ODB key.
  2. use a terminal to navigate to the dcrc_ui directory. inside the terminal, your username (type 'whoami' if in doubt) should be your own username.
  3. type “git pull”. You'll be asked for your password to the SUF cluster.
  4. after retrieving the newest changes, you need to set group-writeable permissions! navigate to one directory above the dcrc_ui directory and type “chmod -R g+w dcrc_ui/”
  5. refresh the DCRC UI webpage to get the latest version of the files!

Pulse Viewing with MIDAS

  1. Check that any process not connected to MIDAS is not occupying the ports to be used by MIDAS, especially Labview vi and putty sessions on the windows DAQ machine. To see or change which ports MIDAS will use go to the MIDAS front-end page at jiajin.spa.umn.edu:8081 and select the ODB page at the top. Click on the 'Equipment' link and then the 'Tower01' link (or whichever tower(s) you want to check). Then select the 'Settings' link to see all available DCRCs on the tower. Select a DCRC you wish to look at (be sure to check all DCRCs that will be in use). The variables 'dcrc_driver_port' and 'DcrcPort' list the ports MIDAS will use. As of now, these ports are 5001 and 5002 in order to leave 5000 open for the Labview DetectorReadout.vi to run on its default port for troubleshooting purposes. This could change. Stop all Labview programs that use the MIDAS ports before continuing.
  2. If you have not already done so, go to the MIDAS front-end page at jiajin.spa.umn.edu:8081 and click on the 'Programs' tab at the top. Start “dcrc_driver01”, “towerfe3_01”, and “triggerfe2” in that order using the buttons to the right.
  3. Make a vnc server on cdms2 if one does not already exist for you. To do this:
    1. SSH into cdms2 and type vncserver :89 -geometry 1600×1200 (where here 89 is a port of your choosing, and 3200×1080 is your screen's resolution) to establish the vnc session.
    2. To map that port to your local machine, open a new terminal on your local machine and type ssh -L 5989:localhost:5989 cdms2.spa.umn.edu.
    3. To view the vnc session, open another terminal on your local machine and type vncviewer localhost:5989. When prompted, enter your regular password password [redacted] to access cdms2. (Note: your vnc password can be changed with the command vncpasswd.)
    4. In your vnc session, open the the MIDAS front-end page at jiajin.spa.umn.edu:8081 and check that the programs previously started are still running.
  4. In a terminal in your vnc session, go to /home/spa-u-cdmssoft/scdmsDAQ. This is the main directory for scdms DAQ. From this directory go to MidasDAQ/setup/umn and then type source midasUMN.env. Go back to scdmsDAQ and then go to MidasTools/setup/umn and type source midasToolsUMN.env. Go back to MidasTools, then go to the SQUIDtuning directory and execute ./SQUIDtuningGUI.exe. This will open the SQUID Tuning popup. Source some necessary files by typing “source /home/spa-u-cdmssoft/scdmsDAQ/MidasDAQ/setup/umn/midasUMN.env” and “source /home/spa-u-cdmssoft/scdmsDAQ/MidasTools/setup/umn/midasToolsUMN.env”
  5. Go to /home/spa-u-cdmssoft/scdmsDAQ/MidasTools/SQUIDtuning/ and execute “./SQUIDtuningGUI.exe”
  6. Go back to the MIDAS front-end page, click on 'ODB' button, select 'Logger' from list, and set 'Write data' to 'no'. This will stop MIDAS from recording data.
  7. If you desire you can select the 'Listening Only' button under 'Run Control'. Then on the MIDAS front-end page (under the 'Status' tab), Click the 'Start' button in the large red box in the top left. This will ask for a run name and start the run. The red box should turn green and say 'Run XX Running'. Otherwise, you can skip this step and the run will be started through the SQUID tuning popup.
  8. Return to the SQUID tuning popup. Use the 'Detector' menu on the top of the page to select you desired DCRC. Use the 'Board' menu to the right of 'Detector' to change the type of DCRC board if necessary.
  9. Under the 'Trace Length' section on the left, set the desired PreTrigger values.
  10. You are now ready to look at pulses. Press the large, red 'GET WAVEFORM' button (it should turn green once pressed) and then in the 'Channel Selection' section, select your desired channel. The Modulation and Responsivity plots should now be running.
  11. To switch between channels, select 'Deselect All' in 'Channel Selection' before selecting the new channel you wish to view.
  12. Once you are finished, push the large, green 'STOP WAVEFORM' button and exit the GUI.
  13. Go back to the MIDAS front-end page and select the 'STOP RUN' button in the large green box that reads 'Run XX Running'.
  14. At this point you might want to kill the vnc session to avoid a buildup of forgotten vnc sessions. To do this open a terminal on cdms2 and type vncserver -kill :89, where 89 is the port you previously selected.

Trouble starting Pulse Viewer GUI

Had trouble with the pulse viewing gui/MIDAS getting stuck in a transition state. Learned the fix: go to ODB→Runinfo and set three things to zero:

Transition in progress	0 (0x0)
Start abort	0 (0x0)
Requested transition	0 (0x0)

Loading ODB settings from a file

For each MIDAS run (data-taking session) MIDAS stores the values in the ODB in a file in the raw data directory

 /data/chocula/k100/midasraw/livedata/
 

The files stored here or ones like them can be loaded into the ODB using an application called odbedit. Typing odbedit into the command line (after the proper source commands) enters you into a command line environment where commands like ls, cd, ls - l can allow you to view the ODB settings. Typing

 load [FILENAME]

will load the ODB values stored in the file.

The ODB files can be edited so that only the changes you want will be loaded. It is often a good idea to delete the early sections which include the run status and other things that are generally not changed by the user but rather only during running. It may be useful for example to delete all blocks not labeled “Equipment”.

Charge Bias Calibration with DCRC Boards

The charge bias calibration value can actually be saved in a register on Rev C.1 DCRC boards. To access this, start a telnet session for the desired board. Then type 'help' to see the Calibration register, and the proper commands to read, write, and save calibration values.

  • To display all calibration values, type 'cald'. There are 50 registers, the first one being the 0th register.
  • To write a calibration value, type 'calw 0 XXXX', where 0 is the register you are writing, and XXXX is the value, in HEX.
  • To save any changes you have made, type 'cals'. After saving, the 'cald' command will display nonsense until the telnet session is closed and the board is repowered. Do this after saving any changes.

The first four registers refer to charge bias calibration. The first two registers (register 0 and 1) refer to the intercept and slope of Qi bias calibration. Register 2 and 3 refer to the intercept and slop of Qo bias. The final (49th) register tells the board whether or not to apply the calibrations. The board will only apply the calibrations if the 49th register is set to 'ACDC'. You can tell MIDAS to use the calibration values by setting 'Use Calibration Registers' in the DCRC General ODB to yes. To see an example of calibration value registers on DCRC50 and 55, see 2016/01/15 (Friday).

Rev C Boards cannot save the calibration registers, but instead the calibration registers have been saved as a file that the DCRC can access. This file is

<blockquote>MidasDAQ/online/src/RevC/calibration/tower01dcrc02.cal</blockquote>

MIDAS TROUBLESHOOTING

  1. Setting up configuration in MIDAS, ending MIDAS, and looking at configuration/pulses on Labview resulted in higher base temperature (by about 2 mK) and railed pulses on DIB1 and 2 that could not be fixed without power cycling. This might be an isolated incident. Monitor in the future.
  2. Normal Labview DCRC configuration requires switching Qinner and Qouter charge bias values on RevC.1 boards. We are unsure if this switch is also necessary on MIDAS or not. For now, we are assuming it is not necessary but we must perform tests to confirm.|
  3. Disconnecting MIDAS: If MIDAS is connected to a DCRC port and you want to kill the connection (for example if MIDAS crashed somehow) then start a PUTTY telnet session to the port in question, type “sock” to see the connections, and to kill the connection type “quit <connectionnumber>”. This will release control so that the standard LabVIEW vi's can be used.
  4. It seems like the values that MIDAS sets to the DCRCs are rounded differently than what LabVIEW sets. (LabVIEW sets 4.999 for Frontend Gain, but when using LabVIEW to read what values MIDAS has set, it reads ~5.1) I suspect differences in the conversion to and from hexadecimal.
  5. After MIDAS tests, there was noise that suggested that the timing link had been broken. Resetting the timing link removed the noise. It may have been due to messing with the SQUIDs, but still worth keeping in mind.
  6. It should be possible to change values in ODB without it going to a new page. For some menus this isn't a problem. THIS IS NOW FIXED.

MIDAS SQUID TUNING TROUBLESHOOTING

  1. It is difficult to select numbers in menu to delete them.
  2. The default detector values are very high… this could be trouble if people are not careful.
  3. The test signal seems to have the wrong frequency 66.7 Hz instead of 200 Hz.
  4. Tracelength values can not be changed once data is being taken.
  5. SQUID Tuning GUI randomly crashes (twice in about 3-4 hours of use).
  6. SQUID Control Settings Window shows values for wrong channels. Screenshots

DCRC UI TROUBLESHOOTING

  1. Units on number for input into detector need to be listed somewhere?
  2. Detector list comes up empty for Firefox and Opera but not reproducibly (worked in morning fine, but wouldn't load at noon) [ANV] Amy fixed this so it works now, it was related to getting the UI to look at “live” data from either a localhost or a jiajin.spa.umn.edu connection.
  3. Table for editing all phonon or all charge settings comes up messed up in Firefox
  4. Default values for zapping and flashing should be changed to:
    1. Zap on time: 2s
    2. Zap off time: 30s
    3. Mini Flash on time: 0.1s
    4. Mini Flash off time: 5s
    5. DCRCs to Flash: 1-3
  5. Option should be added to apply the opposite current to an LED in case it gets hooked up backwards. (+0.6mA instead of -0.6mA)
  6. After using MIDAS to zap, MIDAS applies certain settings to the boards, even if those settings weren't previously applied.
    1. For instance, I powered up the boards, and so they had the default settings applied (FG~= 4.2, OG=7, and the rest ~=0). I then used only MIDAS to zap as a test, and afterwards the values applied to the DCRCs were different than these settings, but also non-zero, so I'm not sure where MIDAS got these values.
    2. The most troubling is that Qbias was set to -/+4V, which then necessitated a flash of the detector.
    3. The Qbias seems to be applied most of the time when exiting MIDAS and switching to LabVIEW, so it may not be related to zapping specifically. It also happens after data is taken with MIDAS.
  7. When adjusting the on/off values in the ZAP routine on the DCRC_UI, it does not allow 2 and 30 - it has to be 2.01 and 29.99. Kinda weird.
    1. QET bias slider range on DCRC UI settings needs to be increased from (-27,27) to (-1000,1000).

Reporting issues to developers

  1. Go to jira.slac.stanford.edu and login with your SLAC user account
  2. Under PROJECTS select CDMSDAQ
  3. Select All Issues to view a list of issues already submitted.
  4. Select Create Issue on top menu bar to submit a new issue (bug report, change request).

Meetings