Creating a New Database and Run Configuration using cedit --------------------------------------------------------- Below is a basic outline of how to create a new CODA mSQL database on your computer using the tools: cedit and dbedit. First things first. All database actions are made through the mSQL deamon (msqld). Therefore this program should be running on whatever host you wish the database to reside. There are two important environment variables that should be set appropriately. The first is MSQL_HOME which defines the path to the root directory to where the mSQL database will be located. The CODA default path for this is $CODA/common/rcdb. Your life will be far less complicated if you go with this default. If for some reason you cannot or do not wish the Database to reside on the same filesystem as the CODA distribution then we suggest you make a soft link for $CODA/common/rcdb to whereever you wish the database to be stored (Note: for the sake of performance the filesystem that the Database sits on should be a local one and not NFS mounted). The second environment variable that is used is called MSQL_TCP_HOST. It is simply the host name on which the msqld deamon is running. By default a CODA component will assume the localhost unless this variable is set. The second most important environment variable ($CODA is first) is EXPID. This variable is the name of the mSQL database with which all CODA components will communicate. Multiple databases can be stored in $MSQL_HOME so EXPID defines which one CODA will use. Both cedit and dbedit read the EXPID variable at startup and attempt to connect (through msqld) to that database. If EXPID is not defined then your only option upon starting up cedit will be to "Open Database..." or "New Database..." from the File menu. Once you have created the database you can now create a new configuration. New components can be creating using the icons on the left side of the GUI just below the File menu. Choose a ROC (second icon). Click once and move the cursor over to the Layout area. Click again the drop the ROC where you want it. Since this is a new component you will be prompted with a dialog box for information about the ROC: Name, ID Number (0-31), and Hostname it will run on. There are also 3 readout list fields. In the first field enter two arguments, the name of the readout list and a string: Readout List: /home/fred/coda/crl/test_list.so userString Readout List: Readout List: Execute the same poceedure to create a new Event Builder (3rd icon down). Place the new EB to the right of the ROC with some space in between them. There are no "Readout List" fields to enter for the EB. Now connect the ROC to the EB by Clicking and holding the green tab on right side of the ROC and dragging to the green tab on the left of the EB. Release the mouse. This creates a red "link" between the ROC and EB. At this stage you should SAVE your new configuration. Upon saving the names of the new ROC and EB will appear in the column directly to the right of the "New Component" icon buttons. These components are now part of your database and can be used in other configurations. Simply grab the named component rather than creating a new one. If you wish the Event builder to be able to output data to a file, you must specify the filename and path. To do this choose "options" from the file menu. This brings up a dialog entry box with a list of option "names" and their "value". Simply type in a new option name and value to the end of the list: dataLimit 0 eventLimit 0 tokenInterval 64 ---> dataFile /home/fred/data/test_%d.evt The %d will be replaced with the current run number when the file is created. Otherwise you would continue to overwrite the file. Save the configuration again and exit cedit... Now we can edit the database directly using the utility "dbedit". It allows one to manipulate individual tables and fields. Start dbedit and choose "localhost" from the pulldown menu (Otherwise you may specify the hostname where the msqld is running). Upon successful connection to the msqld a new "tab" will appear. Select the new "localhost" tab and choose your database from the Database pulldown menu. Next click on the Table pulldown menu. You will see a list of the available tables for your database. There are 4 tables related to the run configuration you just created with cedit: myconfig myconfig_option myconfig_pos myconfig_script Select the table. The field values will appear below. There will be two rows - One for the ROC and one for the EB (the two components in the configuration). Note that the "output" field for the EB is blank. This represents the default output which is to the Event Transfer system (ET). In general there are 5 output options for the EB and they are represented by specific keywords in the output field. They are: Output Keyword ------ ------- ET /dev/null none CODA Event file coda Binary File file Standard Out debug Type the keyword into the output field corresponding to the output option you desire (e.g. "none" to throw the data away) and hit return to save this value into the database. You can now exit dbedit by clicking on the "dbedit tab and then clicking the "quit" button. You are now ready to start runcontrol and begin running your test configuration. Good Luck.