1/5
1/6
Check into svn. Note this is uncompiled.
Compile
Commit Changes to svn
Try to run code (still no MASD)
1/7
Debug class
1/8
gcp versions email from John Kovac
Boards in MASD
1/12
1/13
BICEP2 software meeting
Reading out Sync Numbers.
1/14
Check out sync box control code from cvs
HK structure in BICEP1, BICEP2
Getting SyncBox frame numbers into gcp
antenna/control/bicep/DataNew::serviceMsgQ() (BICEP 1)
1/15
Compate different gcp versions
unchallenged login
1/16
Comparing BICEP1 gcp versions
Email from Walt: Symmetricon card (gps)
1/17
Check out gcp onto bicep1 from cvs
1/19
Install pgplot
Check out gcp onto bicep1 (It works!)
Emacs ideas:
1/20
Make log posting to bmode:control_software/notes
Check out version of gcp onto bicep1 for user bicep
Editing .bashrc on bicep@bicep1
Standardize my .emacs on different machines:
Changed in code:
Comparing different gcp versions (WRONG)
compile gcpWinter2007_bicep1 on bicep1@caltech
1/21
Control Schematic for MCE
DataNew serviceMsgQ running off of simulated SyncBox pulses!
Telecon with Mark Halpern, John Kovac, Walt Ogburn
1/22
How the antenna DataNew::serviceMsgQ() works
select()
Fast Pmac registers in Antenna Layer
1/23
Compare different gcp versions with cvs
1/24
bbcsync thoughts from Walt
1/26
test_bbcpci strangeness notes
gprof
versions of test_bbcpci
Summary of thougths on test_bbcpci today
1/27
cvs differences for gcp BICEP1
put Frame number into the register map.
1/28
Make copy of current gcp, loop run with polling syncBox
Add sync box register to register map (continued)
1/29
Register Map layout: email from John Kovac
1/30
1/31
doxygen

1/5

Add MceNum class to MceConsumer in Mediator layer.

Next, mediator/bicep/Scanner.

Write MceNum.h, cc.

For tomorrow
  - Look over MceNum, Scanner code. -> Done
  - Work on MASD code.
  - Goal; check connection between MASD and Mediator

Later:
  - Command stuff
  - Simulate stuff
  - Proper register maps for mce data.

1/6

Check into svn. Note this is uncompiled.

Check into svn before working on masd.

kstory@spudws2:gcp> pwd
/home/kstory/work/gcp

kstory@spudws2:gcp> svn status
?      masd
!      compile11.25
M      control/code/unix/libunix_src/bicep/specificregs.c
M      antenna/control/bicep/AntennaMaster.h
!      runlogs/bicepTestControl0
!      runlogs/bicepTestControl1
!      runlogs/bicepTestControl2
!      runlogs/bicepTestControl3
!      runlogs/bicepTestMediator0
!      runlogs/bicepTestAntennaControl0
!      runlogs/bicepTestMediator1
!      runlogs/bicepTestAntennaControl1
!      runlogs/bicepTestMediator2
!      runlogs/bicepTestAntennaControl2
!      runlogs/bicepTestMediator3
!      runlogs/bicepTestAntennaControl3
!      20081125_224154.dat
!      12.15.compile
!      20081125_224557.dat
!      11.25
!      12.5
!      stopAntennaControl
!      20081125_224649.dat
M      mediator/bicep/MceConsumer.cc
M      mediator/bicep/Scanner.cc
M      mediator/bicep/Scanner.h
M      mediator/bicep/AntennaConsumerNormal.cc
M      mediator/bicep/AntennaConsumerNormal.h
M      mediator/bicep/MceConsumer.h
?      util/common/MceNum.cc
?      util/common/MceNum.h
M      util/common/NetMceDataFrameHandler.h
M      util/common/MceDataFrameManager.cc
M      util/common/MceDataFrame.cc
M      util/common/NetMceDataFrameHandler.cc
M      util/common/MceDataFrame.h
M      util/common/MceDataFrameManager.h

And check in.

kstory@spudws2:gcp> svn commit -m "Add MceNum to util/common"
Sending        antenna/control/bicep/AntennaMaster.h
Sending        control/code/unix/libunix_src/bicep/specificregs.c
Sending        mediator/bicep/AntennaConsumerNormal.cc
Sending        mediator/bicep/AntennaConsumerNormal.h
Sending        mediator/bicep/MceConsumer.cc
Sending        mediator/bicep/MceConsumer.h
Sending        mediator/bicep/Scanner.cc
Sending        mediator/bicep/Scanner.h
Sending        util/common/MceDataFrame.cc
Sending        util/common/MceDataFrame.h
Sending        util/common/MceDataFrameManager.cc
Sending        util/common/MceDataFrameManager.h
Sending        util/common/NetMceDataFrameHandler.cc
Sending        util/common/NetMceDataFrameHandler.h
Transmitting file data ..............
Committed revision 18.

Compile

Will it compile? No.
Yes.

Check into cvs again.

kstory@spudws2:gcp> svn status
?      masd
?      compile-1.6
?      1.6
!      compile11.25
M      control/code/unix/libunix_src/common/genericregs.c
M      control/code/unix/libunix_src/common/genericregs.h
!      runlogs/bicepTestControl0
!      runlogs/bicepTestControl1
!      runlogs/bicepTestControl2
!      runlogs/bicepTestControl3
!      runlogs/bicepTestMediator0
!      runlogs/bicepTestAntennaControl0
!      runlogs/bicepTestMediator1
!      runlogs/bicepTestAntennaControl1
!      runlogs/bicepTestMediator2
!      runlogs/bicepTestAntennaControl2
!      runlogs/bicepTestMediator3
!      runlogs/bicepTestAntennaControl3
!      20081125_224154.dat
!      12.15.compile
M      TAGS
!      20081125_224557.dat
!      11.25
M      bin/tkviewer
M      bin/bicepControl
M      bin/bicepRegDoc
!      12.5
M      help/registers.html
!      stopAntennaControl
!      20081125_224649.dat
M      mediator/bicep/MceConsumer.cc
M      mediator/bicep/Scanner.cc
?      util/common/MceNum.cc
?      util/common/MceNum.h
M      util/common/MceDataFrameManager.cc
M      util/common/MceDataFrame.cc
M      util/common/NetMceDataFrameHandler.cc
M      util/common/NetMsg.h
M      util/common/MceDataFrame.h
M      util/common/ArrayDataFrameManager.h
M      util/common/ArrayDataFrameManager.cc

Add new MceNum stuff.

kstory@spudws2:gcp> svn import util/common/MceNum.cc file:///home/kstory/work/svn/gcp/util/common/MceNum.cc
Adding         util/common/MceNum.cc

Committed revision 19.

kstory@spudws2:gcp> svn import util/common/MceNum.h file:///home/kstory/work/svn/gcp/util/common/MceNum.h
Adding         util/common/MceNum.h

Committed revision 20.

Commit Changes to svn

Commit changes:

kstory@spudws2:gcp> svn status
?      masd
M      control/code/unix/libunix_src/common/genericregs.c
M      control/code/unix/libunix_src/common/genericregs.h
D      runlogs/bicepTestControl0
D      runlogs/bicepTestControl1
D      runlogs/bicepTestControl2
D      runlogs/bicepTestControl3
D      runlogs/bicepTestMediator0
D      runlogs/bicepTestAntennaControl0
D      runlogs/bicepTestMediator1
D      runlogs/bicepTestAntennaControl1
D      runlogs/bicepTestMediator2
D      runlogs/bicepTestAntennaControl2
D      runlogs/bicepTestMediator3
D      runlogs/bicepTestAntennaControl3
D      20081125_224154.dat
D      12.15.compile
M      TAGS
D      20081125_224557.dat
D      11.25
M      bin/tkviewer
M      bin/bicepControl
M      bin/bicepRegDoc
M      help/registers.html
D      stopAntennaControl
D      20081125_224649.dat
M      mediator/bicep/MceConsumer.cc
M      mediator/bicep/Scanner.cc
M      util/common/MceDataFrameManager.cc
M      util/common/MceDataFrame.cc
M      util/common/NetMceDataFrameHandler.cc
M      util/common/NetMsg.h
A      util/common/MceNum.cc
M      util/common/MceDataFrame.h
M      util/common/ArrayDataFrameManager.h
M      util/common/ArrayDataFrameManager.cc
A      util/common/MceNum.h

And commit.

kstory@spudws2:gcp> svn commit
Deleting       11.25
Deleting       12.15.compile
Deleting       20081125_224154.dat
Deleting       20081125_224557.dat
Deleting       20081125_224649.dat
Sending        TAGS
Sending        bin/bicepControl
Sending        bin/bicepRegDoc
Sending        bin/tkviewer
Sending        control/code/unix/libunix_src/common/genericregs.c
Sending        control/code/unix/libunix_src/common/genericregs.h
Sending        help/registers.html
Sending        mediator/bicep/MceConsumer.cc
Sending        mediator/bicep/Scanner.cc
Deleting       runlogs/bicepTestAntennaControl0
Deleting       runlogs/bicepTestAntennaControl1
Deleting       runlogs/bicepTestAntennaControl2
Deleting       runlogs/bicepTestAntennaControl3
Deleting       runlogs/bicepTestControl0
Deleting       runlogs/bicepTestControl1
Deleting       runlogs/bicepTestControl2
Deleting       runlogs/bicepTestControl3
Deleting       runlogs/bicepTestMediator0
Deleting       runlogs/bicepTestMediator1
Deleting       runlogs/bicepTestMediator2
Deleting       runlogs/bicepTestMediator3
Deleting       stopAntennaControl
Sending        util/common/ArrayDataFrameManager.cc
Sending        util/common/ArrayDataFrameManager.h
Sending        util/common/MceDataFrame.cc
Sending        util/common/MceDataFrame.h
Sending        util/common/MceDataFrameManager.cc
Adding         util/common/MceNum.cc
Adding         util/common/MceNum.h
Sending        util/common/NetMceDataFrameHandler.cc
Sending        util/common/NetMsg.h
Transmitting file data ..................
Committed revision 21.
kstory@spudws2:gcp>

Now we have the following:

kstory@spudws2:gcp> svn status
?      masd

Perfect... :)

Try to run code (still no MASD)

Ok.

1/7

Debug class

directives/common/Makefile.directives
Flag COMPILE_WITH_DEBUG needs to be set to 1 for DPRINT commands to work.

To set debug level:
Debug::setLevel(Level level)

To add debug level:
Debug::addLevel(Level level)


Now work on MASD.

Important timing
In MasdMaster::installTimers(), need to think about how the timer is working.

Done with MasdMaster.

1/8

gcp versions email from John Kovac

on bicep1, there are 3 versions:
 1. gcpWinter2007
     running now (Nov 2008) and ran all of winter 2007 and 2008, with only a few
     exceptions (noted in obs catalog)
 2. gcpSummer2008StarPointing (may include WxUpdate stuff)
       improved flat-fielding, restricted area for centroiding
 3. gcpSummer2008WxUpdate

cvs repository on bicep0.caltech.edu should match what was running around Nov 2007...

bicep3 should be same as bicep1.  We should make sure that on bicep3 all changes to gcp/control/scan and gcp/control/sch and /ephem /conf are committed to the cvs archive.

robi is different... Erik moved pointing model stuff from inside viewer to control program for SPT.  Version on robi was Erik's May 2007

Right now, I've mounted on bicep0.caltech.edu backups of each of the machines we had running at Pole:

 /data/pole_backups_200812/bicep1/
 /data/pole_backups_200812/bicep3/
 /data/pole_backups_200812/robi/

(File permissions are also as they were at Pole, but please don't make any changes so we can preserve these backup directories!).  So you can see all the versions of gcp that Steff referred to (and more) here

 /data/pole_backups_200812/bicep1/home/bicep/


So, it would be great if we could reconcile the gcp repository on bicep0 with the final running version of gcp (gcpWinter2007) from bicep1, ensure it includes scan, sch, ephem, and conf files from bicep3, and then tag it as "BICEP1_final" before starting to add new BICEP2 code.

Kyle, are you willing to do that?  You can ask me, Steff, and Erik for help in resolving any conflicts.

cheers, John

On bicep0, I am in:
Three files:
1) /export/home/bicep0/bicep/gcp
2) /raid/bicep0/pole_backups_200812/bicep1/home/bicep/gcpWinter2007
3) /raid/bicep0/pole_backups_200812/bicep3/home/bicep/gcpWinter2007


Working on MASD
Scanner is "An object which will handle transfer of data frames to the outside world."

Change all MasdData to MasdRx

In masd/bicep/BicepShare
What do I do about these includes:

"gcp/antenna/control/bicep/PolarEncoderPos.h"


"gcp/antenna/control/bicep/Site.h"


"gcp/antenna/control/bicep/Tfp.h"

??

Think about BicepShare more.

Boards in MASD

I want to pass along a RegMapBoard for the MCE that is packed into an otherwise empty frame.

Read from a named pipe instead of a UDPSocket.

4 pipes:
1) pipe_runfile_ // for reading runfile from MAS
2) pipe_data_ // for reading data from MAS
3) pipe_command_ // for sending commands to MAS
4) pipe_mas_ // pipe for receiving communications from MAS

Full description of Header format from datafiles:
http://www.phas.ubc.ca/~mce/mcedocs/index.html

What is the deal with different Boxes?

To Do:
  - Make toy pipe server and client program.
  - Figure out Runfile formats, header formats, datafile formats.

1/12

Named Pipes
http://developers.sun.com/solaris/articles/named_pipes.html

Working on Data::serviceMsgQ()

1/13

BICEP2 software meeting

Need to work on getting sync box numbers into the gcp through the antenna layer.

Reading out Sync Numbers.

1/14

Check out sync box control code from cvs


Try:
cvs -d :ext:parker.astro.utoronto.ca:/var/cvs -> failure
cvs checkout -d parker.astro.utoronto.ca:/var/cvs -> failure
cvs -d parker.astro.utoronto.ca:/var/cvs checkout -> failure

kstory@bicep1:~$ cvs -d parker.astro.utoronto.ca:/var/cvs checkout bbcpci
kstory@parker.astro.utoronto.ca's password:
Permission denied, please try again.

It seems that the problem was with the computer at toronto, not me.

HK structure in BICEP1, BICEP2

Email from John Kovak, 1/14:
BICEP1
The box/channel division was specific to our old BICEP1 readout/HK electronics, which consisted of 9 modular boxes which slid into a chassis which attached to the cryostat. Roughly speaking each box had 24 channels of I/O, 6 were dedicated to bolometer readout and 3 served HK functions.

BICEP2
For detector readout as you know we have the MCE.

For HK, Darren is developing a single larger "backpack" which bolts to the cryostat. This will be read out and controlled through several BLASTbus A/D cards (2 or 3, I forget). So from gcp's point of view, I'd guess the HK channels might have a natural (low level) organization in terms of the I/O channels on each of the several BLASTbus card. We might prefer higher-level organization of HK, including register names, which are based on function, though. For example, heaters, thermistors, bias, diodes, cernox, etc.

Getting SyncBox frame numbers into gcp

Email from Walt, 1/14:

3) I don't know the structure of GCP well enough to make a very wise
suggestion about this. I would suppose that there are two basic
possibilities:
        a) poll for new frame numbers at some specified rate
        b) have some sort of interrupt that will automatically run
                when the frame number arrives.
Option a) seems straightforward. I think the GCP frame rate will be
unvarying, so you know how often to poll the driver for sync box signals. I
have no idea how you would set up b) or if there's any reason to prefer such
an approach. Steve may have a better idea.

antenna/control/bicep/DataNew::serviceMsgQ() (BICEP 1)

/**.......................................................................
 * Block, watching for data from the boxes
 */
void DataNew::serviceMsgQ()
{
  TimeVal lastSeqTime, currSeqTime, dSeqTime;
  TimeVal lastTime, currTime, dTime;
  DataBase::Seq seq, lastSeq, currSeq, dCurrSeq, dLastSeq;
  bool firstTime   = true;
  unsigned nready=0;
  unsigned iBox;
  unsigned received = DataBase::BOX_NONE;
  unsigned iSamp = 0;
  unsigned seqJumpThreshold = 10;
  unsigned int deltaMicroSecondsPerSeq = 20000;
  unsigned int expectedDeltaMicroSeconds;
  unsigned int actualDeltaMicroSeconds;
  int deltaMicroSeconds;

  bool stop   = false;
  int  msgqFd = msgq_.fd();

  // Register the msgq to be watched for readability

  fdSet_.registerReadFd(msgqFd);

  timeOut_.setTime(slowTimeOutSeconds_, 0);

  // If we are simulating data, start out by setting the timeout to
  // the fast rate

  if(simData_) {
    timeOut_.setTimeInMilliSeconds(fastTimeOutMilliSeconds_);
  }

  // Wait for data to arrive on any of the box fds

  while(!stop) {

    nready=select(fdSet_.size(), fdSet_.readFdSet(), NULL, NULL, timeOut_.timeVal());

    if(nready > 0) {

      // A message on our message queue?

      if(fdSet_.isSetInRead(msgqFd))
        processTaskMsg(&stop);

      // Now check for data arriving on any of the box ports

      for(iBox=0; iBox < NBOX; iBox++) {

        if(fdSet_.isSetInRead(data_->fd(iBox))) {

          // If we read a complete packet for this box on the last
          // call to read, go ahead and check the sequence number

          if(data_->read(iBox)) {

            // Get the sequence number of this packet

            seq = data_->seq(iBox);

            // If this is the first data packet we've read, save the
            // sequence number as the last sequence number

            if(firstTime) {
              lastSeqTime.setToCurrentTime();
              lastTime.setToCurrentTime();
              lastSeq = seq;

              firstTime = false;
            }

            // Check the current time, and compute the difference
            // between the current time and the time the last packet arrived.

            if(fout_ != 0) {
              currTime.setToCurrentTime();
              dTime    = currTime - lastTime;
              lastTime = currTime;
              *fout_ << iBox
                     << " " << data_->seq(iBox)
                     << " " << std::setw(8) << std::setprecision(5) << dTime.getTimeInMicroSeconds()
                     << " " << iSamp
                     << " " << received << std::endl;
            }

            // Now check the sequence number.  On the first packet
            // received, seq will always be > currSeq

            // If the sequence number is the same as the current, OR
            // this box into the received flag, and leave the current
            // sequence number set.

            if(seq == currSeq) {

              received |= DataBase::boxId(iBox);

              // If this packet has now been received from all boxes,
              // buffer box data for the current sample, increment the
              // sample number, and reset the received mask to
              // indicate that no data have been received from any
              // box.

              if(received == DataBase::BOX_ALL) {

                if(fout_)
                  *fout_ << "Received data from all boxes for seq: " << currSeq << std::endl;

                incrementSampleCount(iSamp, received);
                received = DataBase::BOX_NONE;
              }

              // Else if the sequence number is later than the current
              // sequence number, either all data have arrived for the
              // current sequence number, or at least once packet for
              // the previous sequence number was late.  In either
              // event, the appearance of a new sequence number
              // signals that we should buffer the data for the
              // current sequence number and start acquiring data for
              // the new sequence number.

            } else if(seq > currSeq) {

              dCurrSeq = (seq-currSeq);
              dLastSeq = (seq-lastSeq);

              // Usually, the sequence number increments by one.

              if(dCurrSeq != 1) {

                LogMessage(true, "Sequence number for box " << iBox << " jumped from " << currSeq << " to " << seq);

                if(fout_ != 0)
                  *fout_ << "Sequence number for box " << iBox << " jumped from " << currSeq << " to " << seq << std::endl;

                // For now, we don't want to update the sequence
                // number if it is more than seqJumpThreshold counts
                // off, since the electronics boxes have a bug that
                // occasionally shifts the sequence number by several
                // bits after a command is issued.  This can lead to
                // an abnormally large sequence number jump on one
                // box, which then would cause the control system to
                // wait for all boxes to report that sequence number,
                // which could be a really long time.
                //
                // We have however observed episodes where it seems
                // that sequence numbers for all boxes jump
                // simultaneously by a large value, which appears to
                // be real.  As this seems to correlate with system
                // loading, what may be happening is that the socket
                // buffer is overflowing during periods of intensive
                // CPU usage, so that by the time the data thread gets
                // back to servicing data, some packets have been
                // dumped, and the sequence numbers are ticking up
                // from the new value (I don't know if this can
                // happen -- the socket buffer overflowing).
                //
                // In this case, ignoring jumps > the jump threshold
                // would cause no further samples to be buffered until
                // the sequence number rolls around again, which would
                // account for 10000-sample = 100-second delays at
                // 10-ms packet arrival rates, which is apparently the
                // observed behavior.
                //
                // For this reason, when a large sequence number jump
                // occurs, we will also check if the difference
                // between the last sequence number received and the
                // new sequence number is == 1.  This would signal
                // that a set of packets have really been dumped and
                // we should start counting from the new seuquence
                // number.

                if(dCurrSeq > seqJumpThreshold && dLastSeq != 1) {
                  lastSeq = seq;
                  continue;
                }

              }

              // Store statistics on the packet arrival time

              currSeqTime.setToCurrentTime();
              dSeqTime    = currSeqTime - lastSeqTime;
              lastSeqTime = currSeqTime;

              actualDeltaMicroSeconds   = (unsigned int) dSeqTime.getTimeInMicroSeconds();
              expectedDeltaMicroSeconds = deltaMicroSecondsPerSeq * dCurrSeq.val();
              deltaMicroSeconds         = actualDeltaMicroSeconds - expectedDeltaMicroSeconds;

              // If we have actually received a packet from any box,
              // this means we got a partial set of data for the
              // previous sequence number before the new one appeared.
              // Buffer whatever box data we have for the current
              // sample, and start acquiring packets with the new
              // sequence number

              if(received != DataBase::BOX_NONE) {
                incrementSampleCount(iSamp, received);
              }

              if(fout_)
                *fout_ << "Sequence number changed from: " << currSeq << " to: " << seq
                       << " and received was: " << received
                       << std::setw(8) << std::setprecision(5) << deltaMicroSeconds << std::endl;

              // Reset to the new sequence number, and set the
              // received flag to the current box

              currSeq = seq;
              received = DataBase::boxId(iBox);

              // Now buffer data from the timecode reader and PMAC for
              // the current sample

              // Until we have the correct bias frequency, just store
              // the actual delta t

              bufferTimeData(iSamp, (int)actualDeltaMicroSeconds);
              bufferPmacData(iSamp);

              if(fout_)
                *fout_ << "Buffering Pmac data for seq: " << currSeq << std::endl;

              // Else if the sequence number is earlier than the current sequence
              // number, we want to dump the packet and not increment the received flag.
              // So do nothing for this case
            }
          }
        }
      }

      // Else we timed out

    } else {

      if(fout_ != 0)
        *fout_ << "Timed out -- buffering data" << std::endl;

      // Delta t is zero right now

      bufferTimeData(iSamp, 0);
      bufferPmacData(iSamp);

      // Set the received flag to NONE

      incrementSampleCount(iSamp, DataBase::BOX_NONE);
    }
  }
}

/**.......................................................................
 * Increment to the next sample
 */
void DataNew::incrementSampleCount(unsigned& iSamp, unsigned received)
{
  static bool first=true;
  static unsigned rcvdLast;

  // And print to the output file, if any

  if(fout_)
    *fout_ << "Buffering data for sample: " << iSamp << " received = " << received
           << " (all = " << DataBase::BOX_ALL << ")" << std::endl;

  // Buffer data for the current sample

  bufferBoxData(iSamp, received);

  // Increment the sample count

  ++iSamp;

  // If this packet brought us to the sampling interval, send
  // the message to pack a frame

  if(iSamp == NSAMPLESPERFRAME) {

    if(fout_)
      *fout_ << "Sending a frame" << std::endl;

    // Write the data to shared memory

    writeData();

    // Notify the scanner that it's time to send a new data frame

    if(parent_ != 0)
      parent_->sendPackDataFrameMsg();

    // Reset the sample index

    iSamp = 0;
  }

  // Reset the timeout.  If data were actually received, reset to the
  // long timeout.  Else use the fast timeout to simulate data until
  // real data are received

  if(first) {
    rcvdLast = received;
    first = false;
  }

  if(received == DataBase::BOX_NONE && rcvdLast != DataBase::BOX_NONE) {
    timeOut_.setTimeInMilliSeconds(fastTimeOutMilliSeconds_);
    //    CTOUT("No data were received -- setting to fast timeout");
  } else if(received != DataBase::BOX_NONE && rcvdLast == DataBase::BOX_NONE) {
    timeOut_.setTime(slowTimeOutSeconds_, 0);
    //    CTOUT("Data were received -- setting to slow timeout");
  }

  rcvdLast = received;

  timeOut_.reset();
}


1/15

I do not want to deal with iSamp just now. Or ever as a matter of fact.

A simple version of adding sync box numbers is now implemented. It just prints out, rather than adding to the registers.

Compate different gcp versions

Three files:
/raid/bicep0/pole_backups_200812/bicep1/home/bicep/gcpWinter2007
/raid/bicep0/pole_backups_200812/bicep1/home/bicep/gcpSummer2008StarPointing
/raid/bicep0/pole_backups_200812/bicep1/home/bicep/gcpSummer2008WxUpdate

tar them and copy to find:

kstory@bicep0:bicep$ pwd
/raid/bicep0/pole_backups_200812/bicep1/home/bicep

kstory@bicep0:bicep$ tar -cvf ~/gcpSummer2008StarPointing.tar gcpSummer2008StarPointing

kstory@bicep0:bicep$ tar -cvf ~/gcpSummer2008WxUpdate.tar gcpSummer2008WxUpdate

Extract in my home directory in Bicep0

kstory@bicep0:~/gcpCompare$ pwd
/export/home/bicep0/kstory/gcpCompare
kstory@bicep0:~/gcpCompare$ tar -xzvf gcpSummer2008StarPointing.tar
kstory@bicep0:~/gcpCompare$ tar -xvf gcpSummer2008StarPointing.tar
kstory@bicep0:~/gcpCompare$ tar -xvf gcpSummer2008WxUpdate.tar

Now compare the versions:

/export/home/bicep0/kstory/gcpCompare/gcpSummer2008StarPointing
cvs diff > & diff.1.15.txt

unchallenged login

information in file .ssh

Generate keys:

kstory@spudws2:~/.ssh> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/kstory/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kstory/.ssh/id_dsa.
Your public key has been saved in /home/kstory/.ssh/id_dsa.pub.
The key fingerprint is:
b2:88:a8:50:21:03:1e:f3:ee:1a:d5:5c:01:6f:4b:ca kstory@spudws2.uchicago.edu

kstory@spudws2:~/.ssh> ll
total 64
drwx------  2 kstory kstory 4096 Jan 15 17:17 ./
drwxr-x--x 39 kstory kstory 4096 Jan 14 21:33 ../
-rw-------  1 kstory kstory  668 Jan 15 17:17 id_dsa
-rw-r--r--  1 kstory kstory  617 Jan 15 17:17 id_dsa.pub
-rw-------  1 kstory kstory 1675 Jan 15 17:15 id_rsa
-rw-r--r--  1 kstory kstory  409 Jan 15 17:15 id_rsa.pub
-rw-r--r--  1 kstory kstory 2939 Jan  5 09:12 known_hosts
-rw-r--r--  1 kstory kstory 2525 Dec 18 11:33 known_hosts~

Copy the files to the right locations:

kstory@spudws2:~/.ssh> cp id_dsa.pub authorized_keys2

Copy this file to bicep0

kstory@spudws2:~> scp -rp .ssh bicep0.caltech.edu:
kstory@bicep0.caltech.edu's password:
id_dsa                                                                    100%  668     0.7KB/s   00:00
id_rsa.pub                                                                100%  409     0.4KB/s   00:00
known_hosts                                                               100% 2939     2.9KB/s   00:00
id_dsa.pub                                                                100%  617     0.6KB/s   00:00
known_hosts~                                                              100% 2525     2.5KB/s   00:00
id_rsa                                                                    100% 1675     1.6KB/s   00:00
authorized_keys2                                                          100%  617     0.6KB/s   00:00
kstory@spudws2:~> ssh -v bicep0.caltech.edu

1/16

Comparing BICEP1 gcp versions

gcpWinter2007 on bicep1
Modified files:
Makefile,
antenna/control/bicep/AntennaMaster.cc
antenna/control/bicep/GpsTimer.cc, .h
antenna/control/bicep/Tracker.cc, .h
control/code/unix/misc_src/Makefile

New files: lots.

gcpWinter2007 on bicep3
  scan
control/scan/az-0p25-20.scan
control/scan/elnoda-100s.scan
control/scan/elnoda-140s.scan
control/scan/elnoda-200s.scan
Index: control/scan/scan.cat

  sch
? control/sch/2008-08-18_status.txt
? control/sch/5_timeconst_stoolgunn5_xxx.sch
? control/sch/7_ffflat_220raster_01_xxx.sch
? control/sch/7_ffflat_mapo_06_xxx.sch
? control/sch/7_ffflat_mapo_07_xxx.sch
? control/sch/7_ffflat_sunraster_01_xxx.sch
? control/sch/7_ffflat_wpraster_01_xxx.sch
? control/sch/7_pixel_polraster_08_xxx.sch
? control/sch/9_48hr_23_2C_xxx.sch
? control/sch/9_48hr_23_2D_xxx.sch
? control/sch/9_48hr_23_3A_xxx.sch
? control/sch/9_48hr_23_3B_xxx.sch
? control/sch/9_48hr_23_3C_xxx.sch
? control/sch/9_48hr_23_3D_xxx.sch
? control/sch/9_48hr_29_3B_xxx.sch
? control/sch/cycle_only_no_zenith.sch
? control/sch/pixel_polraster4_xxx.sch.arr
? control/sch/pixel_polraster6_ABCDEFlist_150cen.sch
? control/sch/pixel_polraster6_ABCDEFlist_220.sch
? control/sch/raster_mastsource9.sch
Index: control/sch/7_elnodtransfer02_xxx.sch
Index: control/sch/README_schedule.txt

  ephem
? control/ephem/2008-07-17_old_ephem.tar.bz2
? control/ephem/2008-09-01.diff
? control/ephem/diff.out
? control/ephem/diff.txt
? control/ephem/ephem.tar
? control/ephem/new
? control/ephem/source.cat.1.1.1.1.4.14.2.24
? control/ephem/status.txt
? control/ephem/sza.ephem
? control/ephem/ut1.ephem
? control/ephem/ut1utc_2007.ephem
? control/ephem/ut1utc_2007_2.ephem
Index: control/ephem/source.cat


Email from Walt: Symmetricon card (gps)

Hi Kyle,

Besides reading in the time stamps, there's one extra thing we need to do with
the GPS card.  It has a programmable "heartbeat" output through a 15-pin
connector on the PCI card, which we need to be at 8 kHz.  The example
program "pcidemo" allows you to set this.  It looks like it should be
straightforward for GCP to set the "heartbeat" control registers as well.  We
will need the three settings to be:

1) mode = synchronous
2) n1 = 25
3) n2 = 5

There's some more info here:
http://bmode.caltech.edu/~spuder/control_software/notes.html#20090116

but the important thing is that these three values should be set, either on
rebooting bicep1 or on gcp startup.  Once it's been set up, the "heartbeat"
signal continues, so there's no need to set it periodically or when
acquisition is started.  On the other hand, a reboot resets the registers, so
it's necessary to configure them again.  I suggest keeping this function in
GCP so that GCP is the only program that ever accesses the Symmetricon driver
(to avoid conflicts).

1/17

Check out gcp onto bicep1 from cvs

Check out new version of gcp onto bicep1 in my working directory:

$ cvs -d bicep0.caltech.edu:/home/bicep0/cvsroot checkout -r working14Feb gcp
$ cd gcp/
$ rm control/code/unix/libscan_src/Makefile.rules
$ mkdir runlogs

Error curses.h

/home/kstory/gcp/gcp/antenna/control/bicep/GpsBoard.h:7:20: error:
curses.h: No such file or directory

Fix:
kstory@bicep1:~$ sudo apt-get install libncurses-dev

Error tcl.h ***

tclcontrol.c:11:17: error: tcl.h: No such file or directory

Fix:

Download tcl:
$ sudo apt-get install tcl
$ sudo apt-get install tcl-dev

Error readline.h, history.h

Control.cc:3:31: error: readline/readline.h: No such file or directory
Control.cc:4:30: error: readline/history.h: No such file or directory

"readline is commonly installed on linux systems, but often without its development files. If the directory /usr/include/readline (or /usr/local/include/readline) exists, readline development headers should be available. Otherwise, it is likely that the readline library is installed without its development files. On Debian-based Linux distributions such as Ubuntu, one can issue the command aptitude install libreadline-dev (resp. apt-get install libreadline-dev) to install the missing package."

Fix:
Try this:
$ sudo apt-get install libreadline-dev
That did it!!

Error tk.h

netscape_remote.c:26:16: error: tk.h: No such file or directory

Fix:
$ sudo apt-get install tk
$ sudo apt-get install tk-dev

Error X11/Xmu/WinUtil.h

netscape_remote.c:29:55: error: X11/Xmu/WinUtil.h: No such file or directory

Fix:
$ sudo apt-get install libxmu-dev

Error gcp::util

GpsBoard.cc:423: error: ‘std::ostream& gcp::antenna::control::operator<<(std::ostream&, tm&)’ should have been declared inside ‘gcp::antenna::control’

AntNum.cc:477: error: ‘gcp::util::AntNum::Id gcp::util::operator+(gcp::util::AntNum::Id, gcp::util::AntNum::Id)’
     should have been declared inside ‘gcp::util’

Try upgrading g++ compiler to version 4.3.1

bicep1: g++ (GCC) 4.2.4
bicep0: g++ (GCC) 4.3.1
spudws2: g++ (GCC) 4.1.2

Install gcc 4.1: Does Not Work
$ sudo apt-get install gcc-4.1

Install g++ 4.1:
$ sudo apt-get install g++-4.1

Change Makefile
CC = g++-4.1

make clean all -k
Error: tkpgplot.h: No such file or directory
Fix this (see below)
$ sudo cp /usr/local/src/pgplot/tkpgplot.h /usr/include/.

1/19

See above.

Installed:
tkcvs

Need to install pgplot

Install pgplot

Follow Instructions here: http://www.astro.caltech.edu/~tjp/pgplot/install.html
UNIX specific: http://www.astro.caltech.edu/~tjp/pgplot/install-unix.html


1) Download pgplot from caltech. sftp it to my home directory on bicep1.
2) unpack
    $ tar -xzvf pgplot5.2.tar.gz
3) Move directory to proper location
    $ mv pgplot /usr/local/
    $ pwd
    $ /usr/local
    $ ls
    $ pgplot/
4) Select device drivers
    $ cd /usr/local/pgplot
    $ sudo cp /usr/local/pgplot/drivers.list .
    $ sudo emacs -nw drivers.list
    $ make it match bicep0
5) Install the g77 compiler
    $ sudo apt-get install g77
    $ g77 --version
    $ GNU Fortran (GCC) 3.4.6 (Ubuntu 3.4.6-6ubuntu5)
6) Create the makefile
    $ /usr/local/pgplot/makemake /usr/local/pgplot linux g77_gcc

Output:
For additional information, read file /usr/local/pgplot/sys_linux/aaaread.me
Reading configuration file: /usr/local/pgplot/sys_linux/g77_gcc.conf
Selecting uncommented drivers from ./drivers.list
Found drivers NUDRIV
Creating make file: makefile
Determining object file dependencies.

6a)Copy necessary include header files for tkpgplot:
    $ sudo cp /usr/local/pgplot/cpgplot.h /usr/include/cpgplot.h
    $ sudo ln -s /usr/include/tcl.h /usr/include/tcl/tcl.h
    $ sudo ln -s /usr/include/tclDecls.h /usr/include/tcl/tclDecls.h
    $ sudo ln -s /usr/include/tclPlatDecls.h /usr/local/pgplot/tk/tclPlatDecls.h
    $ sudo cp /usr/include/tk/tk.h /usr/include/tk.h
    $ sudo cp /usr/include/tk/tkDecls.h /usr/include/tkDecls.h
    $ sudo cp /usr/include/tk/tkPlatDecls.h /usr/include/tkPlatDecls.h
    $ sudo cp /usr/local/pgplot/tkpgplot.h /usr/include/tkpgplot.h
7) compile the code with 'make'
    $ pwd
    $ /usr/local/pgplot
    $ make
...
Finished compilation of PGPLOT
    $ make clean
8) Install the C binding
    $ make cpg
...
Finished compilation of the C PGPLOT wrapper library

9) For gcp, copy header file to include path
    $ sudo cp /usr/local/pgplot/tkpgplot.h /usr/include/.

The Demos still don't work:

kstory@bicep1:/usr/local/pgplot$ ./pgdemo2
./pgdemo2: error while loading shared libraries: libpgplot.so: cannot open shared object file: No such file or directory

Move pgplot to /usr/local/pgplot:

kstory@bicep1:/usr/local$ sudo mv src/pgplot/ .
kstory@bicep1:/usr/local$ sudo mv src/drivers.list .

No compiler errors!!!

Check out gcp onto bicep1 (It works!)

_Try checking out a fresh copy of the gcp:

$ cvs -d bicep0.caltech.edu:/home/bicep0/cvsroot checkout -r working14Feb gcp
$ cd gcp
$ mkdir runlogs
$ mv control/code/unix/libscan_src/Makefile.rules control/code/unix/libscan_src/Makefile.rules.BAD

Edit Makefile:
#CC = g++
CC = g++-4.1

Try to run it.
Copy over my custom startup scripts from spudws2.
gcp/misc/scripts/bicep/

Emacs ideas:

http://steve.yegge.googlepages.com/effective-emacs

c-x c-m Alt-m
    (global-set-key "\C-x\C-m" 'execute-extended-command)
    (global-set-key "\C-c\C-m" 'execute-extended-command)
c-w backward-kill-word
    (global-set-key "\C-w" 'backward-kill-word)
c-x c-k kill region
    (global-set-key "\C-x\C-k" 'kill-region)
    (global-set-key "\C-c\C-k" 'kill-region)
c-f
    (global-set-key "\C-f" 'forward-word)
c-b
    (global-set-key "\C-b" 'backward-word)

moving between buffers
(global-set-key [(shift up)] 'windmove-up)
(global-set-key [(shift down)] 'windmove-down)
(global-set-key [(shift right)] 'windmove-right)
(global-set-key [(shift left)] 'windmove-left)


c-n next line
c-p previous line
M-x describe-key shortcuts
M-x describe-bindings Buffer-menu key bindings
M-x calendar get a calendar!

1/20

Make log posting to bmode:control_software/notes

Check out version of gcp onto bicep1 for user bicep

$ cvs -d bicep0.caltech.edu:/home/bicep0/cvsroot checkout -r working14Feb gcp
$ mv gcp/control/code/unix/libscan_src/Makefile.rules gcp/control/code/unix/libscan_src/BADMakefile.rules
$ cd gcp
$ mkdir runlogs
Edit Makefile to have CC = g++-4.1
$ make

Editing .bashrc on bicep@bicep1

copy my .bashrc from kstory@bicep1
add alias en='emacs -nw --user=kstory' so it loads my .emacs file

Standardize my .emacs on different machines:

kstory@supdws2

.emacs
;; turn off default startup message
(setq inhibit-startup-message t)

(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key "\C-f" 'forward-word)
(global-set-key "\C-b" 'backward-word)

.tcshrc.local
alias rm 'rm -i'
alias en 'emacs -nw'
alias du 'du -h'

alias sfind 'ssh -X kstory@find.uchicago.edu'
alias sbicep0 'ssh -X kstory@bicep0.caltech.edu'
alias sbicep1 'ssh -X kstory@bicep1.caltech.edu'
alias sspt 'ssh -X kstory@spt.uchicago.edu'

alias gscreen 'gnome-screensaver'
alias cdg 'cd ~/work/gcp'

setenv GCP_DIR /home/kstory/work/gcp/control
xmodmap ~/.xmodmap

kstory@find

.emacs
(setq inhibit-startup-message t)

(add-to-list 'load-path "~/web/source/emacs/muse")
(load "muse-init")

(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key "\C-f" 'forward-word)
(global-set-key "\C-b" 'backward-word)

.tcshrc
alias en 'emacs -nw'
alias rm 'rm -i'
alias duh 'du -sclh'
alias ll='ls -l'
alias la='ls -a'

set prompt='%n@%m:%c1/$ '

setenv GCP_DIR /home/kstory/gcp/control

kstory@bicep0

.emacs
(setq inhibit-startup-message t)

(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key "\C-f" 'forward-word)
(global-set-key "\C-b" 'backward-word)

NEED TO WORK ON COLOR

.tcshrc
alias en 'emacs -nw'
alias rm 'rm -i'
alias duh 'du -sclh'
alias ll 'ls -l'
alias la 'ls -a'
alias killAll '/home/bicep0/kstory/gcp/misc/scripts/common/killAll'
alias grep 'grep -Hn'
alias grepr 'grep -rHn'

set prompt='%n@%m:%c$ '

setenv GCP_DIR /home/bicep0/kstory/gcp/control
setenv CVS_RSH ssh

bicep@bicep0

.emacs
I added:
(setq inhibit-startup-message t)

.tcshrc
lots of stuff, I didn't edit it.

kstory@bicep1

.emacs
(setq inhibit-startup-message t)
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key "\C-f" 'forward-word)
(global-set-key "\C-b" 'backward-word)

.bashrc
alias cdg='cd ~/gcp'
alias en='emacs -nw'
alias grepr='grep -rHn'
alias ll='ls -l'
alias la='ls -A'
alias rm='rm -i'

alias sspudws2="ssh -X kstory@spudws2.uchicago.edu"
alias sfind="ssh -X kstory@find.uchicago.edu"
alias sbicep0="ssh -X kstory@bicep0.caltech.edu"

export GCP_DIR=/home/kstory/gcp/control
export PGPLOT_DIR=/usr/local/pgplot/

bicep@bicep1

bicep@bmode

Changed in code:

DataBase

Comparing different gcp versions (WRONG)

THIS IS WRONG!! IT COMPARES AGAINST THE HEAD, NOT THE VERSION
$ cvs diff -D now >& diff_1.20_gpcWinter2007_bicep1
$ cvs diff -D now >& diff_1.20_gpcWinter2007_bicep3

bicep1
New files that look important:
  - control/code/unix/libunix_src/common/im_monitor_stream.h
  - control/code/unix/libunix_src/common/monitor_stream.h
  - control/code/unix/libunix_src/common/script.h
  - control/code/unix/libunix_src/common/slalib.h
  - control/conf/bicep/control.init_save
  - control/ephem/2007-012-01_ut1utc.ephem
  - control/ephem/2008-04-01_ut1utc.ephem
  - control/ephem/2008-06-01_ut1utc.ephem
  - control/ephem/2008-09-01_ut1utc.ephem
  - util/common/Mean.cc
  - util/common/Mean.h
  - util/common/Test/tBoxCar.cc


Altered Files:
Makefile:
lots of changes

control/Makefile:
No real change

control/code/Makefile:
No real change

control/code/unix/Makefile:
substantive changes.

_control/code/unix/control_src/common/Makefile_:
No real change

_control/code/unix/control_src/common/NewNetCmd.h_
No real change

_control/code/unix/control_src/common/TransactionStatus.c_

"gcp/util/common/Exception.h" (added)


_control/code/unix/control_src/common/archiver.c_
lots of change, but I can't tell how drastic it is.

_control/code/unix/control_src/common/controlscript.c_
Lots of change.
Looks like the previous file was defined but empty.

_control/code/unix/control_src/common/controlscript.h_
void generateAutoDocumentation(Script* sc, std::string dir); (added)

_control/code/unix/control_src/common/fitsio.c_
Changes

_control/code/unix/control_src/common/fitsio.h_
19c19
< int net_put_fitshead(gcp::control::NetBuf *net, unsigned long utc2);
---
> int net_put_fitshead(gcp::control::NetBuf *net, unsigned int utc2);

_control/code/unix/control_src/common/genericcontrol.c_
Changes

_control/code/unix/control_src/common/genericcontrol.h_
Changes

_control/code/unix/control_src/common/genericscheduler.c_
Changes

_control/code/unix/control_src/common/genericscheduler.h_
249c249
< int pack_scheduler_auto_poll(SchedulerMessage *msg, long ms);
---
> int pack_scheduler_auto_poll(SchedulerMessage *msg, int ms);

_control/code/unix/control_src/common/genericscript.c_
Changes

_control/code/unix/control_src/common/generictypes.c_
Changes

_control/code/unix/control_src/common/generictypes.h_
Changes

_Index: control/code/unix/control_src/common/grabber.c_
Changes

_control/code/unix/control_src/common/grabber.h_
Changes

_control/code/unix/control_src/common/logger.c_
Changes

_control/code/unix/control_src/common/navigator.c_
Changes

_control/code/unix/control_src/common/terminal.c_
Changes.

_control/code/unix/libmonitor_src/file_monitor.c_
Changes.

_control/code/unix/libmonitor_src/im_monitor_stream.c_
No real change

_control/code/unix/libmonitor_src/monitor_stream.h_
Changes

_control/code/unix/libmonitor_src/net_im_monitor.c_
Changes

_control/code/unix/libmonitor_src/net_monitor.c_
Changes

_control/code/unix/libscan_src/Makefile_
Changes

_control/code/unix/libscan_src/Makefile.rules_
Changes

_control/code/unix/libscan_src/scan.c_
Changes

_control/code/unix/libscript_src/datatype.c_
Changes

_control/code/unix/libscript_src/procedure.c_
Changes

_control/code/unix/libscript_src/script.c_
Changes

Umm, the file is 41,913 lines long. Going through function by function is useless.

compile gcpWinter2007_bicep1 on bicep1@caltech

copy gcpWinter2007_bicep1 to kstory@bicep1.caltech
change CC=g++-4.1
make

$ make
...
/usr/bin/ld: i386 architecture of input file `cache.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `print.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `slprintf.o' is incompatible with i386:x86-64 output

??
cvs does not recognize the file:

$ cd gcp/control/code/unix/libunix_src/common/
$ cvs status cache.o
===================================================================
File: cache.o           Status: Unknown

   Working revision:    No entry for cache.o
   Repository revision: No revision control file

$ cvs status cache.c
===================================================================
File: cache.c           Status: Up-to-date

   Working revision:    1.1.1.1
   Repository revision: 1.1.1.1 /home/cvsroot/gcp/control/code/unix/libunix_src/common/cache.c,v
   Sticky Tag:          working14Feb (branch: 1.1.1.1.10)
   Sticky Date:         (none)
   Sticky Options:      (none)

Delete the offending files:

$ rm cache.o
$ rm print.o
$ rm slprintf.o
$ rm control/code/unix/libquad_src/regdata.o -f

Compile again:

BicepAtmosphere.o:(.gnu.linkonce.d._ZTIN3gcp4util15BicepAtmosphereE+0x8): undefined reference to `typeinfo for gcp::util::Atmosphere'

/usr/bin/ld: skipping incompatible /home/kstory/gcp/lib/libGcpControlSpecific.so when searching for -lGcpControlSpecific
/usr/bin/ld: cannot find -lGcpControlSpecific

I am no longer convinced that this is a worth-wile activity.

1/21

Control Schematic for MCE

This plot was made by Walt Ogburn


I broke my X server again... No I have cloned screens :(

Put .xmodmap in a .login file.

Fixed X server. The problem was that when my system updated, the Nvidia software did not, so there was a mismatch between the kernal and Nvidia software. Thanks Leo!

DataNew serviceMsgQ running off of simulated SyncBox pulses!

NSAMPLESPERFRAME is defined in control/code/unix/libunix_src/specific/devicemap.h:27

Telecon with Mark Halpern, John Kovac, Walt Ogburn

Questions:
We want the gcp to be able to run between 400Hz and 20 Hz.
1) How fast can the gcp run?
2) How slow can the gcp run?
  - timeOut
  - times of cervo loop, thermisters.
3) How are slow registers being handled in the antenna layer? Are they sampled at slow rate, or sampled fast and downsampled?
4) Best way to down sample (see discussion below).
5) Is switching between rates a problem for gcp?
6) Thermister data for focal plane temperature servo: Want PID loop asynchronous to DV rate. OK?

Action Items:
GCP work, Kyle/Walt: explore range of DV pulse rates accommodated by GCP: 20 Hz - 400 Hz? Would switching rates within this range on the fly, e.g. to go from normal obs to SQUID tuning and back, cause any problems?

(One potential issue: ensure that the focal plane active temperature control, if implemented within GCP as it was for BICEP1, runs with a fixed servo update rate asynchronous to the DV rate. We don't want its behavior to depend on the DV rate).

MCE work, UBC: Work on appropriate filters for 20 Hz data rate (5 Hz rolloff) and 50 Hz data rate (15 Hz rolloff) in addition to the current filter with 100 Hz rolloff. Also try changing tuning and IV curve scripts so that they report data to standard named pipe at DV pulse rate.



Notes from Walt:

--------

sample bolometers at 10 or 15 kHz, down sample.  4-pole butterworth filter
with desired output bandwidth.  Turn filtering off for other tasks (at
different sample rate).

Mandana working on alternate firmware for anti-aliasing filters approp. for
different sample rates.

For characterizing Sq 2 V-phi curve, software is part of the feedback loop
(must step SSA feedback by MAS commands).  High-speed output with no filter
is convenient to make this fast.

Also, characterization of new arrays may violate standard 20 Hz output rate.

ACT does a "mini-tuneup" every time telescope pointing is changed, to account
for changes in magnetic pickup in Sq 2.  Tune Sq 2 only when telescope is
moved, to restore nominal gain & noise.  This is again at faster data rate.

How long is the list of things for which we go faster than 20 Hz?

----

Raw data saved during observations must be at < 50 Hz, probably half that or
less, in order to conserve bandwidth from SP.  Probably want to down-sample
ordinary data to ~10 Hz before archiving, sending across satellite.

A possibility: leave MCE as is, with current AA filter (100 Hz); sample at 200
Hz; downsample offline.  This can be a fixed ratio inside GCP, or a later
processing step.  Keep full data rate on hard drive?  (Temporarily?)

1. MCE always runs fast (400 Hz).  MAS (a) or GCP (b) or (c) post-processing
decimates to 20 Hz.
2. MCE has firmware filter to downsample to 20 Hz.

In 1(a), GCP needs to know to use only every n_th DV pulse.  In 1(b), GCP
needs to have built-in filtering & downsampling.

John suggests
----

What max data rate can GCP handle?  ACT goes up to 400 Hz (but doesn't use
GCP).

How are slow registers being handled in the antenna layer?  They are only
sampled at the slow rate (not sampled fast & downconverted).

----

GCP work: explore range of DV pulse rates accommodated by GCP: 20 Hz - 400 Hz?
Is switching between rates a problem?

Potential problem: thermistor data for focal plane temperature servo.  It
appears we want PID loop asynchronous to DV rate.  Is this possible within
GCP architecture?

MCE work: find out whether tuning can go at DV pulse rate, and how long
various tasks would take.  Work on appropriate filters for 20 Hz data rate.

----

MAS / MCE future plans: single-board MCE computer to live in a stand-alone PCI
bus with fiber cards.  Will be low-power-consumption,  low-processor-power,
but fast enough to do all MAS operations.

MAS scripts with IDL will be replaced with python.  Shell scripts will be kept
as-is.

1/22

How the antenna DataNew::serviceMsgQ() works

// Register the message queue into the FdSet.
int msgqFd = msgq_.fd(); // This is from GenericTask.
fdSet_.registerReadFd(msgqFd);

// Set the timeOut value:
  if(simSync_) {
    timeOut_.setTimeInMilliSeconds(fastTimeOutMilliSeconds_);
  } else {
    timeOut_.setTime(slowTimeOutSeconds_, 0);
  }

// Loop indefinitely, reading the message Q. The loop will quit if we time out.
while(!stop) {
  // check for a message:
  nready=select(fdSet_.size(), fdSet_.readFdSet(), NULL, NULL, timeOut_.timeVal());

  // If we have a message, deal with it:
  if(nready > 0) {
    if(fdSet_.isSetInRead(msgqFd))
      processTaskMsg(&stop);
  }

  // Now poll the Blastbus card for the current SyncBox frame number:
  sync_->frameNumber_current_ = sync_->readFrameNumber();

  // If the number has changed, read fast registers.
  if(sync_->frameNumber_current_ != sync_->frameNumber_prev_) {
    sync_->frameNumber_prev_ = sync_->frameNumber_current_;
    iSamp++;
    // Read the fast registers
    bufferFrameNumber(iSamp);
    bufferTimeData(iSamp);
    bufferPmacData(iSamp);
  }

  // Make a slow frame if we have enough fast frames:
  int frNumMod = sync_->frameNumber_current_ -
      ( (int) sync_->frameNumber_current_/NSAMPLESPERFRAME ) * NSAMPLESPERFRAME;
  if(frNumMod == 0) {
    writeHKData();
    if(parent_ !=0)
      parent_->sendPackDataFrameMsg();
    iSamp = 0;
  }

  // Else we have timed out.
  if(fout_ != 0)
    * fout_ << "Timed out — buffering data" << std::endl;
  bufferTimeData(iSamp);
  bufferPmacData(iSamp);

// End serviceMsgQ()

select()

http://www.opengroup.org/onlinepubs/009695399/functions/select.html

If none of the selected descriptors are ready for the requested operation, the pselect() or select() function shall block until at least one of the requested operations becomes ready, until the timeout occurs, or until interrupted by a signal.

So what I really need to do is have a message show up in the DataNew::serviceMsgQ when the frame number changes.

Q: How do File Descriptors get set to read? How do interrupts work?
FD_SET()

Fast Pmac registers in Antenna Layer

1/23

Compare different gcp versions with cvs

Relevant command:
$ cvs status >& 2009-01-23_status_bicep1.txt
$ cvs diff -r working14Feb >& 2009-01-23_diff_bicep1.txt

$ cvs status >& 2009-01-23_status_bicep3.txt
$ cvs diff -r working14Feb >& 2009-01-23_diff_bicep3.txt

bicep1

kstory@bicep0:gcpWinter2007$ pwd
/raid/bicep0/pole_backups_200812/bicep1/home/bicep/gcpWinter2007

kstory@bicep0:gcpWinter2007$ cvs diff -r working14Feb > & /home/bicep0/kstory/2009-01-23_diff_bicep1.txt
kstory@bicep0:gcpWinter2007$ cvs status > & /home/bicep0/kstory/2009-01-23_status_bicep1.txt

bicep3

kstory@bicep0:gcpWinter2007$ pwd
/raid/bicep0/pole_backups_200812/bicep3/home/bicep/gcpWinter2007

kstory@bicep0:gcpWinter2007$ cvs diff -r working14Feb >& /home/bicep0/kstory/2009-01-23_diff_bicep3.txt
kstory@bicep0:gcpWinter2007$ cvs status > & /home/bicep0/kstory/2009-01-23_status_bicep3.txt

Send email to John Kovac and others with these 4 files attached.

1/24

bbcsync thoughts from Walt

Email from Walt:

OK, I think I see now - bbcsync writes to /dev/bbc_sync, and GCP waits
for /dev/bbc_sync to be ready for reading using select (or pselect).  This is
fast because select is a system call and doesn't depend on polling in GCP.

Have I got it right?  In that case, we need very little change to bbysync.
-- Walt

Email from Steve:

I'm not really familiar with your requirements or GCP's architecture, but it seems to me that with a thread dedicated to bbc_sync, it can still have ~ms latencies to become active.

What ACT did is actually performed pointing readout in the interrupt. I'm including the tarball of their timing module from which bbc_sync is adapted. This way you can see what they did in a less stripped-down driver. If I recall correctly, they put some short instructions in the top half to get very good synchronization, then performed slower readout in the bottom half (which runs after some short-ish and variable latency). Since everything within the interrupt is tagged with the DV serial number, GCP can read the data from /dev/bbc_sync any time before the  next interrupt.

Also, on the note of updating bbc_sync, I've been putting it off for more pressing work. I'll see if I can do it this weekend.

-- Steve Benton

1/26

test_bbcpci strangeness notes

Sync Box numbers increment by 48, sometimes 47.
The 47-jump comes after between 5 and 7 48-jumps.

When I run the gcp off of bbcpci numbers, they iterate by 2.

I get some random jumps:

MsgQ: frameNumber= 285141260
MsgQ: frameNumber= 285141266
counter = 133

MsgQ: frameNumber= 285141266
MsgQ: frameNumber= 285141271
counter = 132

MsgQ: frameNumber= 285141271
MsgQ: frameNumber= 285141272
counter = 133

MsgQ: frameNumber= 285141272
MsgQ: frameNumber= 285141278
counter = 132

MsgQ: frameNumber= 285141278
MsgQ: frameNumber= 285141279
counter = 132

MsgQ: frameNumber= 285141279
MsgQ: frameNumber= 285141281
counter = 133

MsgQ: frameNumber= 285141281
MsgQ: frameNumber= 285141283
counter = 110

MsgQ: frameNumber= 285141283
MsgQ: frameNumber= 285141285
counter = 3

Email to Walt:

Hi Walt,
I have written a data acquisition loop in the gcp that is timed from polling the bbc pci card, and am working on figuring out why it is not working like I expect.

In this process I noticed that if you run test_bbcpci, the first ~1/2 second or so looks fine.  The frame numbers are indeed sequential, and the same frame number prints out ~45 times.  But ~1/2 sec, only odd frame numbers are printed, and the same frame number prints only 3 or 4 times.  Do you know anything that would be causing this?  My first guess is that some temp buffer somewhere in the write process is getting filled and overloaded.

Output from first ~0.5 sec:
84d 5f811107 1  110d422b ...* ...* .... **.* .*.. ..*. ..*. *.** 110ffd46
84e 4001b002 1 110d422b ...* ...* .... **.* .*.. ..*. ..*. *.** 110ffd46
850 5f80fd48 1    110d422b ...* ...* .... **.* .*.. ..*. ..*. *.** 110ffd48
851 5f811107 1  110d422b ...* ...* .... **.* .*.. ..*. ..*. *.** 110ffd48
... (~45 printed lines with frame Number  110d422b)
875 5f811107 1  110d422b ...* ...* .... **.* .*.. ..*. ..*. *.** 110ffd5a
876 4001b002 1 110d422c ...* ...* .... **.* .*.. ..*. ..*. **.. 110ffd5a
878 5f80fd5c 1    110d422c ...* ...* .... **.* .*.. ..*. ..*. **.. 110ffd5c

Output after ~0.5 sec:
1705 4001b002 1 110ddaef ...* ...* .... **.* **.* *.*. ***. **** b10fdaee
1707 5f80daf0 1   110ddaf1 ...* ...* .... **.* **.* *.*. **** ...* b10fdaf0
1708 5f81110d 1  110ddaf1 ...* ...* .... **.* **.* *.*. **** ...* b10fdaf0
1709 4001b002 1 110ddaf1 ...* ...* .... **.* **.* *.*. **** ...* b10fdaf0
170b 5f80daf2 1   110ddaf3 ...* ...* .... **.* **.* *.*. **** ..** b10fdaf2
170c 5f81110d 1  110ddaf3 ...* ...* .... **.* **.* *.*. **** ..** b10fdaf2
170d 4001b002 1 110ddaf3 ...* ...* .... **.* **.* *.*. **** ..** b10fdaf2
170f 5f80daf4 1     110ddaf5 ...* ...* .... **.* **.* *.*. **** .*.* b10fdaf4
1710 5f81110d 1  110ddaf5 ...* ...* .... **.* **.* *.*. **** .*.* b10fdaf4
1711 4001b002 1 110ddaf5 ...* ...* .... **.* **.* *.*. **** .*.* b10fdaf4
1713 5f80daf6 1   110ddaf7 ...* ...* .... **.* **.* *.*. **** .*** b10fdaf6
...

Ideas?  We need to have a consistent, predictable output.

Thanks,
Kyle

- What happens if the file /dev/bbc_pci does not open properly the first time?
  - What is the purpose of the usleep(1000000) around ioctl(fp_tmp, BBCPCI_IOC_SYNC); in test_bbcpci.c ?

gprof

http://people.sc.fsu.edu/~burkardt/cpp_src/gprof/gprof.html

g++ -c -pg test3_bbcpci.cc
g++ -pg test3_bbcpci.o

versions of test_bbcpci

test_bbcpci.c
The oritinal function

test4_bbcpci.cc
Same as test_bbcpci.c, but with clearing of the buffer before the while loop

test4_bbcpci.c
Same as test_bbcpci.c, but with clearing of the buffer before the while loop

readFrameNumber.cc
This works.

getFrameNumber3.cc
My current version for hacking on.

Summary of thougths on test_bbcpci today

Hi Walt,

Status: current gcp working with loop driven by polling bbcpci. Same problem as with test_bbcpci.

getFrameNumber3.cc

Q: how do I read a file descriptor from a device Node?
Q: Where is the device node?
Q: Are you going to bug Steve Benton about getting that working with the current kernal?

Hi Walt,
I think I am making progress on the problem.  But if you can figure out *why* this solves the problem that would be helpful for understanding the bbcpci code.

Inside test_bbcpci.c:
By adding the lines

    read(fp, (void *)(&j), sizeof(unsigned int));
    ioctl(fp, BBCPCI_IOC_RESET);

directly before the while loop, everything seems to work.  It seems that
the device buffer needed to be cleared after the initialization process and
 the first call to read().  It doesn't work without this call to read().
Then once the buffer is cleared, it is good to go.  I still don't
 understand exactly why this change is necessary.  Also, I don't know if
 the buffer needs to be cleared only once, or periodically.  Look at

/home/kstory/syncBox/bbcpci/test5_bbcpci.c

as an example.

I also have a "toy" code for triggering the gcp loop by polling the bbcpci which you can look at if you want:
/home/kstory/syncBox/bbcpci/readFrameNumber.cc

Thoughts?

Output from previous gcp Antenna:

BBCPCI initialized in regular DataBase constructor.
Unsing no prio
About to start tracker
Using no prio
Leaving QuaMonitor constructor: spawn = 1
Inside connect
serviceMsgQ: Frame Number = 288829801, iSamp=0
counter = 1
bufferFrameNumber: Frame number = 288829801
Just executed setupForHalt
serviceMsgQ: Frame Number = 288829802, iSamp=1
counter = 1815
bufferFrameNumber: Frame number = 288829802
serviceMsgQ: Frame Number = 288829803, iSamp=2
counter = 41
bufferFrameNumber: Frame number = 288829803
Unknown TCP/IP host: "omega0.southpole.usap.gov".
serviceMsgQ: Frame Number = 288829805, iSamp=3
counter = 3

For Tomorrow:

1/27

cvs differences for gcp BICEP1

gcpWinter2007_bicep1

2009-01-23_status_bicep1.txt
2009-01-23_diff_bicep1.txt

Locally Modified
  - Makefile
  - antenna/control/bicep/AntennaMaster.cc, .h
  - antenna/control/bicep/GpsTimer.cc, .h
  - antenna/control/bicep/Trakcer.cc, .h
  - control/code/unix/misc_src/Makefile
  -

Locally Added
  - gcp/util/common/bin_Pmacterm.cc

Entry Invalid (no longer in repository)
  - antenna/control/bicep/antennaControl.cc
  - antenna/control/bicep/nrutil.cc
  - antenna/control/bicep/spline.cc
  - antenna/control/bicep/splint.cc
  - antenna/control/bicep/temp_convert.cc
  - util/common/command.cc
  - util/common/monitor.cc
  -

Locally Removed
  - util/common/pmacterm.cc

Needs Patch
  - control/code/unix/control_src/common/TransactionStatus.c
  - control/code/unix/control_src/common/archiver.c, .h
  - control/code/unix/control_src/common/genericcontrol.c, .h
  - control/code/unix/control_src/commongenericscheduler.c
  - control/code/unix/control_src/common/genericscript.c
  - control/code/unix/control_src/common/grabber.c, .h
  - control/code/unix/control_src/common/logger.c
  - control/code/unix/control_src/common/navigator.c
  - control/code/unix/control_src/common/terminal.c
  - control/code/unix/libscan_src/Makefile.rules
  - control/code/unix/libtclcontrol_src/tclcontrol.c
  - control/code/unix/libunix_src/common/arraymap.c, .h
  - control/code/unix/libunix_src/common/control.c, .h
  - control/code/unix/libunix_src/common/regmap.c, .h
  - control/code/unix/viewer_src/monitor_viewer.c, .h
  - control/code/unix/viewer_src/tclmonitor.c
  - control/code/unix/viewer_src/viewer.tcl
  - control/ephem/source.cat
  - control/scan/scan.cat
  - gcp/grabber/common/Scanner.cc, .h
  - util/common/ArrayMapDataFrameManager.cc, .h
  - util/common/Astrometry.cc, .h
  - util/common/DataType.cc, .h
  - util/common/DataTypeTruthFn.cc, .h
  - util/common/MonitorCondition.cc, .h
  - util/common/MonitorDataType.cc
  - util/common/MonitorPoint.cc, .h
  - util/common/MonitorPointManager.cc, .h
  - util/common/Pipe.cc, .h
  - util/common/RegDescription.cc, .h
  - util/common/RegMapDataFrameManager.cc, .h
  - util/common/TimeVal.cc, .h

Needs Checkout
  - control/conf/bicep/cal
  - control/conf/bicep/control.init
  - control/conf/bicep/pointing.init
  - control/ephem/utlutc.ephem
  - control/scan/az-2p0-1p0a.scan
  - control/scan/el-0p5-25.scan
  - control/sch/9_48hr_12_1D_xxx.sch
  - control/sch/9_48hr_12_2D_xxx.sch
  - control/sch/9_48hr_12_3C_xxx.sch
  - control/sch/9_48hr_12_3D_xxx.sch
  - control/sch/README_schedule.txt
  - control/sch/cycle_only.sch

Unrecognized files:
? lib
? modules
? round.cc
? antenna/control/bicep/Makefile.rules
? antenna/control/bicep/SimpleMean.cc
? antenna/control/bicep/SimpleMean.h
? antenna/control/bicep/SmmTip.log
? antenna/control/bicep/SyncSeqCommand.cc
? antenna/control/bicep/SyncSeqCommand.h
? control/code/unix/control_src/common/Makefile.rules
? control/code/unix/libmonitor_src/Makefile.rules
? control/code/unix/libquad_src/Makefile.rules
? control/code/unix/libscript_src/Makefile.rules
? control/code/unix/libsrc_src/Makefile.rules
? control/code/unix/libtclcontrol_src/Makefile.rules
? control/code/unix/libtransaction_src/Makefile.rules
? control/code/unix/libunix_src/bicep/Makefile.rules
? control/code/unix/libunix_src/common/Makefile.rules
? control/code/unix/libunix_src/common/im_monitor_stream.h
? control/code/unix/libunix_src/common/monitor_stream.h
? control/code/unix/libunix_src/common/script.h
? control/code/unix/libunix_src/common/slalib.h
? control/code/unix/viewer_src/Makefile.rules
? control/conf/bicep/control.init_save
? control/ephem/2007-012-01_ut1utc.ephem
? control/ephem/2008-04-01_ut1utc.ephem
? control/ephem/2008-06-01_ut1utc.ephem
? control/ephem/2008-09-01_ut1utc.ephem
? directives/bicep/Makefile.directives
? directives/bicep/Makefile.directives.last
? directives/common/Makefile.directives
? directives/common/Makefile.directives.last
? grabber/common/Makefile.rules
? mediator/bicep/Makefile.rules
? program/common/Makefile.rules
? scripts/bicep/stopBicepAntennaControl
? util/bicep/Makefile.rules
? util/common/Makefile.rules
? util/common/Mean.cc
? util/common/Mean.h
? util/common/Test/tArcFileConverter
? util/common/Test/tBoxCar
? util/common/Test/tBoxCar.cc
? util/common/Test/tClient
? util/common/Test/tFilteredMean


gcpWinter2007_bicep3

2009-01-23_status_bicep3.txt
2009-01-23_diff_bicep3.txt

Locally Modified
  - control/ephem/source.cat
  - control/scan/scan.cat
  - control/sch/7_elnodtransfer02_xxx.sch
  - control/sch/README_schedule.txt
  - modules/bicep/gps.c
  - modules/bicep/gps.mod.c
  - modules/bicep/tfp.mod.c
  - scripts/bicep/controlSystem

Locally Added
  [NONE]

Entry Invalid
  - antenna/control/bicep/antennaControl.cc
  - antenna/control/bicep/nrutil.cc
  - antenna/control/bicep/spline.cc
  - antenna/control/bicep/splint.cc
  - antenna/control/bicep/temp_convert.cc
  - util/common/monitor.cc

Locally Removed
  [NONE]

Needs Patch
  - util/common/DataType.h
  - util/common/DataTypeTruthFn.h
  - util/common/MonitorPoint.h

File had conflicts on merge
  - grabber/common/Scanner.cc

Needs Checkout
  - gcp/control/scan/elnod-a-100s.scan
  - gcp/control/scan/elnod-a-140s.scan
  - gcp/control/scan/elnod-a-200s.scan
  - gcp/modules/bicep/bc635pci.ko
  - gcp/modules/bicep/bc635pci.mod.c

Unrecognized Files
? antenna/control/bicep/Makefile.rules
? control/code/unix/control_src/common/Makefile.rules
? control/code/unix/libmonitor_src/Makefile.rules
? control/code/unix/libquad_src/Makefile.rules
? control/code/unix/libscript_src/Makefile.rules
? control/code/unix/libsrc_src/Makefile.rules
? control/code/unix/libtclcontrol_src/Makefile.rules
? control/code/unix/libtransaction_src/Makefile.rules
? control/code/unix/libunix_src/bicep/Makefile.rules
? control/code/unix/libunix_src/common/Makefile.rules
? control/code/unix/libunix_src/common/im_monitor_stream.h
? control/code/unix/libunix_src/common/monitor_stream.h
? control/code/unix/libunix_src/common/script.h
? control/code/unix/libunix_src/common/slalib.h
? control/code/unix/viewer_src/Makefile.rules
? control/ephem/new
? control/ephem/sza.ephem
? control/ephem/ut1.ephem
? control/ephem/ut1utc_2007.ephem
? control/ephem/ut1utc_2007_2.ephem
? control/scan/az-0p25-20.scan
? control/scan/elnoda-100s.scan
? control/scan/elnoda-140s.scan
? control/scan/elnoda-200s.scan
? control/sch/5_timeconst_stoolgunn5_xxx.sch
? control/sch/7_ffflat_220raster_01_xxx.sch
? control/sch/7_ffflat_mapo_06_xxx.sch
? control/sch/7_ffflat_mapo_07_xxx.sch
? control/sch/7_ffflat_sunraster_01_xxx.sch
? control/sch/7_ffflat_wpraster_01_xxx.sch
? control/sch/7_pixel_polraster_08_xxx.sch
? control/sch/9_48hr_23_2C_xxx.sch
? control/sch/9_48hr_23_2D_xxx.sch
? control/sch/9_48hr_23_3A_xxx.sch
? control/sch/9_48hr_23_3B_xxx.sch
? control/sch/9_48hr_23_3C_xxx.sch
? control/sch/9_48hr_23_3D_xxx.sch
? control/sch/9_48hr_29_3B_xxx.sch
? control/sch/cycle_only_no_zenith.sch
? control/sch/pixel_polraster4_xxx.sch.arr
? control/sch/pixel_polraster6_ABCDEFlist_150cen.sch
? control/sch/pixel_polraster6_ABCDEFlist_220.sch
? control/sch/raster_mastsource9.sch
? directives/bicep/Makefile.directives
? directives/bicep/Makefile.directives.last
? directives/common/Makefile.directives
? directives/common/Makefile.directives.last
? grabber/common/Makefile.rules
? grabber/common/Scanner.cc_uc
? grabber/common/difflist
? mediator/bicep/Makefile.rules
? modules/bicep/.gps.ko.cmd
? modules/bicep/.gps.mod.o.cmd
? modules/bicep/.gps.o.cmd
? modules/bicep/.pmac.ko.cmd
? modules/bicep/.pmac.mod.o.cmd
? modules/bicep/.pmac.o.cmd
? modules/bicep/.tfp.ko.cmd
? modules/bicep/.tfp.mod.o.cmd
? modules/bicep/.tfp.o.cmd
? modules/bicep/.tmp_versions
? modules/bicep/Makefile_save
? modules/bicep/difflist
? modules/bicep/gps.ko
? modules/bicep/pmac.ko
? modules/bicep/tfp.ko
? program/common/Makefile.rules
? util/bicep/Makefile.rules
? util/common/Makefile.rules
? util/common/difflist

put Frame number into the register map.

Add new RegBlockTemp to specificregs.c

Types of data are defined in
control/code/unix/libunix_src/common/regmap.h

It shows up

Now edit DataBase::bufferFrameNumber, etc

Plan:
  - Understand the slow RegBlockTemp.
  - Make struct FastSyncReg analogous to FastReg. Put sync box register stuff in that.

1/28

Make copy of current gcp, loop run with polling syncBox

bicep1: /home/kstory/backup_bcp/gcp_1.29_pollSyncBox

Add sync box register to register map (continued)

Try following Pmac model.

Stop this. I think this is too complicated.

Try following timing model.


1/29

Register Map layout: email from John Kovac

Hi Kyle,


    Do you know what data is being read in the Antenna Layer?


This is a pretty broad question.  Here is an info dump on BICEP's existing registers:


GCP is supposed to auto-generate html documentation of all registers.  An example of this from SZA's version of GCP is linked from our webpage:

 http://bmode.caltech.edu/~spuder/bicep1/control_software/sza/registers.html

I take it that the fact that our website links to this old SZA register list means that for some reason auto-generation of BICEP1 register documentation was never done.  If it is not too much work, we should get it working again and linked for BICEP2!

There is similar auto-generated documentation for gcp scripting commands, which would also be good to get working.  Erik or Steff may recall any outstanding issues in getting this running.


If you want to see all the registers that actually are archived for bicep1, it is simple to look at the "format" file in any dirfile in the data archive, e.g.

[john@bicep0 ~]$ more /data/bicepdaq/dirfile/20081010_050009.dat/format

Registers which are 50 elements long are the fast registers, all others are slow registers. You will see comparing registers for BICEP1 and those in the SZA documentation that many have stayed the same, especially among these "boards":

  array.frame
  array.weather
  antenna0.frame
  antenna0.time
  antenna0.pmac
  antenna0.tracker
  antenna0.weather
  antenna0.tipper

More unique to BICEP1 are the registers that are derived from data that is unpacked from the UDP packets flowing from BICEP1's receiver electronics, registers organized into these "boards":

  antenna0.bolo
  antenna0.fridge
  antenna0.rotator
  antenna0.level
  antenna0.datasystem
  antenna0.dewar
  antenna0.auxiliary
  antenna0.cal
  antenna0.irsrc



It appears that you have found reference to these all under "NetDataBoard":


    In BICEP1, the "NetDataBoard" deals with reading out the data boxes from the UDP port.  This information includes: bolo_, fridge_, rot_, dewar_, timep_, datasys_, aux_, level_, cal_ Do you know which, if any, of these is still relevant?  the timep_ reads out the gps card, so that is important.


I expect that of these we will retain some or all registers in the following boards for BICEP2/Keck housekeeping which will be read through the BLASTbus:

  antenna0.fridge
  antenna0.dewar
  antenna0.auxiliary

plus some others, no doubt, to do with precision thermistors, heaters, and configuration of the temperature control PID.  The level sensor

  antenna0.level

and potentially the waveplate (if we have one) will be HK systems that are controlled separately from the BLASTbus.  It will be up to Darren ultimately to define what HK registers we need.


We'll want to retain the "bolo" board for the MCE TES timestream data. Since this won't be coming from the antenna layer, I'm not sure whether it should be antennaX.bolo...perhaps mceX.bolo would be more appropriate.

- John

1/30

Working on making a simulated sync box driver.

location:
gcp/antenna/control/bicep/Test/tsync_driver.cc

not working...

Working!

Need to mkfifo gcp/antenna/control/bicep/Test/tbbc_device_node.dat

1/31

Write Frame Number to the register:

RegMapDataFrameManager::writeReg() in gcp/util/common/RegMapDataFrameManager.h

Run:
Error

*** writeFrameNumber: 1144251740

31-JAN-2009 19:58:25.433: In static void* gcp::util::Thread::startThread(void*): Caught an exception in thread: Data (1117088080)): In void gcp::util::RegMapDataFrameManager::checkType(RegMapBlock*, gcp::util::DataType::Type, gcp::util::CoordRange*): Register syncBox.fast_frameNumber does not match the requested type: INT 0

doxygen

Install Doxygen on bicep1.

Create the config file:

$ doxygen -g Doxyfile.cfg

Edit the config file:
http://www.stack.nl/~dimitri/doxygen/config.html



Later:
  - Understand bbc_sync.

  - Command stuff
  - Simulate stuff
  - Proper register maps for mce data.

Questions:
  - in specificregs.c, frameNumber address is 4*0x701. Is this ok??