3/2
First CVS commit
CVS check in
3/3
CVS checkin continued
Files of continued concern
Email from Walt: serial line to sync box
Check out fresh gcp copy from CVS
Changes in Walt's code:
Compilation errors for Walt
Check in Changes:
3/4
Issues with Frame Merging
Basic CVS commands used by BaBar
3/5
Reviewing Walt's changes
Description of BICEP1 TO BICEP2
check out gcp from CVS onto spudws2
Email to Erik
3/6
First attempt at running MCE from gcp: email from Walt.
3/8
Doxygen for current gcp
3/9
Monitor Issues
3/10
Remove reference to "box" in masd
3/11
Packing problems with frames
3/12
More packing
Commit Antenna Layer frame packing code to cvs
simulate time in Antenna Layer
Masd frame packing
3/13
Startup Scripts
Goals for Caltech trip
3/16 : At Caltech
Projects while at Caltech
Fix basicStartup
Frame Packing
3/17
Raid: 3dm2 on new machine
Continue Antenna Layer Frame Packing
Running new mce system
3/18
More Antenna Layer Frame Packing
Frame Packing (2)
Add notebook entry
Frame packing in Masd
3/19
Image of the running gcp
Zero registers in Masd
Running the Sync Box
Sync Box data Rate
Running on bicep1
Running on bicep2
3/20
Antenna skipped frame numbers
Confirm that Antenna sampple skipping does not happen in simSync
Timing Lag in Antenna Layer: between DV pulse and sampling.
Check sample skipping in Masd
Current running commands:
3/30
CVS web
3/31
Computer Names at Caltech
Trace data frame handling in Control Layer

3/2

First CVS commit

Walt made a massive CVS commit of bicep0 code.

Hi Kyle,

I have done a CVS commit into the CVS head on bicep0.  That means that you can
check it out without specifying a branch.  Unfortunately, this version doesn't
build, and I don't have time now to find out why.

My version of masd and specificregs.c are in CVS, and also at
bicep1:~reuben/masd/.  There are a few things that are not complete in the
daemon, and I have only added a few representative runfile registers to
specificregs.c.
Check out code:
$ cvs -d bicep0.caltech.edu:/home/bicep0/cvsroot checkout gcp
Compare this with my current working version:
$ diff -r gcp_rev16/ gcp/ >& myDiff

CI = Check In
LA = Look Again
WF = changes from working14Feb
RV = Revert

Missing files (Need to check in)
ok - antenna/control/bicep/SyncBoard.cc, .h
ok - antenna/control/bicep/SyncBoard.h
ok - antenna/control/bicep/Test/bbc_sync.h
ok - antenna/control/bicep/Test/tsync_driver.cc
ok - Doxyfile
ok - Doxyfile.cfg
ok - mediator/bicep/MceConsumer.cc
ok - mediator/bicep/MceConsumer.h
ok - mediator/bicep/MceControl.cc
ok - mediator/bicep/MceControl.h
ok - mediator/bicep/MceControlMsg.h
ok - mediator/bicep/MceNetCmdForwarder.cc
ok - mediator/bicep/MceNetCmdForwarder.h

ok - util/bicep/bbc_pci.h
ok - util/bicep/bbc_sync.h

Are these important?
  - control/code/unix/include/
  - control/code/unix/lib/
  - modules/bicep/gps.mod.c
  - modules/bicep/pmac.mod.c
  - modules/bicep/tfp.mod.c

Remove from CVS
ok - control/code/unix/libscan_src/Makefile.rules
ok - antenna/control/bicep/antennaControl.cc
  - antenna/control/spt // empty directory
  - control/code/unix/control_src/spt
  - control/code/unix/control_src

Differences:
ok - antenna/control/bicep/AntennaControl.cc Check In (CI)
    packIdMsg() was re-named
    some debugging print statements in my code
ok - antenna/control/bicep/AntennaControlMsg.h CI
    rename ifndef GCP_
ok - antenna/control/bicep/AntennaMaster.cc look again (LA)
    add bool simSync to constructor
    sendStrobePmacMsg() //from working14Feb
    sendInstallTimerMsg() // from working14Feb
    sendEnableTimerMsg() // from workign14Feb
ok - antenna/control/bicep/AntennaMaster.h CI
    constructr
ok - antenna/control/bicep/AntennaMonitor.cc CI
    packIdMsg()
    rename tmp var scanner to handler
ok - antenna/control/bicep/AntennaRx.cc CI
    remove dataport_
    remove simData, add simSync
ok - antenna/control/bicep/AntennaRx.h CI
ok - antenna/control/bicep/BicepShare.cc CI
    comment out unused function packFrame. This fn should just be deleted
ok - bin_AntennaControl.cc FIX, then CI
    add simSync command line parameter
    need to remove addLevel(Debug)
ok - antenna/control/bicep/CommandTask.cc CI
    remove simData, add simSync
ok - antenna/control/bicep/CommandTask.h CI
    add simSync
ok - antenna/control/bicep/DataBase.cc CI
    add syncBoard stuff, lots of my changes
ok - antenna/control/bicep/Data.cc CI
    my changes
ok - antenna/control/bicep/DataNew.cc CI
    simData
    removed runTest4
ok - antenna/control/bicep/DataNew.h CI
    add simSync
ok - control/code/unix/control_src/bicep/specificscript.c CI
    changed to rtc.receivers from rtc.antennas
ok - control/code/unix/control_src/common/genericcontrol.c CI
    changed to rtc.receivers from rtc.antennas
ok - control/code/unix/control_src/common/genericscheduler.c CI
    changed to rtc.receivers from rtc.antennas
ok - control/code/unix/control_src/common/genericscript.c CI
    changed to rtc.receivers from rtc.antennas
ok - control/code/unix/control_src/common/navigator.c CI
    changed to rtc.receivers from rtc.antennas
ok - control/code/unix/libunix_src/bicep/devicemap.h CI
    add MASD_COMMAND_PIPE
ok - control/code/unix/libunix_src/bicep/rtcnetcoms.c CI
    include gcp/util/common/MceNum.h
ok - code/unix/libunix_src/bicep/rtcnetcoms.h CI
    change to rtc.receiver from rtc.antenna
  - code/unix/libunix_src/bicep/specificregs.c LA
ok - code/unix/libunix_src/common/genericregs.c CI
    add MceRegMap
ok - code/unix/libunix_src/common/genericregs.h CI
    add MceRegMap

ok - mediator/bicep/AntennaConsumerNormal.cc CI
    my changes
ok - mediator/bicep/AntennaConsumerNormal.h CI
    sendAntGreetingMsg()
ok - mediator/bicep/AntennaControl.cc CI
    getIntAntId()
ok - mediator/bicep/AntennaControlMsg.h CI
    rtc.receivers
ok - mediator/bicep/Control.cc CI
    my changes
ok - mediator/bicep/Control.h CI
    add MceControl
ok - mediator/bicep/ControlMsg.h CI
    add getMceControlMsg()
ok - mediator/bicep/Scanner.cc CI
    my changes
ok - mediator/bicep/Scanner.h CI
    add MceConsumer
ok - mediator/bicep/StripNetCmdForwarder.cc CI
    rtc.receivers
ok - mediator/bicep/TransNetCmdForwarder.cc CI
    add forwardMceControlMsg()
ok - mediator/bicep/TransNetCmdForwarder.h CI

ok - util/bicep/ArrayNetCmdForwarder.cc CI
    mceForwarder_
ok - util/bicep/ArrayNetCmdForwarder.h CI
ok - util/common/ArrayDataFrameManager.cc CI
    writeMceRegMap
ok - util/common/ArrayDataFrameManager.h CI
ok - util/common/NetCmd.cc CI
    rtc.receivers
ok - util/common/NetCmdHandler.cc CI
    rtc.receivers
    NET_INIT_CMD
ok - util/common/NetCmdHandler.h CI
ok - util/common/NetCommHandler.cc CI
ok - util/common/NetCommHandler.h LA
ok - util/common/NetMsg.h CI
    rtc.receiver
ok - util/common/NetMsgHandler.cc CI
ok - util/common/NetMsgHandler.h CI
ok - util/common/NewRtcNetMsg.cc CI
    rtc.receiver
ok - util/common/NewRtcNetMsg.h CI
ok - util/common/Ports.h CI
    TRANS_MCE_CONTROL_PORT
    TRANS_MCE_SCANNER_PORT


difference in Working14Feb
  - antenna/control/bicep/GpsTimer.cc WF
  - antenna/control/bicep/GpsTimer.h WF
  - antenna/control/bicep/Test/tGpsTimer.cc WF
  - antenna/control/bicep/Test/tTfp.cc WF
  - antenna/control/bicep/Test/tWeatherMonitor.cc WF
  - antenna/control/bicep/Tracker.cc WF
  - antenna/control/bicep/Tracker.h WF
  - control/ephem/source.cat WF
  - control/scan/scan.cat WF
  - control/sch/7_elnodtransfer02_xxx.sch
  - control/sch/README_schedule.txt
  - help/registers.html
  - modules/bicep/gps.c
  - modules/bicep/gps_load
  - modules/bicep/pmac_load
  - modules/bicep/tfp.c


MASD
lots of stuff

CVS check in

antenna/control/bicep/SyncBoard.h
$ cp gcp_rev16/antenna/control/bicep/SyncBoard.h gcp/antenna/control/bicep/.
$ cd gcp/antenna/control/bicep/
$ cvs add SyncBoard.h
$ cvs commit -m 'Initial commit' SyncBoard.h
antenna/control/bicep/SyncBoard.cc
$ cp gcp_rev16/antenna/control/bicep/SyncBoard.cc gcp/antenna/control/bicep/.
$ cd gcp/
$ cvs add -m 'Initial commit' antenna/control/bicep/SyncBoard.cc
$ cvs commit antenna/control/bicep/SyncBoard.cc
antenna/control/bicep/Test/bbc_sync.h
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/Test/bbc_sync.h antenna/control/bicep/Test/.
$ cvs add antenna/control/bicep/Test/bbc_sync.h
$ cvs commit -m 'Initial commit' antenna/control/bicep/Test/bbc_sync.h
antenna/control/bicep/Test/tsync_driver.cc
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/Test/tsync_driver.cc antenna/control/bicep/Test/.
$ cvs add antenna/control/bicep/Test/tsync_driver.cc
$ cvs commit -m 'Initial commit' antenna/control/bicep/Test/tsync_driver.cc
directives/bicep/Makefile.directives
$ cd directives/
$ cp /home/kstory/gcp_rev16/directives/bicep/Makefile.directives .
Doxyfile
$ cp /home/kstory/gcp_rev16/Doxyfile .
$ cvs add Doxyfile
Doxyfile.cfg
$ cp /home/kstory/gcp_rev16/Doxyfile.cfg .
$ cvs add Doxyfile.cfg
$ cvs commit -m 'Initial commit of Doxygen cofig files'

$ cd mediator/bicep/ $ cvs add MceConsumer.cc $ cvs add MceConsumer.h $ cvs add MceControl.cc $ cvs add MceControl.h $ cvs add MceControlMsg.h $ cvs add MceNetCmdForwarder.cc $ cvs add MceNetCmdForwarder.h $ cvs commit -m 'Initial commit of Mediator Layer Mce communication classes'

$ cd util/bicep/ $ cvs add -m 'For Antenna Layer sync box connection' bbc_pci.h $ cvs add -m 'For Antenna Layer sync box connection' bbc_sync.h $ cvs commit -m 'Initial commit' control/code/unix/libscan_src/Makefile.rules (delete)

$ cd control/code/unix/libscan_src/
$ rm Makefile.rules
$ cvs delete Makefile.rules
$ cvs commit -m 'Delete Makefile.rules'
antenna/control/bicep/antennaControl.cc (delete)
$ cd antenna/control/bicep/
$ rm antennaControl.cc -f
$ cvs delete antennaControl.cc
$ cvs commit -m 'antennaControl.cc is replaced by bin_AntennaControl.cc'

Differences: antenna/control/bicep/AntennaControl.cc

$ mv antenna/control/bicep/AntennaControl.cc antenna/control/bicep/AntennaControl.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/AntennaControl.cc antenna/control/bicep/.
Edit the file, remove debugging print statements
$ cvs commit -m 'Method packIdMsg used to be packAntennaIdMsg' antenna/control/bicep/AntennaControl.cc
antenna/control/bicep/AntennaControlMsg.h
$ mv antenna/control/bicep/AntennaControlMsg.h antenna/control/bicep/AntennaControlMsg.h.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/AntennaControlMsg.h antenna/control/bicep/.
$ cvs commit -m 'Change directive to GCP_ANTENNA_ANTENNACONTROLMSG_H' antenna/control/bicep/AntennaControlMsg.h
antenna/control/bicep/AntennaMaster.cc
add simSync to AntennaMaster.cc
Still have questions about the sendStrobePmacMsg(), sendInstallTimerMsg()
$ cd antenna/control/bicep/
$ cvs commit -m 'Add simSync option to AntennaMaster' AntennaMaster.cc
antenna/control/bicep/AntennaMaster.h
$ mv AntennaMaster.h AntennaMaster.h.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/AntennaMaster.h .
$ cvs commit -m 'Add simSync option' AntennaMaster.h
antenna/control/bicep/AntennaMonitor.cc
$ mv AntennaMonitor.cc AntennaMonitor.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/AntennaMonitor.cc .
Edit file
$ cvs commit -m 'Change message function names' AntennaMonitor.cc
antenna/control/bicep/AntennaRx.cc
$ mv AntennaRx.cc AntennaRx.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/AntennaRx.cc .
$ cvs commit -m 'Add simSync, remove simData' AntennaRx.cc
antenna/control/bicep/AntennaRx.h
$ rm AntennaRx.h
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/AntennaRx.h .
$ cvs commit -m 'Add simSync' AntennaRx.h
antenna/control/bicep/BicepShare.cc
$ mv BicepShare.cc BicepShare.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/BicepShare.cc .
$ cvs commit -m 'Remove obsolete function packFrame' BicepShare.cc
antenna/control/bicep/bin_AntennaControl.cc
$ mv bin_AntennaControl.cc bin_AntennaControl.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/bin_AntennaControl.cc .
$ cvs commit -m 'Add simSync' bin_AntennaControl.cc
antenna/control/bicep/CommandTask.cc
$ mv CommandTask.cc CommandTask.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/CommandTask.cc .
$ cvs commit -m 'Add simSync' CommandTask.cc
antenna/control/bicep/CommandTask.h
$ mv CommandTask.h CommandTask.h.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/CommandTask.h .
$ cvs commit -m 'Add simSync' CommandTask.h
antenna/control/bicep/DataBase.cc
$ mv DataBase.cc DataBase.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/DataBase.cc .
$ cvs commit -m 'Add Sync Box, remove data board, bolometers, etc.' DataBase.cc
antenna/control/bicep/DataBase.h
$ mv DataBase.h DataBase.h.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/DataBase.h .
$ cvs commit -m 'Add Sync Box, remove data board, bolometers, etc.' DataBase.h
antenna/control/bicep/DataNew.cc
$ mv DataNew.cc DataNew.cc.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/DataNew.cc .
Edit file: delete some commented out parts.  This will still need somework
$ cvs commit -m 'DataNew thread that runs from SyncBox pulses' DataNew.cc
antenna/control/bicep/DataNew.h
$ mv DataNew.h DataNew.h.OLD
$ cp /home/kstory/gcp_rev16/antenna/control/bicep/DataNew.h .
$ cvs commit -m 'DataNew thread that runs from SyncBox pulses' DataNew.h
control/code/unix/control_src/bicep/specificscript.c
$ mv specificscript.c specificscript.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/control_src/bicep/specificscript.c .
$ cvs commit -m 'changed rtc.antennas to rtc.receivers' specificscript.c
control/code/unix/control_src/common/genericcontrol.c
$ mv genericcontrol.c  genericcontrol.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/control_src/common/genericcontrol.c .
$ cvs commit -m 'changed rtc.antennas to rtc.receivers, rtcCmd.antennas to rtcCmd.receivers' genericcontrol.c
control/code/unix/control_src/common/genericscheduler.c
$ mv genericscheduler.c genericscheduler.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/control_src/common/genericscheduler.c .
Edit file to remove one commented out line
$ cvs commit -m 'changed rtcnetmsg.msg.antenna to rtcnetmsg.msg.receiver' genericscheduler.c
control/code/unix/control_src/common/genericscript.c
$ mv genericscript.c  genericscript.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/control_src/common/genericscript.c .
Edit to remove commented out rtc.antennas
$ cvs commit -m 'changed rtc.antennas to rtc.receivers' genericscript.c
control/code/unix/control_src/common/navigator.c
$ mv navigator.c navigator.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/control_src/common/navigator.c .
$ cvs commit -m 'changed rtcnetmsg.msg.antenna to rtcnetmsg.msg.receiver' navigator.c
control/code/unix/libunix_src/bicep/devicemap.h
$ mv devicemap.h devicemap.h.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/libunix_src/bicep/devicemap.h .
$ cvs commit -m 'add MASD_COMMAND_PIPE' devicemap.h
control/code/unix/libunix_src/bicep/rtcnetcoms.c
$ mv rtcnetcoms.c rtcnetcoms.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/libunix_src/bicep/rtcnetcoms.c .
$ cvs commit -m 'Add mces command option' rtcnetcoms.c
code/unix/libunix_src/bicep/rtcnetcoms.h
$ mv rtcnetcoms.h rtcnetcoms.h.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/libunix_src/bicep/rtcnetcoms.h .
Edit file to remove commented out lines
$ cvs commit -m 'changed rtc.antennas to rtc.receivers, rtcCmd.antennas to rtcCmd.receivers' rtcnetcoms.h
code/unix/libunix_src/common/genericregs.c
$ mv genericregs.c genericregs.c.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/libunix_src/common/genericregs.c .
$ cvs commit -m 'Add Mce register map' genericregs.c
code/unix/libunix_src/common/genericregs.h
$ mv genericregs.h genericregs.h.OLD
$ cp /home/kstory/gcp_rev16/control/code/unix/libunix_src/common/genericregs.h .
$ cvs commit -m 'Add Mce register map' genericregs.h

3/3

CVS checkin continued

mediator/bicep/AntennaConsumerNormal.cc CI
$ mv AntennaConsumerNormal.cc AntennaConsumerNormal.cc.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/AntennaConsumerNormal.cc .
$ cvs commit -m 'Change to be compatible with both antenna and masd layers' AntennaConsumerNormal.cc
mediator/bicep/AntennaConsumerNormal.h
$ mv AntennaConsumerNormal.h AntennaConsumerNormal.h.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/AntennaConsumerNormal.h .
$ cvs commit -m 'new function sendAntGreetingMsg()' AntennaConsumerNormal.h
mediator/bicep/AntennaControl.cc
$ mv AntennaControl.cc AntennaControl.cc.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/AntennaControl.cc .
$ cvs commit -m 'Use NetCommHandler::getIntAntId()' AntennaControl.cc
mediator/bicep/AntennaControlMsg.h
$ mv AntennaControlMsg.h AntennaControlMsg.h.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/AntennaControlMsg.h .
$ cvs commit -m 'rtcCmd.antennas to rtcCmd.receivers' AntennaControlMsg.h
mediator/bicep/Control.cc
$ mv Control.cc Control.cc.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/Control.cc .
$ cvs commit -m 'Add MceControl thread' Control.cc
mediator/bicep/Control.h
$ mv Control.h Control.h.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/Control.h .
$ cvs commit -m 'Add MceControl thread' Control.h
mediator/bicep/ControlMsg.h
$ mv ControlMsg.h ControlMsg.h.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/ControlMsg.h .
$ cvs commit -m 'Add Mce messages' ControlMsg.h
mediator/bicep/Scanner.cc
$ mv Scanner.cc Scanner.cc.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/Scanner.cc .
$ cvs commit -m 'Add MceComsumer.  Note, this does NOT integrate mce and antenna frames yet!' Scanner.cc
mediator/bicep/Scanner.h
$ mv Scanner.h Scanner.h.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/Scanner.h .
$ cvs commit -m 'Add MceComsumer.  Note, this does NOT integrate mce and antenna frames yet!' Scanner.h
mediator/bicep/StripNetCmdForwarder.cc
$ mv StripNetCmdForwarder.cc StripNetCmdForwarder.cc.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/StripNetCmdForwarder.cc .
$ cvs commit -m 'Changed rtc.antennas to rtc.receivers' StripNetCmdForwarder.cc
mediator/bicep/TransNetCmdForwarder.cc
$ mv TransNetCmdForwarder.cc TransNetCmdForwarder.cc.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/TransNetCmdForwarder.cc .
$ cvs commit -m 'Add MceNetCmdForwarder' TransNetCmdForwarder.cc
mediator/bicep/TransNetCmdForwarder.h
$ mv TransNetCmdForwarder.h TransNetCmdForwarder.h.OLD
$ cp /home/kstory/gcp_rev16/mediator/bicep/TransNetCmdForwarder.h .
$ cvs commit -m 'Add MceNetCmdForwarder' TransNetCmdForwarder.h
util/bicep/ArrayNetCmdForwarder.cc
$ mv ArrayNetCmdForwarder.cc  ArrayNetCmdForwarder.cc.OLD
$ cp /home/kstory/gcp_rev16/util/bicep/ArrayNetCmdForwarder.cc .
$ cvs commit -m 'Add mcdForwarder' ArrayNetCmdForwarder.cc
util/bicep/ArrayNetCmdForwarder.h
$ mv ArrayNetCmdForwarder.h ArrayNetCmdForwarder.h.OLD
$ cp /home/kstory/gcp_rev16/util/bicep/ArrayNetCmdForwarder.h .
$ cvs commit -m 'Add mceForwarder' ArrayNetCmdForwarder.h
util/common/ArrayDataFrameManager.cc
$ mv ArrayDataFrameManager.cc ArrayDataFrameManager.cc.OLD
$ cp /home/kstory/gcp_rev16/util/common/ArrayDataFrameManager.cc .
$ cvs commit -m 'Add writeMceRegMap() and findMceRegMap() functions' ArrayDataFrameManager.cc
util/common/ArrayDataFrameManager.h
$ mv ArrayDataFrameManager.h ArrayDataFrameManager.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/ArrayDataFrameManager.h .
$ cvs commit -m 'Add writeMceRegMap() and findMceRegMap() functions' ArrayDataFrameManager.h
util/common/NetCmd.cc
$ mv NetCmd.cc NetCmd.cc.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetCmd.cc .
$ cvs commit -m 'Changed rtc.antennas to rtc.receivers' NetCmd.cc
util/common/NetCmdHandler.cc
$ mv NetCmdHandler.cc NetCmdHandler.cc.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetCmdHandler.cc .
$ cvs commit -m 'Allow net commands for both the antenna and mce' NetCmdHandler.cc
util/common/NetCmdHandler.h
$ mv NetCmdHandler.h NetCmdHandler.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetCmdHandler.h .
Edit file to remove commented out lines
$ cvs commit -m 'Allow net commands for both the antenna and mce' NetCmdHandler.h
util/common/NetCommHandler.cc
$ mv NetCommHandler.cc NetCommHandler.cc.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetCommHandler.cc .
$ cvs commit -m 'Allow net commands for both the antenna and mce' NetCommHandler.cc
util/common/NetCommHandler.h
$ mv NetCommHandler.h NetCommHandler.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetCommHandler.h .
$ cvs commit -m 'Allow net commands for both the antenna and mce' NetCommHandler.h
util/common/NetMsg.h
$ mv NetMsg.h NetMsg.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetMsg.h .
$ cvs commit -m 'Allow net messages for both the antenna and mce' NetMsg.h
util/common/NetMsgHandler.cc
$ mv NetMsgHandler.cc NetMsgHandler.cc.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetMsgHandler.cc .
$ cvs commit -m 'Allow net messages for both the antenna and mce' NetMsgHandler.cc
util/common/NetMsgHandler.h
$ mv NetMsgHandler.h NetMsgHandler.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/NetMsgHandler.h .
$ cvs commit -m 'Allow net messages for both the antenna and mce' NetMsgHandler.h
util/common/NewRtcNetMsg.cc
$ mv NewRtcNetMsg.cc NewRtcNetMsg.cc.OLD
$ cp /home/kstory/gcp_rev16/util/common/NewRtcNetMsg.cc .
$ cvs commit -m 'Changed NewRtcNetMsg.antenna to NewRtcNetMsg.receiver' NewRtcNetMsg.cc
util/common/NewRtcNetMsg.h
$ mv NewRtcNetMsg.h NewRtcNetMsg.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/NewRtcNetMsg.h .
$ cvs commit -m 'Changed NewRtcNetMsg.antenna to NewRtcNetMsg.receiver' NewRtcNetMsg.h
util/common/Ports.h
$ mv Ports.h Ports.h.OLD
$ cp /home/kstory/gcp_rev16/util/common/Ports.h .
$ cvs commit -m 'Add TRANS_MCE_SCANNER_PORT' Ports.h

Update files:

$ cvs status |grep "Needs Patch" >& 3.3
(standard input):5732:File: color_tab.h Status: Needs Patch
(standard input):5750:File: monitor_viewer.c Status: Needs Patch
(standard input):5840:File: viewer.tcl Status: Needs Patch
(standard input):15902:File: MasBoard.cc Status: Needs Patch
(standard input):15929:File: MasDataParse.h Status: Needs Patch


> $ cd control/code/unix/viewer_src/ > $ cvs status color_tab.h > File: color_tab.h Status: Needs Patch > Working revision: 1.1.1.1 > Repository revision: 1.2 > $ cvs update color_tab.h > $ cvs status color_tab.h > Working revision: 1.2 > > $ cvs status monitor_viewer.c > File: monitor_viewer.c Status: Needs Patch > Working revision: 1.3 > Repository revision: 1.5 > $ cvs update monitor_viewer.c > $ cvs status monitor_viewer.c > Working revision: 1.5 > > $ cvs status viewer.tcl > File: viewer.tcl Status: Needs Patch > Working revision: 1.3 > Repository revision: 1.5 > $ cvs update viewer.tcl > $ cvs status viewer.tcl > Working revision: 1.5 > > $ cd masd/bicep/ > $ cvs status MasBoard.cc > File: MasBoard.cc Status: Needs Patch > Working revision: 1.3 > Repository revision: 1.5 > $ cvs update MasBoard.cc > $ cvs status MasBoard.cc > Working revision: 1.5 > > $ cvs status MasDataParse.h > File: MasDataParse.h Status: Needs Patch > Working revision: 1.2 > Repository revision: 1.3 > $ cvs update MasDataParse.h > $ cvs status MasDataParse.h > Working revision: 1.3 >




Files of continued concern

Email from Walt: serial line to sync box

Hi Kyle,

The sync box serial control line now goes to bicep1 through a USB->serial
adapter.  You can find it at /dev/ttyUSB0.  The settings in gtkterm have been
updated accordingly, and gcp will eventually need to use this device node to
control the sync box.

Check out fresh gcp copy from CVS

$ cvs -d bicep0.caltech.edu:/home/bicep0/cvsroot checkout gcp
compile...

Changes in Walt's code:

MasRunfileParse.cc L 497 onboard = share_->findRegMapBoard (board_name);

Compilation errors for Walt

MasRunfileParse.cc
MasRunfileParse.cc:218: warning: division by zero in ‘0.0 / 0.’

MasRunfileParse.cc:255: warning: large integer implicitly truncated to unsigned type

Check in Changes:

antenna/control/bicep/Data.cc
$ cvs commit -m 'Clear obsolete function run()' Data.cc

3/4

Issues with Frame Merging

Scanner::packMceFrame()
  - mceFrame->readReg( mceNum->getMceName(), "frameNumber", frameNumber );
  - frame->writeMceRegMap(mceFrame, true); // should this be true or false?
  - How does the "frame" board work? It appears in regmap.c, and seems to be per_regmap.
Antenna layer
  - How are Antenna Frames being packed?

* Check in Scanner changes
$ cvs commit -m 'Merge frames from the Antenna and Masd layers' Scanner.h
$ cvs commit -m 'Merge frames from the Antenna and Masd layers' Scanner.cc

Basic CVS commands used by BaBar

http://www.slac.stanford.edu/BFROOT/www/doc/cvs/cvs-babar-basic.html

Currently at DataNew::serviceMsgQ()
  - bufferHKData()

Need Now:
  - Description of gcp for email to Erik

3/5

Reviewing Walt's changes

DataNew.cc
In incrementSampleCount()
  - What is the point of first=true? Is it not always true?
  - We are now calling bufferFrameNumber(iSamp) twice.

Description of BICEP1 TO BICEP2

Changes to gcp:

Masd Layer:
This is a full threaded program that is similar to the Antenna layer in structure.
Master thread has 4 sub-threads:
  - MasdControl
  - MasdMonitor
  - MasdSignal
  - MceRx: sub-threads Data, CommandTask

Data is read into the masd from the MAS software writing to a device node on bicep1. The Data task has a select loop that triggers when the device node becomes readable. Data frames are packed at a rate of NSAMPLESPERFRAME fast frames per slow frame. These frames are then sent to the Mediator layer through a TCP connection that is almost identical to the connection between the Antenna layer and the Mediator layer. Data frames are sent to the Mediator immediatly after they are filled.

Antenna Layer:
The Antenna Layer is now only responsible for house-keeping data, and pmac data. The DataNew thread has a select loop that triggers when a DV pulse from the external Sync Box arrives on the BBC PCI card. The arrival of this DV pulse triggers the Antenna Layer to sample all of its registers, including the Pmac, house keeping, and gps. These are packed into data frames at a rate of NSAMPLESPERFRAME fast frames per slow frame. The beginning of each new slow frame is defined as a frame number that is divisible by NSAMPLESPERFRAME. Data frames are sent to the Mediator immediatly after they are filled.

Mediator Layer:
In the mediator layer, a new thread MceConsumer was added to the Scanner thread. This class deals with all contact between the Mediator and Masd layers.
Data frames are automatically sent from the Antenna and Masd layer up to the Mediator layer. In the Scanner thread, when a new frame arrives it is put into the ArrayFrameBuffer of the Scanner. It is inserted according to its slow-register Sync Box frame number. There are two possible scenerios:
1) If a masd frame arrives after the antenna frame that has a matching frame number (or vica versa), the antenna frame will already be in the ArrayFrameBuffer. In this case the masd registers are written to the corresponding frame that already contains the Antenna Layer registers. In this case, this frame is now full.
2) If the masd frame (or antenna frame) arives first, a new frame is created in the frame buffer, and is indexed by the slow-register frame number.

When the ArrayFrameBuffer length exceeds a fixed number (currently 4), the oldest frame is packed and sent to the Control Layer.

Thus if frames only arrive from one source (masd or antenna), half-filled frames will continue to flow through the system. However if frames stop arriving from both the masd and antenna layers, flow will stop completely.


check out gcp from CVS onto spudws2

See notes page.

Email to Erik

Hi Erik,
There are a few residual questions about the gcp that it would be helpful for you to
comment on.

1) Are you happy with the general scheme of how we are implementing adding the mce
receivers to the gcp? I have written a general description here:
http://bmode.caltech.edu/~spuder/control_software/notes.html#20090305
If you don't have access to the spuder page, the same information is here:
http://find.uchicago.edu/~kstory/notebook/index.html#sec86

2) What is the difference between "locking" and not locking frames
when we write them? For example, in
mediator/bicep/Scanner::packAntennaFrame, I am calling:

frame->writeAntennaRegMap(*antFrame, true);
In BICEP1, the same method called
frame->writeAntennaRegMap(*antFrame, false);

I changed the lockFrame input parameter to "true" because there is a
possibility of an antenna and mce frame arriving and both trying to
write to the same data frame at the same time. But I don't really
understand how the lock works.

3) what does the tfp kernel module do, and how does it relate to the gps kernel module?

Thank you,
Kyle

3/6

First attempt at running MCE from gcp: email from Walt.

Hi Kyle,

I tried hooking up GCP to a real MCE tonight.   There were two readily
apparent issues: 1) input on the data pipe didn't block as expected; and 2)
the sync box numbers didn't appear in the frame files.

Number (1) is puzzling.  As long as the file descriptor is opened for reading
without specifying O_NONBLOCK, a read() call shouldn't return until the
requested number of bytes are read in, or the end of file is reached.  And EOF
should be impossible because we always keep at least one writer open.  We may
need to add a loop in mas daemon to accumulate the specified frame size.  This
is surprising and a little inconvenient, but not a big problem.

For Number (2) I'll have to ask the MCE experts.

Side note: we could have the mas daemon pack and send frames even when the
sync box is not used; just count out NSAMPLESPERFRAME with a counter when
cc.use_sync is not equal to 2.

- Walt

Details of what I did:
* compiled gcp on bicep4
* made pipes at /data/cryo/mas_data_pipe, /data/cryo/mas_data_pipe.run
* used development MCE crate, sitting on a desk (no cryostat)
* connected MCE to bicep4 fiber card and to sync box via fiber (LEDs confirm the
connection is correct)
* MCE power on
* mce_reset_clean
* set MCE to use sync box: mce_cmd -x WB cc use_sync 2
* modified mce_fast_acq to use the file names I want
* two tests: (1) write to files, cat files into pipes afterward
                   (2) write directly to pipes

3/8

Doxygen for current gcp

ssh bicep1
$ doxygen -g Doxyfile.cfg

I need to get the version of Doxygen updated on spudws2.

To Do:
  - antenna/./DataNew::serviceMsgQ(), check over -> DONE
  - Fix (first) in masd/Data::incrementSampleCount() -> DONE
  - Fix timeOut_ in masd/Data::incrementSampleCount() -> DONE

For tomorrow:
  - Check that Antenna layer works, and check in DataNew.cc -> DONE
  - Data::incrementSampleCount() -> DONE
  - Understand MasBoard and various Mas_Parse classes.

3/9

Monitor Issues

My second monitor was jittering and flickering.
Try 1: switch cables between monitors. Jittering followed the cable.
Try 2: Use a 3rd cable. Jittering was still there
Try 3: Re-boot the computer. This caused my computer to not recognize the second monitor at all.
Try 4: Log out and back in. Monitor is fine now.

What!?! Must have been something with rebooting.

To Do:
  - change fields to fields_

Done:
  - antenna/./DataNew::serviceMsgQ(), check over
  - Fix (first) in masd/Data::incrementSampleCount()
  - Fix timeOut_ in masd/Data::incrementSampleCount()
  - add simDataTimeOutMicroSeconds_ to Data.h
  - Understand MasBoard and various Mas_Parse classes.

3/10

Remove reference to "box" in masd

- CommandMsg.h // commented out, leave for now.
  - CommandTask -> DONE
  - Data.cc -> DONE
  - MceRx.cc -> DONE
  - MceRxMsg -> ok for now; we will have to change this later anyway.
  - rtcnetcoms.c, datasystem_cmd_members // remove box, nbox // later

To Do:
  - Talk to BlastBus Pci card to get HK information
  - Commands to the mce

Later:

Phone call with Walt:

3/11

Packing problems with frames

- Need to make sure that Antenna Layer bufferPmac() is not screwed up by my current plan. -> FIXED
  - What if we skip multiple frames? -> DONE
  - Need to reinitialize arrays. -> Still need masd, pmac

3/12

More packing

I'm not sure how to zero out the pmac registers.

Conflicts occur in:
DataBase.h -> fixed
DataNew.cc -> fixed, check bufferBlastBus...
SyncBoard.cc -> fixed

Commit Antenna Layer frame packing code to cvs

$ cvs commit -m 'fix Antenna layer frame packing'

Checking in antenna/control/bicep/DataBase.cc;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/DataBase.cc,v  <--  DataBase.cc
new revision: 1.12; previous revision: 1.11
done
Checking in antenna/control/bicep/DataBase.h;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/DataBase.h,v  <--  DataBase.h
new revision: 1.8; previous revision: 1.7
done
Checking in antenna/control/bicep/DataNew.cc;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/DataNew.cc,v  <--  DataNew.cc
new revision: 1.17; previous revision: 1.16
done
Checking in antenna/control/bicep/DataNew.h;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/DataNew.h,v  <--  DataNew.h
new revision: 1.9; previous revision: 1.8
done
Checking in antenna/control/bicep/NetDataParse.cc;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/NetDataParse.cc,v  <--  NetDataParse.cc
new revision: 1.3; previous revision: 1.2
done
Checking in antenna/control/bicep/NetDataParse.h;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/NetDataParse.h,v  <--  NetDataParse.h
new revision: 1.3; previous revision: 1.2
done
Checking in antenna/control/bicep/SyncBoard.cc;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/SyncBoard.cc,v  <--  SyncBoard.cc
new revision: 1.6; previous revision: 1.5
done
Checking in antenna/control/bicep/SyncBoard.h;
/home/bicep0/cvsroot/gcp/antenna/control/bicep/SyncBoard.h,v  <--  SyncBoard.h
new revision: 1.4; previous revision: 1.3
done
Checking in control/code/unix/libunix_src/bicep/devicemap.h;
/home/bicep0/cvsroot/gcp/control/code/unix/libunix_src/bicep/devicemap.h,v  <--  devicemap.h
new revision: 1.4; previous revision: 1.3
done
Checking in masd/bicep/CommandTask.h;
/home/bicep0/cvsroot/gcp/masd/bicep/CommandTask.h,v  <--  CommandTask.h
new revision: 1.2; previous revision: 1.1
done
Checking in masd/bicep/Data.cc;
/home/bicep0/cvsroot/gcp/masd/bicep/Data.cc,v  <--  Data.cc
new revision: 1.9; previous revision: 1.8
done
Checking in masd/bicep/Data.h;
/home/bicep0/cvsroot/gcp/masd/bicep/Data.h,v  <--  Data.h
new revision: 1.3; previous revision: 1.2
done
Checking in masd/bicep/DataBase.cc;
/home/bicep0/cvsroot/gcp/masd/bicep/DataBase.cc,v  <--  DataBase.cc
new revision: 1.9; previous revision: 1.8
done
Checking in masd/bicep/DataBase.h;
/home/bicep0/cvsroot/gcp/masd/bicep/DataBase.h,v  <--  DataBase.h
new revision: 1.6; previous revision: 1.5
done
Checking in masd/bicep/MasSyncParse.cc;
/home/bicep0/cvsroot/gcp/masd/bicep/MasSyncParse.cc,v  <--  MasSyncParse.cc
new revision: 1.4; previous revision: 1.3
done
Checking in masd/bicep/MasSyncParse.h;
/home/bicep0/cvsroot/gcp/masd/bicep/MasSyncParse.h,v  <--  MasSyncParse.h
new revision: 1.2; previous revision: 1.1
done
Checking in masd/bicep/MceRx.cc;
/home/bicep0/cvsroot/gcp/masd/bicep/MceRx.cc,v  <--  MceRx.cc
new revision: 1.2; previous revision: 1.1
done
Checking in util/common/NetMsgHandler.cc;
/home/bicep0/cvsroot/gcp/util/common/NetMsgHandler.cc,v  <--  NetMsgHandler.cc
new revision: 1.5; previous revision: 1.4
done

simulate time in Antenna Layer

- antenna simuate time
Done.

Masd frame packing

To Do:
  - masd frame packing
Done

3/13

Startup Scripts

To add to CVS:
  - misc/scripts/common/bashKillAll
  - misc/scripts/bicep/basicStart
  - misc/scripts/bicep/basicStop

Goals for Caltech trip

- Set up new mce computer.
    ==literally copy hard-drive from bicep1
  - Archiving frames
  - Matlab something

To Do:
  - remove dataport from bin_AntennaControl
    simdata in bin_AntennaControl?
  - pipe names in bin_MasdControl?
  - make misc/scripts/common/killAll work with both tcsh and bash

Random note:
I ran g++ with the flag -O3, which optimizes code.

3/16 : At Caltech

Projects while at Caltech

- Startup scripts:
    fix basicStartup
    move everything to correct directory
  - Wrap antenna frame numbers
  - add underscores to masd fields
Frame packing:
  - Check that first frames are packing correctly
  - Standardize proceedure
  - time out -> write slow frame
      need to add a check for completely empty frames.
New Computer
  - get new computer running
  - Mce crate working to form a complete development system

  - Learn about TES devices and their readout via MCE.
      Squid tuning
      Squid readout
Archiving

Fix basicStartup

The problem was that
GCP_DIR was not defined for the control program.

Frame Packing

Frame Packing Recipe
Definitions:

    * "sample": a single data valid pulse from the sync box, and all the readings that go with it at the fast rate.
    * "frame": a data structure consisting of a fixed number of samples, and including readings that go at the slow rate.
    * SPF: number of samples per frame, the ratio between the fast and
      slow data rates (currently 50 in testing, may be 100 later?)

Recipe:

    * The first sample arrives with sync box frame stamp FN.
    * Create a buffer for a new frame.
    * Calculate the sample # within the frame, iSamp = (FN mod SPF).
    * Calculate the frame serial number, SN = FN - (FN mod SPF).
    * Calculate the limits of the current frame,
      first_fast = SN
      last_fast = SN + SPF - 1
    * As samples arrive with first_fast ≤ FN ≤ last_fast, pack them into the buffer.
    * When a sample arrives with FN < first_fast or FN > last_fast, this signals a new frame:
          o Pick out the sync box #
          o Buffer a new sample to a new buffer
          o Finish and send off the old frame
          o Set the new first_fast and last_fast in the same way as for the first sample
            (i.e. by calculating from the new FN, not by incrementing the old values).
    * Whenever the main select() loop times out, pack and send off the current frame,
        but don't take any new readings. This prevents any data from getting trapped in
        the buffers if we stop acquisition. Set this timeout to 1 second.

Antenna Layer Frame Packing

Double Buffers: (This is not current any more)
SyncBoard
  - fastFrameNumber_arr_
  - fastFrameNumber_arr_next_
  - frame_serialNumber_
  - frame_serialNumber_next_

Needs Fix:
  - Time out in DataNew needs more thought.
  - Double buffers for Pmac
  - Double buffers for BlastBus
  - It looks like GPS already has simulate mode in Tfp.cc
  - I am not sure I am zeroing the date correctly in antenna layer

Tomorrow:
  - look into RegMapDataFrameManager::packData() L602

3/17

Raid: 3dm2 on new machine

$ sudo 3dm2 start

From bicep1 (test), open firefox.
log onto https://
localhost:888/

Administrator
pw 3ware

Continue Antenna Layer Frame Packing

Done:
  - skipped samples, frames -> DONE
  - Zeroing time in Antenna Layer -> DONE

To Do:
  - writeReg() -> does it do what I want?
      look into RegMapDataFrameManager::packData() L602
  - Double buffers for Pmac -> Maybe not
  - Why does the mediator wait for a while before printing out frames it has received?
      Probably has to do with initialization and connection messages and setup.


New Model:
When the last sample Number has arrived, buffer and send off the frame.
  - If we have skipped over a frame boundary, write off the old frame before buffering the new information.

Running new mce system

Run Masd
/home/bicep/gcp/bin/bicepMasdControl host=bicep1.caltech.edu mce=0 cmdport=1600 logd=/home/bicep/gcp/runlogs logf=bicepTestControl debuglevel=0 prio=f simdata=f pipe_data=/data/cryo/mas_data_pipe pipe_runfile=/data/cryo/mas_data_pipe.run

$ mce_clock_mode 1 2 2
$ ./mce_pipe_acq 10000 1 75 33

3/18

More Antenna Layer Frame Packing

New plan.

Frame Packing (2)

Frame Packing Recipe new
Definitions:
    * SN = Sample Number, (fast_frame number)
    * FN = Frame serial number (slow_frame number)
    * SPF = NSAMPLESPERFRAME
    * first_ = first_sampInFrame_, the first index in current frame
    * last_ = last_sampleInFrame_, the last index in current frame

Recipe:

  Normal operation:
    * A new sample (SN) arrives
    * if this is the first sample, or we have started a new frame,
      set the Frame Counters:
          o FN = SN - (SN mod SPF)
          o first_ = FN
          o last_ = FN + SPF - 1
    * Calculate the sample number within the frame, iSamp = SN mod SPF
    Case: first_ ≤ SN < last_
          In this case, the current sample is within the current frame
          o Buffer sample into current buffer
    case: SN == last_
          In this case, the current sample is the last in this frame
          o Buffer this last sample into the current buffer
          o Write and send off old frame
          o re-initialize buffers to zero
          o flag to re-set Frame Counters

    case: (SN > last_) or (SN < first_)
          In this case, we have either skipped over a frame boundary
            or they sync numbers have wrapped around.
          o write and send off old frame
          o re-initialize buffers to zero
          o re-set the Frame Counters
              - FN = SN - (SN mod SPF)
              - first_ = FN
              - last_ = FN + SPF - 1
          o Buffer current sample in new buffer

  Special Cases:
    * Whenever the main select() loop times out
          o if this is the first time we have time out:
              - write and send off old frame
              - flag to re-set Frame Counters
              - reset timers to fast timeOut
          o Otherwise do nothing

Add notebook entry

Log onto bmode under account bicep. Logbook is in:
/home/spuder/public_html/control_software/notes.html

Checks to Run:
  - sim mod 995

Frame packing in Masd

It is almost identical to the Antenna Layer. !!! Yay!!!

3/19

Image of the running gcp

Try to break the masd now with different cases.

Zeroing registers in masd; why isn't it working? -> because I am not doing it!

Zero registers in Masd

ok

Useful timing information
http://rabbit.eng.miami.edu/info/functions/time.html#gtod

Running the Sync Box

From a terminal on bicep1, run:

$ gtkterm &

In gtkterm, for the help menu type:

Synco> help
    h       help, this stuff
    ?       get Mancho Status
...

Commands:
  - h help
  - ? get Manco Status
  - rl n set Row_Len, n=1 to 4095
  - nr n set Num_Rows, n=1 to 63
  - rt set RTS_Mode
  - fr n set FreeRun Mode n=1 to 4095
  - fn n set Frame Sequence Number, n=0 to 2^32-1
  - st stop
  - go enable Manchout
  - dpa pwr diable all
  - dpu n pwr disable unit, n=0 to 7
  - epu n pwer enable unit, n=0 to 7
  - pof get ACDCU_onoff cntl byte
  - ps get ACDCU status
  - re Reset all to defaults

Note Row_Len is 1/2 of the value for the MCE, i.e.
Row_Len(Sync) = 50 > Row_Len(MCE) 100

Use (?) to get the current settings:

blah

Sync Box data Rate

Set the DV pulse rate as follows:
Rate = 50Mhz / (2*Row_Len * Num_Row * FRun_Count )

Thus, to get 100 HZ:
rl 50
nr 50
fr 100

Sync Box device node:
/dev/ttyUSB0

Running on bicep1

Run the sync box
  - gtkterm

Running on bicep2

Run the Mce

script: in /home/bicep/
mce_pipe_acq

MAS_SCRIPT is /usr/mce/mce_script//script/

pipes:
/data/cryo/mas_data_pipe
/data/cryo/mas_data_pipe.run

Device Nodes: set up in /etc/rc.local with the following:
modprobe mce_dsp
/usr/mce/bin/mas_mknodes
sudo -u bicep /usr/mce/bin/maslog_server

Device nodes are: mce_cmd0, mce_data0, mce_dsp0, mcelog

bicep@bicep2:~$ ls -l /dev/ |grep mce
crw-rw-r-- 1 root mce 247, 0 2009-03-19 19:32 mce_cmd0
crw-rw-r-- 1 root mce 246, 0 2009-03-19 19:32 mce_data0
crw-rw-r-- 1 root mce 248, 0 2009-03-19 19:32 mce_dsp0
crw-rw---- 1 root root 10, 227 2009-03-19 16:41 mcelog

Tell the mce to run off of the sync box:
mce_clock_mode 1 2 2
./mce_pipe_acq [#frames] [readout cards] [data rate] [#rows]

data rate -> down-sampling. Must match the sync box.

This worked:

Synco> nr 33
Synco> rl 75
Synco> fr 100

$ ./mce_pipe_acq 1000 1 100 33

Re-set the MCE:
$ mce_cmd -x mce_reset
$ mce_cmd -x mce_dsp_reset
$ mce_cmd -x fakestop
$ mce_cmd -x empty

To Do:

Done:

3/20

Today:
  - timing of write command
  - Timing lag of antenna
  - zero Pmac

Antenna skipped frame numbers

All of the skipped frame numbers have zero; this means that they are not getting filled.

Try slower data rate. Set:
    fr 150

Average pack time seems to be 0.9 milliseconds. There are some random large spurts away from this, up to 30 milliseconds!

The problem does not seem to be the write process taking too long.

Here is a typical frame that skipped something:

dt_1a_mili refers to the time it takes to process a full cycle in serviceMsgQ(), after the select loop

fr 150, rl 75, nr 33

[0]  dt_1a_mili = 0.050009
[1]  dt_1a_mili = 0.046936
[2]  dt_1a_mili = 0.048333
[3]  dt_1a_mili = 0.048054
[3]  dt_1a_mili = 0.047216
[5]  dt_1a_mili = 0.047774
[6]  dt_1a_mili = 0.047215
[7]  dt_1a_mili = 0.047215
[8]  dt_1a_mili = 0.046936
[9]  dt_1a_mili = 0.046936
[10]  dt_1a_mili = 0.046936
[11]  dt_1a_mili = 0.046657
[12]  dt_1a_mili = 0.048054
[13]  dt_1a_mili = 0.062023
[14]  dt_1a_mili = 0.046936
[15]  dt_1a_mili = 0.047215
[16]  dt_1a_mili = 0.048053
[17]  dt_1a_mili = 0.047216
[18]  dt_1a_mili = 0.048054
[19]  dt_1a_mili = 0.047774
[20]  dt_1a_mili = 0.047495
[21]  dt_1a_mili = 0.047495
[22]  dt_1a_mili = 0.047216
[23]  dt_1a_mili = 0.055318
[24]  dt_1a_mili = 0.047216
[25]  dt_1a_mili = 0.046937
[26]  dt_1a_mili = 0.04973
[27]  dt_1a_mili = 0.047215
[28]  dt_1a_mili = 0.047215
[29]  dt_1a_mili = 0.047216
[30]  dt_1a_mili = 0.047215
[31]  dt_1a_mili = 0.046936
[32]  dt_1a_mili = 0.047495
[33]  dt_1a_mili = 0.049451
[34]  dt_1a_mili = 0.047494
[35]  dt_1a_mili = 0.047216
[36]  dt_1a_mili = 0.046936
[37]  dt_1a_mili = 0.048053
[38]  dt_1a_mili = 0.046936
[39]  dt_1a_mili = 0.046936
[40]  dt_1a_mili = 0.047495
[41]  dt_1a_mili = 0.046936
[42]  dt_1a_mili = 0.047216
[43]  dt_1a_mili = 0.048333
[44]  dt_1a_mili = 0.047216
[45]  dt_1a_mili = 0.048053
[46]  dt_1a_mili = 0.047215
[47]  dt_1a_mili = 0.047215
[48]  dt_1a_mili = 0.048054
*** writeFrameNumber: 93440700
 PackFail: sampleNumber_arr_[3] = 93440703
           sampleNumber_arr_[4] = 0
           frame_serialNumber    = 93440700
 PackFail: sampleNumber_arr_[4] = 0
           sampleNumber_arr_[5] = 93440705
           frame_serialNumber    = 93440700
  -- dt_1wa_mili = 0.828924
  -- dt_1wb_mili = 0.838144
[49]  dt_1a_mili = 0.896814

The problem seems to be that the sync box is skipping numbers!!
The device node becomes readable as it is supposed to, but the same sequence number is read from the node.

SyncBoard::readFrameNumber() is printing from the readFrameNumber() function in SyncBoard.
before ISC[iSamp] is printing from DataNew::serviceMsgQ(), right before calling incrementSampleCount(iSamp).
buffer[iSamp] is printing from DataNew::serviceMsgQ(), right before calling bufferFrameNumber().

SyncBoard::readFrameNumber() : 93539983
before ISC[32] : 93539983
 - buffer[33] : 93539983
[33]  total Loop time = 0.055597
SyncBoard::readFrameNumber() : 93539984
before ISC[33] : 93539984
 - buffer[34] : 93539984
[34]  total Loop time = 0.061464
SyncBoard::readFrameNumber() : 93539984
before ISC[34] : 93539984
 - buffer[34] : 93539984
[34]  total Loop time = 0.058111
SyncBoard::readFrameNumber() : 93539986
before ISC[34] : 93539986
 - buffer[36] : 93539986
[36]  total Loop time = 0.057832
SyncBoard::readFrameNumber() : 93539987
before ISC[36] : 93539987
 - buffer[37] : 93539987
[37]  total Loop time = 0.07208

...

*** writeFrameNumber: 93539950
 PackFail: sampleNumber_arr_[35] = 0
           sampleNumber_arr_[36] = 93539986
           frame_serialNumber    = 93539950

Try a faster rate, see if it happens more often.

fr 100, rl 75, nr 33

SyncBoard::readFrameNumber() : 93832911
before ISC[10] : 93832911
 - buffer[11] : 93832911
[11]  total Loop time = 0.056993
SyncBoard::readFrameNumber() : 93832911
before ISC[11] : 93832911
 - buffer[11] : 93832911
[11]  total Loop time = 0.056994
SyncBoard::readFrameNumber() : 93832913
before ISC[11] : 93832913
 - buffer[13] : 93832913
[13]  total Loop time = 0.063698

Running faster does not seem to make the Antenna layer skip more samples.

fr 50, rl 75, nr 33

*** writeFrameNumber: 93847550
  -- dt_1wa_mili = 0.817469
  -- dt_1wb_mili = 0.827248

*** writeFrameNumber: 93847600
  -- dt_1wa_mili = 0.813838
  -- dt_1wb_mili = 0.822498

SyncBoard::readFrameNumber() : 93847650
before ISC[49] : 93847650
 - buffer[0] : 93847650
[0]  total Loop time = 0.077389
SyncBoard::readFrameNumber() : 93847650
before ISC[0] : 93847650
 - buffer[0] : 93847650
[0]  total Loop time = 0.057273

*** writeFrameNumber: 93847650
 PackFail: sampleNumber_arr_[0] = 93847650
           sampleNumber_arr_[1] = 0
           frame_serialNumber    = 93847650
 PackFail: sampleNumber_arr_[1] = 0
           sampleNumber_arr_[2] = 93847652
           frame_serialNumber    = 93847650
  -- dt_1wa_mili = 0.84848
  -- dt_1wb_mili = 3.2425

*** writeFrameNumber: 93847700
  -- dt_1wa_mili = 0.823057
  -- dt_1wb_mili = 3.09023

*** writeFrameNumber: 93847750
  -- dt_1wa_mili = 0.823336
  -- dt_1wb_mili = 3.09163

fr 5, rl 75. nr 33

*** writeFrameNumber: 93989500
  -- dt_1wa_mili = 0.831159
  -- dt_1wb_mili = 0.833394

*** writeFrameNumber: 93989550
  -- dt_1wa_mili = 0.864684
  -- dt_1wb_mili = 0.86664

*** writeFrameNumber: 93989600
  -- dt_1wa_mili = 0.806294
  -- dt_1wb_mili = 0.80797

*** writeFrameNumber: 93989650
  -- dt_1wa_mili = 0.796795
  -- dt_1wb_mili = 0.798471

SyncBoard::readFrameNumber() : 93989741
before ISC[40] : 93989741
 - buffer[41] : 93989741
[41]  total Loop time = 0.059508
SyncBoard::readFrameNumber() : 93989741
before ISC[41] : 93989741
 - buffer[41] : 93989741
[41]  total Loop time = 0.059508
SyncBoard::readFrameNumber() : 93989743

*** writeFrameNumber: 93989700
 PackFail: sampleNumber_arr_[41] = 93989741
           sampleNumber_arr_[42] = 0
           frame_serialNumber    = 93989700
 PackFail: sampleNumber_arr_[42] = 0
           sampleNumber_arr_[43] = 93989743
           frame_serialNumber    = 93989700
  -- dt_1wa_mili = 0.834232
  -- dt_1wb_mili = 0.835908

*** writeFrameNumber: 93989750
  -- dt_1wa_mili = 0.840378
  -- dt_1wb_mili = 0.843172

*** writeFrameNumber: 93989800
  -- dt_1wa_mili = 0.879492
  -- dt_1wb_mili = 0.881168

*** writeFrameNumber: 93989850
  -- dt_1wa_mili = 0.807132
  -- dt_1wb_mili = 0.808808


SyncBoard::readFrameNumber() : 93989924
before ISC[23] : 93989924
 - buffer[24] : 93989924
[24]  total Loop time = 0.064258
SyncBoard::readFrameNumber() : 93989924
before ISC[24] : 93989924
 - buffer[24] : 93989924
[24]  total Loop time = 0.06314
SyncBoard::readFrameNumber() : 93989926

SyncBoard::readFrameNumber() : 93989930
before ISC[29] : 93989930
 - buffer[30] : 93989930
[30]  total Loop time = 0.059787
SyncBoard::readFrameNumber() : 93989930
before ISC[30] : 93989930
 - buffer[30] : 93989930
[30]  total Loop time = 0.059509
SyncBoard::readFrameNumber() : 93989932

*** writeFrameNumber: 93989900
 PackFail: sampleNumber_arr_[24] = 93989924
           sampleNumber_arr_[25] = 0
           frame_serialNumber    = 93989900
 PackFail: sampleNumber_arr_[25] = 0
           sampleNumber_arr_[26] = 93989926
           frame_serialNumber    = 93989900
 PackFail: sampleNumber_arr_[30] = 93989930
           sampleNumber_arr_[31] = 0
           frame_serialNumber    = 93989900
 PackFail: sampleNumber_arr_[31] = 0
           sampleNumber_arr_[32] = 93989932
           frame_serialNumber    = 93989900
  -- dt_1wa_mili = 0.870551
  -- dt_1wb_mili = 0.872228

Confirm that Antenna sampple skipping does not happen in simSync

At 100 Hz, there appears to be no sample skipping.

At 1000 Hz, about 60% of the samples appear to be skipped.
Thus I am not sure why 2020 Hz in real Sync Box mode seemed to work?

Timing Lag in Antenna Layer: between DV pulse and sampling.

These are time differences between the select loop triggering, and calling the relevant buffer function.


(micro seconds)
dt_Time dt_Pmac dt_Blast
2.794   5.867   51.127
3.352   6.705   52.803
3.073   6.146   51.126
2.794   5.867   50.847
3.073   6.705   64.257
3.074   6.426   50.848
2.793   5.587   49.729
2.794   5.588   49.73
2.514   5.587   49.73

Averages:
2.918   6.053   52.244
Standard Deviation:
0.232   0.437   4.346
8.0%    7.2%    8.3%
Gaussian errors (sqrt(N))
0.973   2.017   17.415

^^^^ dt_Time_micro  = 2.794
     dt_Pmac_micro  = 5.867
     dt_Blast_micro = 51.127
^^^^ dt_Time_micro  = 3.352
     dt_Pmac_micro  = 6.705
     dt_Blast_micro = 52.803
^^^^ dt_Time_micro  = 3.073
     dt_Pmac_micro  = 6.146
     dt_Blast_micro = 51.126
^^^^ dt_Time_micro  = 2.794
     dt_Pmac_micro  = 5.867
     dt_Blast_micro = 50.847
^^^^ dt_Time_micro  = 3.073
     dt_Pmac_micro  = 6.705
     dt_Blast_micro = 64.257
^^^^ dt_Time_micro  = 3.074
     dt_Pmac_micro  = 6.426
     dt_Blast_micro = 50.848
^^^^ dt_Time_micro  = 2.793
     dt_Pmac_micro  = 5.587
     dt_Blast_micro = 49.729
^^^^ dt_Time_micro  = 2.794
     dt_Pmac_micro  = 5.588
     dt_Blast_micro = 49.73
^^^^ dt_Time_micro  = 2.514
     dt_Pmac_micro  = 5.587
     dt_Blast_micro = 49.73

Check sample skipping in Masd

Check this in the Masd layer.

It does not seem to be skipping any frames at all.

Typical Output:

100 Hz:
fr=100, rl=75, nr=33
$ ./mce_pipe_acq 10000 1 100 33

*** writeFrameNumber: 99334600
WriteMceData timing:
  * dt_run_mili = 3.13019
  * dt_data_mili = 5.69518
  * dt_header_mili = 0.201434
  * dt_sync_mili = 0.035202
  -- dt_1wa_mili (writeMceData) = 9.25366
  -- dt_1wb_mili (snd Pack msg) = 9.26623
*** writeFrameNumber: 99334650
WriteMceData timing:
  * dt_run_mili = 3.16148
  * dt_data_mili = 5.67172
  * dt_header_mili = 0.200316
  * dt_sync_mili = 0.035202
  -- dt_1wa_mili (writeMceData) = 9.25925
  -- dt_1wb_mili (snd Pack msg) = 9.27182
*** writeFrameNumber: 99334700
WriteMceData timing:
  * dt_run_mili = 3.15309
  * dt_data_mili = 5.67172
  * dt_header_mili = 0.200037
  * dt_sync_mili = 0.034922
  -- dt_1wa_mili (writeMceData) = 9.24807
  -- dt_1wb_mili (snd Pack msg) = 9.25981
*** writeFrameNumber: 99334750
WriteMceData timing:
  * dt_run_mili = 3.14974
  * dt_data_mili = 5.68457
  * dt_header_mili = 0.200317
  * dt_sync_mili = 0.035202
  -- dt_1wa_mili (writeMceData) = 9.25897
  -- dt_1wb_mili (snd Pack msg) = 9.27098

.

400 Hz:
fr=25, rl=75, nr=33
$ ./mce_pipe_acq 4000 1 25 33

*** writeFrameNumber: 99451000
WriteMceData timing:
  * dt_run_mili = 3.14751
  * dt_data_mili = 5.88544
  * dt_header_mili = 0.202272
  * dt_sync_mili = 0.035202
  -- dt_1wa_mili (writeMceData) = 9.47409
  -- dt_1wb_mili (snd Pack msg) = 9.48471
*** writeFrameNumber: 99451050
WriteMceData timing:
  * dt_run_mili = 3.17209
  * dt_data_mili = 5.779
  * dt_header_mili = 0.202551
  * dt_sync_mili = 0.035202
  -- dt_1wa_mili (writeMceData) = 9.38413
  -- dt_1wb_mili (snd Pack msg) = 9.39391
*** writeFrameNumber: 99451100
WriteMceData timing:
  * dt_run_mili = 3.14471
  * dt_data_mili = 5.6449
  * dt_header_mili = 0.200596
  * dt_sync_mili = 0.034922
  -- dt_1wa_mili (writeMceData) = 9.21902
  -- dt_1wb_mili (snd Pack msg) = 9.22963
*** writeFrameNumber: 99451150
WriteMceData timing:
  * dt_run_mili = 3.13382
  * dt_data_mili = 5.64797
  * dt_header_mili = 0.200316
  * dt_sync_mili = 0.035481
  -- dt_1wa_mili (writeMceData) = 9.33217
  -- dt_1wb_mili (snd Pack msg) = 9.34921

Current running commands:

Control:
bicep@bicep1:~/gcp/scripts/bicep$ /home/bicep/gcp/bin/bicepControl logd=/home/bicep/gcp/runlogs logf=bicepTestControl

Mediator:
bicep@bicep1:~/gcp/scripts/bicep$ /home/bicep/gcp/bin/bicepMediator host=localhost logd=/home/bicep/gcp/runlogs logf=bicepTestMediator

Antenna:
bicep@bicep1:~/gcp/scripts/bicep$ /home/bicep/gcp/bin/bicepAntennaControl host=localhost antenna=0 dataport=1500 cmdport=1600 simpmac=f simdata=t simgps=t sim1pps=t logd=/home/bicep/gcp/runlogs logf=bicepTestAntennaControl debuglevel=0 prio=f simblast=t simSync=f

Masd:
bicep@bicep2:~/gcp/scripts/bicep$ /home/bicep/gcp/bin/bicepMasdControl host=bicep1.caltech.edu mce=0 cmdport=1600 logd=/home/bicep/gcp/runlogs logf=bicepTestMasdControl debuglevel=0 prio=f pipe_data=/data/cryo/mas_data_pipe pipe_runfile=/data/cryo/mas_data_pipe.run simdata=f

bicep@bicep2:~$ ./mce_pipe_acq 600 1 100 33

3/30

CVS web

http://bicep0.caltech.edu/cgi-bin/cvsweb/cvsweb.cgi/gcp/

3/31

Computer Names at Caltech

The computers in the high bay have been renamed to make them clearly distinct
from the bicep analysis cluster in Bridge. From now on, numbers 0-19 are
reserved for Bridge, and 30-39 for the high bay. Specific machines:

* bicep34, formerly bicep4, is the primary MCE computer
* bicep31, formerly bicep1, is the GCP development machine
* bicep33, formerly bicep3, is the Dell desktop machine on the desk in the southeast corner
* bicep2 is the new machine from Chicago, used for the test MCE crate.

Trace data frame handling in Control Layer

control/code/unix/control_src/common/

genericcontrol.c

Program::main() {
  ControlProg* cp;
  cp = new_ControlProg(
  ...
  cp_event_loop(cp);
}

static ControlProg* new_ControlProg(std::string startupScript) {
  initialize everything to NULL or 0;
  for(i=0; i     CpThread* t = cp->thread + i;
    t->type = thread_table + i;

  cp->arraymap = new_Arraymap();
  cp->pipe = new_PipeChan(...) // shutdown message pipe



}

static int cp_event_loop(ControlProg* cp); {
  nready = select(...);
  case -1:
    error
  default:
    If an active channel is found, call its I/O method.

    check for connection requests on the control-server port
}

struct ControlProg {
  ArrayMap* arraymap
  PipeChan* pipe
  CpThread thread[NTHREAD]
  RtController* rtc
  RtScanner* rts
  RtoptCam* rto
  MonitorServer* ms
  ImMonitorServer* ims
  ControlServer* cs
  ComList active_list
  fd_set read_fds
  fd_set send_fds
  int fd_set_size
  CpWhatNext whatnext
  gcp::util::AntNum defaultAntSet
  std::string* startupScript_
}

static CpThreadType thread_table[] = {
  {CP_SCHEDULER, ...
  {CP_ARCHIVER, ...
  {CP_LOGGER, ...
  {CP_NAVIGATOR, ...
  {CP_GRABBER, ...
  {CP_TERM, ...
}
enum {NTHREAD = sizeof(thread_table)/sizeof(thread_table[0])}

typdedf struct {
  CpThreadType* type
  PipeChan* pipe
  void* state
  pthread_t thread
  int running
} CpThread;

typedef struct {
  CpThreadId id
  CP_NEW_FN(* new_fn)
  CP_DEL_FN(* del_fn)
  CP_THREAD_FN(* start_fn)
  CP_STOP_FN(* stop_fn)
  PIPE_SENT_FN(* sent_fn)
  size_t sizeof_message
} CpThreadType;

genericcontrol.h
struct ComAspect {
  ComHeader* parent
  int fd
  fd_set* active_set
  CHAN_IO_FN(* io_fn)
  ComAspect* next
  ComAspect* prev
}

struct ComHeader {
  ChanType type
  void* client_data
  ComAspect read
  ComAspect write
}


CHAN_IO_FN(fn) void (fn)(ControlProg* cp, ComHeader* head)


Questions:
  - How do I delete struct SquidRegs? is delete squidRegs_ enough?