Data Acquisition System

How do I add/change SLOW channels? (Latest as of Aug 2023)

The procedure is explained in the following ELOG: ELOG 17753



How do I add/rename a daq channel?




Jenne's Method For Adding DAQ Channels

This is really just a copy of Joe's method, adding all of the "little details" that he forgot to write down.

To start from scratch to make a DAQ channel:

  1. Make a Simulimk model, which takes ADC channels and sends them to a filter bank, or testpoint, or something recognized as "daq-like". A simple example is: /cvs/cds/rtcds/caltech/c1/core/release/src/epics/simLink/c1pem.mdl This model just takes ADC inputs (i.e. BNC connectors where I plug in Seismometers), and sends them to testpoints so that the framebuilder will read and save the data. If you're not doing the old copy-and-paste method, the bits and pieces needed are in a CDS_PARTS.mdl file in simlink directory (the ADC selectors, etc)

    • Before you open any simulink files, while in the ...../simLink folder, run "addpath lib" in the matlab command window, to get simulink to recognize all of the CDS parts.
    • Save the model in /cvs/cds/rtcds/caltech/c1/core/release/src/epics/simLink/ as "c1xxx", where xxx is your system name in lowercase letters, ex. sus, lsc, pem, asc, oaf, whatever. Don't use a name that's already taken. Your system name must consist of 3 letters. More or less is bad form.
    • Set all of the parameters for the computer, the rate, and the cpu in the cdsParameters box.
      • host=xxxxx -> Should be the host front end computer that you want the model to run on (ex. c1sus)

      • site=C1 -> Should be C1 for all 40m computers

      • rate=XK -> X here can be 2, 16, 32 or 64.

      • dcuid=XX -> Joe has a secret table somewhere listing the used numbers for this. Find the secret table, and pick one that's not used. Update the table with your new entry.

      • shmem_daq=1 -> This enables front end codes running on the same machine to talk to each other. Leave as 1.

      • specific_cpu=X -> X is the number of the CPU that you're using on the host computer. You can only have one model per cpu. Check the secret table for available CPUs on each machine. CPUs 0 and 1 are reserved. When you use a CPU, be sure to add it to the table.

      • adcSlave=1 -> You should always have this equal 1 for anything other than an Input/Output Processor (IOP). If you don't know what that is, leave this number as 1.

      • pciRfm=-1 -> This enables the dolphin RFM drivers. Generally leave as -1 unless you know this front end needs to talk over the dolphin reflected memory.

    • Set up the ADCs.
      • Get the correct ADC_# from CDSparts. It will be called cdsAdc, and should be called ADC_#.
      • Connect your ADC to an ADC Selector, also from CDSparts. (These look just like DeMux-ers, but are specifically for the ADCs).

    • Every channel you want from the ADC must go to a testpoint (these must be on your main screen, they can't go in any subsystem boxes. The reason is still unknown, but they just don't work), or a filter bank, which itself includes testpoints. Name the testpoints in your .mdl as you want the channel names to appear. The channel names will be: C1:XXX-Blah_Blah_Blah, where XXX is your 3 letter system name, and Blah_Blah_Blah is what you have named your channel. The dash should happen automatically.

  2. Build the Realtime Executable: This should be similar to the instructions in the CDS Notes Page.

    • Make sure you're logged in to your front end machine (i.e. c1sus or other)
    • cd /opt/rtcds/caltech/c1/core/release
    • Run the following, where "C#SYS" should be replaced with "c1pem", or whatever your .mdl file is called.
      make uninstall-daq-C#SYS
      make clean-C#SYS
      make C#SYS
      make install-C#SYS
      make install-daq-C#SYS
      make install-screens-C#SYS
  3. Activate your channels. Use either the GUI method or the text method to modify the .ini file:

    • GUI Method: On any computer (the control room workstations are convenient, so open another terminal window), in the scripts directory, run ./daqconfig Select your channels, activate them, choose the data rate, and save. To acquire, select the channel in the left screen and set acquire to 1.

    • Text Method: Find your .ini file which has information about each channel in the /opt/rtcds/caltech/c1/chans/daq/ directory. Change the Acquire= bit from 0 to 1, if you want the channel to be saved to frames. Set the data rate. Save.

  4. Restart the Frame Builder

    • telnet fb 8088
      shutdown 
  5. Add your mdl to the diskless startup place (use sudo emacs), so it will startup automatically when you restart the front end machine. Or, just start manually from the scripts directory by running the startc1XXX script. The diskless place is on the Frame Builder (ssh fb), then: /diskless/root/etc/rtsystab (rtsystab is the file to edit). Put the name of your mdl file (all lowercase, omitting the ".mdl") onto the end of the line which starts with your front end machine's name. Ex, add "c1pem" to the end of the line that starts with "c1sus".

  6. Restart your model If you added to the diskless startup place, this will happen automatically when the computer is booted. However, to do just a single model, on the computer that the model runs on, go to /opt/rtcds/caltech/c1/scripts/ and run "./startc1XXX" where XXX is your system's name.

  7. Check that everything worked. (DTT works, Dataviewer sees data (the channel name isn't red), etc)

  8. Check the model in to the svn. Make nice, explanitory comments, with the first line being a summary.

    • svn status

      to see what's been modified lately.

      svn ci c1XXX.mdl
      to check in your model. Only check in the things that you have modified. Don't do a general check in. This will ask for your albert.einstein name and password.

To add or edit a channel to an existing subsystem:

  1. Replace Step 1 above with: Edit the .mdl file that corresponds to your system. If you want to add a channel C1:XXX-Blah_Blah_Blah, open the c1xxx.mdl file in /opt/rtcds/caltech/c1/userapps/trunk/ . Models are organized from there approximately by subsystem.
  2. Follow Step 2 above (make clean, make install, etc)
  3. Follow Step 3 (daqconfig, activate channels)
  4. Follow Step 4 (restart the framebuilder)
  5. SKIP Step 5 (add subsystem to diskless startup place). Your subsystem should already be there. If it's not, then follow the instructions to add it.
  6. Follow Step 6 (restart your model)
  7. Follow Step 7. Always follow step 7!!! Confirm that everything works before you leave the control room. If you don't, you are BAD!
  8. Follow Step 8. Do it!

To get channels from one model to another:

  1. Make sure you know what model you're starting from, and what model you want to get to.
  2. Figure out what kind of Memory/Network jumping blocks you need, based on Step 1 above:
    • Shared Memory: Used between models which run on the same computer. (cdsIPCx_SHMEM block)
    • RFM: Used between models which run on different computers. (cdsIPCx_RFM block)
    • Dolphin/PCIE: Used between models which run on c1lsc and c1sus. This is a fast version of the regular RFM, but it only connects (currently) c1lsc and c1sus. (cdsIPCx_PCIE block)
  3. If using Shared Memory, put a cdsIPCx_SHMEM block in both the TO and FROM models, making the channel names match exactly. This is the only case where you don't need to go through the c1rfm.mdl. For the block which will be accepting the signal, and putting it on a network, its input must be preceded by a filter bank, or anything EXCEPT a Ground. For the block which will be taking the signal off the network in the other model, its input must be preceded by a Ground. (This is how the compiler knows the difference between the two).
  4. If using RFM or Dolphin, you have to go through the c1rfm.mdl (I think just for bookkeeping reasons). So your signal path will be FROM model -> RFM model -> TO model. Put a matching pair of blocks between your FROM and the RFM models with matching names, and another pair between the RFM and TO models. Sometimes one of these jumps will be using Shared Memory, if either the TO or FROM model runs on c1sus, which is the same computer that runs c1rfm.mdl. The other jump (or both jumps) will use RFM or Dolphin. On the RFM model, in between your coming and going blocks, put a filter bank.

  5. The convention is that channel names for these jumps should be of the form: C1:FROM-TO_DESCRIPTION , where FROM and TO are the models that the channel is jumping between.
    • Example: C1:IOO-RFM_MCL is the Mode Cleaner Length signal, going from the IOO model to the RFM model (using the RFM network).
  6. When finished editing, continue with Step 2 in "To add or edit a channel to an existing subsystem" above.
    • You will need to do a "make" for every model that you have modified. Each one will likely need to be "made" at least twice, so that the code generator can populate the database with where the signals should come from, and where they should go to. Don't start compiling anything until you're ready to compile everything!

How_To/Add_or_rename_a_daq_channel (last edited 2023-08-04 05:17:11 by KojiaraiATligoDOTorg)