Database Setup


Once all of the appropriate shell scripts have been fixed, a database must be constructed so that RunControl knows where to look for incoming data... and where to store it. The first step is to make sure every component of CODA is working on the linux CPU. Then, next step is to move the ROC to the VME CPU.
Word of caution: The captures and explanations below are an example of the configuration used on a working database. Pathnames used (e.g. /home/adaq/...) should be replaced with whatever setup you are using.

ROC on linux


In cedit, create a new Database by selecting from the File tab "New Database ...". The database name needs to be the same name that you have indicated in the "codausersetup" script as EXPID.
Next, open a new session by selecting from the File tab "New ..." The name of this session should probably be indicative of this test configuration. Because I didn't have a whole lot of creativity when I wrote mine, I named it "inj1"
First create the ROC by clicking on the second icon from the top on the left side of the cedit GUI. It looks like this . Point the mouse cursor into the cedit Drawing board and click to drop the ROC. Once it has been placed, a window should open up asking you for Component Attributes:

In this case, I have labeled the Linux ROC as ROCU. Set your "Ethernet Host" as the Domain name of your linux computer. The "Id Number" doesn't need to be 10, but each database component must be unique integer between 0 and 31. Copy the "Booting String" as well as the Readout List (fix the line so that it points to the location of unix_list.so... or compile it yourself with unix_list.crl using "makelist unix_list native"). Make sure to keep "mystring" as it is. It's probably used internally by CODA.
Now create an Event Builder by selecting the third icon from the top. Once it has been placed, it's component attributes must be indicated:

Connect these two components in the Drawing board by right clicking on the Green Box of the ROCU and dragging over to the left Green Box of the EB1. A red arrow should be drawn:

Create an Event Recorder and indicate it's attributes:

Create a CodaFile and indicate it's attributes:

Connect the EventRecorder to the CodaFile, as was done for the ROCU and EB1. All together, the Drawing Board should look like:

Save your Run Type, by choosing "Save" or "Save As ..." in the File Tab.

Unfortunately, using cedit isn't the whole story for the database configuration. Now close cedit, and open up dbedit. Here's the opening screen:

Under "HOST:" you can type the name of your Msql host or use the pulldown menu . Click on the checkmark, and a new tab with the label of your Msql host should appear:

Click on this host Tab, and a new screen should appear. Enter the name of the EB1:halap1 database:

and first select the first table that we'll look at:

Several fields should open up, and each small window can be easily modified by right-clicking within that window. Here's the eventual output:

Make sure each field has the correct inputs.
For the ROCU:
code: {/home/adaq/crl/unix_list.so mystring}
outputs: EB1:halap1.acc.jlab.org
For EB1:
inputs: ROCU:halap1.acc.jlab.org
For coda_0:
code: {/home/adaq/data/tst_%d.dat}
inputs: ER1:halap1.acc.jlab.org

Now look at the option table:

The important value here is that of the dataFile. It's value should be the location of where you want the data to be written. If this field is not present, you can create it by clicking on the "+" Button and editting the new fields with:

The value that I have in my database is: /home/adaq/data/tst_%d.dat
The %d is a variable number set by runcontrol that indicates the current Run Number.
Exit dbedit by clicking on the dbedit tab at the top of the GUI, then click on Quit.

Hopefully, at this point, everything should be set up correctly and you can execute runcontrol and generate some test data in the location that you have specified. If this works, you're more than half-way to having a working database. You may need to execute each component in a separate window to insure that runcontrol can communicate to them. Here's a script that executes all of these components (start_stuff). Execute it before executing runcontrol.

ROC on VME


Most of what was done for the Linux setup can be used in the VME setup. Open up cedit again and create a new Run Type (in my case, it's inj2). Create a new ROC and enter it's attributes:

The Ethernet Host in this case is that of the VME. There are also two new Readout Lists: tst1.o and event_list_ppc.o (or compile them yourself with tst1.crl, event_list_ppc.crl using makelist tst1 ppc and makelist event_list_ppc ppc).
Construct your Drawing board in the same manner that was done in the inj1 example, using the same EB1, ER1, and CodaFile (perhaps changing the filename so that you don't confuse yourself). Save, and exit cedit.

Open dbedit, and make sure the tables are set correctly.
TABLE: inj2 
ROC1:
code: {/home/adaq/crl/tst1.o mystring} {/home/adaq/crl/event_list_ppc.o mystring}
outputs: EB1:halap1.acc.jlab.org
EB1:
inputs: ROC1:halladaq19
coda_0:
code: {/home/adaq/data/tst_%d.dat} {CODA}
inputs: ER1:halap1.acc.jlab.org

TABLE: inj2_option
dataFile: /home/adaq/data/tst_%d.dat

Test this configuration in runcontrol, as before. Be sure to "start_stuff" before executing runcontrol.

Other dbedit info

Just in case it's needed... below is more table information should be created when cedit creates the Database and/or RunType. This means that you probably shouldn't mess with them. Please let me know if there's something I left out, or failed to explain, at moffit@jlab.org
   inj1_option:                        inj2_option:
    

   inj1_pos:                                  inj2_pos:
    

   inj1_script: --empty                inj2_script: --empty

   links:


   priority:


   process: (beware... ROC2 is the ROC we use for production runs and is not explained here)


   runTypes:


   sessions: (beware... inj1 here is the name of the session.  Which by coicidence is the same as one of the RunTypes)

Where, the owner field must be ('IP address' 'account name' 'userID' 'groupID') :