From: <ro...@us...> - 2009-04-08 21:21:50
|
Revision: 2119 http://nscldaq.svn.sourceforge.net/nscldaq/?rev=2119&view=rev Author: ron-fox Date: 2009-04-08 21:21:45 +0000 (Wed, 08 Apr 2009) Log Message: ----------- - Documentation - Get readout GUI ported. - Get readout gui build added to the top level make. Modified Paths: -------------- trunk/nextgen/configure.ac trunk/nextgen/daq/readoutgui/Experiment.tcl trunk/nextgen/daq/readoutgui/InstallRoot.tcl trunk/nextgen/daq/readoutgui/Makefile.in trunk/nextgen/daq/readoutgui/ReadougGUIPanel.tcl trunk/nextgen/daq/readoutgui/ReadougGUIPanel_ui.tcl trunk/nextgen/daq/readoutgui/ReadoutGui.tcl trunk/nextgen/daq/readoutgui/ReadoutShell.tcl trunk/nextgen/daq/readoutgui/directories.tcl trunk/nextgen/sbs/nsclapi/sbsVmeApi.xml trunk/nextgen/sbs/tclpackage/vmetcl.xml Added Paths: ----------- trunk/nextgen/sbs/puretcl/camac.xml trunk/nextgen/sbs/puretcl/wienercamac.xml Removed Paths: ------------- trunk/nextgen/daq/readoutgui/KeeplistGui.tcl Modified: trunk/nextgen/configure.ac =================================================================== --- trunk/nextgen/configure.ac 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/configure.ac 2009-04-08 21:21:45 UTC (rev 2119) @@ -430,6 +430,7 @@ daq/Makefile daq/format/Makefile daq/readoutgui/Makefile + daq/readoutgui/InstallRoot.tcl usb/Makefile usb/threadcom/Makefile usb/tclcommon/Makefile Modified: trunk/nextgen/daq/readoutgui/Experiment.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/Experiment.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/Experiment.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -59,27 +59,16 @@ # Parameters: # system - The ip address or dns of the system;. proc Experiment::spectrodaqURL {system} { - set sfd [open /etc/services r] - set services [read $sfd] - close $sfd - set services [split $services "\n"] - foreach service $services { - set name [lindex $service 0] - set portproto [split [lindex $service 1] /] - set port [lindex $portproto 0] - set proto [lindex $portproto 1] - append name : proto - lappend servicelist $name $port - } - array set servicearray $servicelist + global tcl_platform + # + # URl is of the form: + # tcp://host/username + # - if {[array names servicearray sdaq-link:tcp] == ""} { - set port 2602 - } else { - set port $servicearray(sdaq-link) - } + set user $tcl_platform(user) - append url tcp:// $system : $port / + set url "tcp://$system/$user" + return $url } # Experiment::waitFile name ?granularity ?timeout?? @@ -192,6 +181,7 @@ set segment 0 set name [file join $current [ExpFileSystem::GenRunFile $run $segment]] + puts "Looking at $name" while {[file exists $name]} { file delete -force $name incr segment @@ -199,6 +189,7 @@ } # Now we can create the target dir and tar the contents of experiment current to it. + puts "Creating $targetdir" file mkdir $targetdir catch { exec sh << \ @@ -214,13 +205,17 @@ set segment 0 while {1} { + puts "Segment $segment" set file [ExpFileSystem::GenRunFile $run $segment] set srcfile [file join $eventdir $file] + puts "Ready to copy $srcfile" if {![file exists $srcfile]} { break } set dstfile [file join $targetdir $file] + puts "..to $dstfile" set linkfile [file join $complete $file] + puts "..with a link $linkfile" file rename -force $srcfile $dstfile file attributes $dstfile -permissions 0440; # Make the saved file read-only catch {exec ln -s $dstfile $linkfile};# On overwrite links may exist. @@ -262,21 +257,20 @@ set user $::tcl_platform(user) set sourceHost [DAQParameters::getSourceHost] set SourceURL [Experiment::spectrodaqURL $sourceHost] - set ftpLoghost [DAQParameters::getFtpHost] - set ftpLogpasswd [DAQParameters::getPassword] + + + set EventlogPid [exec $Logrecorder --oneshot --path=$Stagedir --source=$SourceURL &] - cd $Stagedir - - set EventlogPid [exec $Logrecorder -one -source $SourceURL &] - Experiment::makeEventLink $nrun + + set startFile [file join $Stagedir .started] - Experiment::waitFile .ready 1000 $fileWaitTimeout - if {![file exists .ready]} { - Error "The event logger is not yet ready after a very long time" + Experiment::waitFile $startFile 1000 $fileWaitTimeout + if {![file exists $startFile]} { + error "The event logger is not yet ready after a very long time" } - file delete -force .ready + file delete -force $startFile } else { set EventlogPid 0; # So emergency end won't make abnormal end file. } @@ -305,13 +299,16 @@ if {[ReadoutControl::isTapeOn]} { # # Wait for eventlog to finish. - Experiment::waitFile .done 1000 $fileWaitTimeout - if {![file exists .done]} { + + set donefile [file join [ExpFileSystem::WhereisCurrentEventData] .exited] + + Experiment::waitFile $donefile 1000 $fileWaitTimeout + if {![file exists $donefile]} { Diagnostics::Warning "eventlog may not have finished normally continuing with post run actions" } # TODO: Perhaps we should force event log to end if .done is not present yet? - file delete -force .done + file delete -force $donefile set EventlogPid 0 Modified: trunk/nextgen/daq/readoutgui/InstallRoot.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/InstallRoot.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/InstallRoot.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -1,6 +1,6 @@ package provide InstallRoot 1.0 namespace eval InstallRoot { -variable root /usr/opt/daq/8.2 +variable root /usr/opt/daq/10.0 proc Where {} { variable root return $root Deleted: trunk/nextgen/daq/readoutgui/KeeplistGui.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/KeeplistGui.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/KeeplistGui.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -1,270 +0,0 @@ -# -# This software is Copyright by the Board of Trustees of Michigan -# State University (c) Copyright 2005. -# -# You may use this software under the terms of the GNU public license -# (GPL). The terms of this license are described at: -# -# http://www.gnu.org/licenses/gpl.txt -# -# Author: -# Ron Fox -# NSCL -# Michigan State University -# East Lansing, MI 48824-1321 -# - - -package provide KeeplistGUI 2.0 -package require keeplistDialog -package require snit - -# -# This snit widget creates a dialog -# that displays the keep list dialog. -# The dialog is displayed and can be run either -# as a modal or non modal dialog. -# The package provides two helper functions: -# modalKeeplistDialog - Make a modal keeplist dialog -# keeplistDialog - Make a non modal keeplist dialog. -# -# options: -# -eligible - Set/Get the contents of the listbox -# of runs that are elligible for retension. -# -scheduled - Set/Get the contents of the listbox of runs -# that are scheduled for retension. -# -retained - Set/Get the contents of the listbox of runs -# that are already retained. -# -command - Register a script to be called when the Ok button -# is called, The script is given the widget name -# as a parameter. -# -cancelcmd - Register a script to be called when the Cancel button -# is called, the script is given the widget name as a parameter. -# Note that the command callback wrappers will destroy the GUI of the widget -# >after< the callback script is invoked. -# -# Public Methods (other than construction/destruction) -# modal - -# - -snit::widget keeplistGUI { - hulltype toplevel - option -eligible - option -scheduled - option -kept - option -command {} - option -cancelcmd {} - - # Constructor: - - constructor {args} { - keeplistDialog::init $win - $win.ok configure -command [mymethod onOk] - $win.cancel configure -command [mymethod onCancel] - $self configurelist $args - } - # Destructor: - - destructor { - } - - # Public members: - - # modal: - # Make the dialog modal. - # This is done by creating a hidden widget - # doing a grab and then a tkwait on the - # hidden window so that we exit when the - # hidden window is destroyed. - # Doing it this way also allows us to potentially - # de-modalize the dialog as a result of a -command - # (unsupported in this release) - # - method modal {} { - frame $win.hidden - grab $win - tkwait window $win.hidden - catch {grab release $win} - } - # Private members: - - method FillListBox {widget list} { - set newlist [lsort -command keeplistDialog::compareRunFiles $list] - $widget delete 0 end - foreach item $newlist { - $widget insert end $item - } - - } - # EndModalEventLoop - # If the dialog is modal ($win.hidden exists), - # the hidden widget is destroyed exiting the modal - # event loop. - # - method EndModalEventLoop {} { - if {[winfo exists $win.hidden]} { - destroy $win.hidden - } - } - # DispatchScript script parameter - # Dispatches a user script (if it is not empty) - # appending the parameter. - # - method DispatchScript {script parameter} { - if {$script != ""} { - eval $script $parameter - } - } - # Configuration set handlers: - - # Fill the elligible run list of the dialog box - # with the sorted list of runs in the list. - # The list is a set of filenames (with or without - # paths. - # The widget we are filling is $win.unkeptruns - # We use the proc - # keeplistDialog::compareRunFiles - # To help us sort the incoming list - # - onconfigure -eligible {list} { - $self FillListBox $win.unkeptruns $list - } - # Same as for -eligible - # except that the target widget is: - # $win.scheduledforkeep - onconfigure -scheduled {list} { - $self FillListBox $win.scheduledforkeep $list - } - # Same as for -eligible except that the widget - # filled is $win.keptruns - onconfigure -kept {list} { - $self FillListBox $win.keptruns $list - } - - # Configuration get handlers: - - # Retrieve and return the contents of the - # $win.unkeptruns list box. - # - oncget -eligible { - return [$win.unkeptruns get 0 end] - } - # Retrieve and return the contents of the - # $win.scheduledforkeep listbox. - # - oncget -scheduled { - return [$win.scheduledforkeep get 0 end] - } - # Retrieve and return the contents of the - # $win.kept listbox. - # - oncget -kept { - return [$win.keptruns get 0 end] - } - # Event handlers; - - # OK button was hit. - # If the user has registered a -command invoke it with the - # top level widget. - # After that, if the hidden widget exists, destroy it - # to exit the modal event loop, otherwise leave things - # well enough alone. - # - method onOk {} { - $self DispatchScript $options(-command) $win - $self EndModalEventLoop - } - # onCancel - # invokes the user's script and then destroys - # the window. Destroying the event loop ensures - # that the client cannot fetch modified lists. - # - method onCancel {} { - $self DispatchScript $options(-cancelcmd) $win - destroy $win - } -} - -namespace eval KeeplistGUI { - variable KeeplistModified 0 -} - -# KeeplistGui::StuffListBox widget filenames -# Stocks a listbox with run file names -# (not paths). The names are assumed to be -# runfiles and are inserted sorted by run number -# Parameters: -# widget - The name of the list box to stuff. -# filenames - The list of filenames (potentially with -# path information) to stuff into the box. -# -proc KeeplistGUI::StuffListBox {widget filenames} { - # First a new list with no path info: - - set nameonly "" - foreach file $filenames { - lappend nameonly [file tail $file] - } - - set nameonly [lsort -command keeplistDialog::compareRunFiles $nameonly] - - # Stuff the list box: - - foreach name $nameonly { - $widget insert end $name - } - -} - -# KeeplistGUI::KeeplistDialog Elligible Keeplist KeptList -# Let the user manipulate the kept run list. -# Kept runs are not deleted after a stage pass. -# Note that while the parameters are run files, they -# are turned into run names (e.g. run123-4096.evt). -# prior to being put in the list box. -# -# Parameters: -# Elligible - run files that are elligible for staging, but not -# marked for keep. -# KeepList - run files that are elligible for staging, but are -# scheduled to be retained. -# KeptList - Run files that have been staged and kept. -# (readonly). -# Returns the name of the toplevel widget it creates: -# -proc KeeplistGUI::keeplistDialog {topname Elligible KeepList KeptList} { - return [keeplistGUI $topname -eligible $Elligible -scheduled $KeepList -kept $KeptList] - -} -# Same as above, however the dialog is made modal and -# the return value is a 3 element list consisting of -# the contents of the three list boxes (eligible, scheduled and kept) -# on exit. -# If cancel, or destroyed, the original lists are returned. -# -proc KeeplistGUI::modalKeeplistDialog {topname Elligible Keeplist KeptList} { - set widget [KeeplistGUI::keeplistDialog $topname $Elligible $Keeplist $KeptList] - $widget modal - - if {[catch {$widget cget -eligible} values]} { - set values $Elligible - } - lappend result $values - - if {[catch {$widget cget -scheduled} values]} { - set values $Keeplist - } - lappend result $values - - if {[catch {$widget cget -kept} values]} { - set values $KeptList - } - lappend result $values - - catch {destroy $widget }; # Normal exit only destroys hidden. - - return $result - -} - - Modified: trunk/nextgen/daq/readoutgui/Makefile.in =================================================================== --- trunk/nextgen/daq/readoutgui/Makefile.in 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/Makefile.in 2009-04-08 21:21:45 UTC (rev 2119) @@ -35,14 +35,15 @@ host_triplet = @host@ bin_PROGRAMS = SecretTk$(EXEEXT) subdir = daq/readoutgui -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/InstallRoot.tcl.in $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = InstallRoot.tcl am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -303,6 +304,8 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +InstallRoot.tcl: $(top_builddir)/config.status $(srcdir)/InstallRoot.tcl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" Modified: trunk/nextgen/daq/readoutgui/ReadougGUIPanel.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/ReadougGUIPanel.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/ReadougGUIPanel.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -315,8 +315,8 @@ append w $base . host $w configure -text $host - append status $base . monitor - $status configure -host $host +# append status $base . monitor +# $status configure -host $host } # ReadougGUIPanel::setPath $path # Set the readout path for the gui. Modified: trunk/nextgen/daq/readoutgui/ReadougGUIPanel_ui.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/ReadougGUIPanel_ui.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/ReadougGUIPanel_ui.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -362,10 +362,10 @@ # Install the monitor widget: - package require spdaqMonitor +# package require spdaqMonitor - spdaqMonitor $base.monitor - grid x $base.monitor -in $root -column 3 -columnspan 8 +# spdaqMonitor $base.monitor +# grid x $base.monitor -in $root -column 3 -columnspan 8 # Resize Behavior grid rowconfigure $root 1 -weight 0 -minsize 2 -pad 0 Modified: trunk/nextgen/daq/readoutgui/ReadoutGui.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/ReadoutGui.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/ReadoutGui.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -34,7 +34,6 @@ package require DAQParameters package require Experiment package require bells -package require spdaqwidgets package require RunTime package require InstallRoot Modified: trunk/nextgen/daq/readoutgui/ReadoutShell.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/ReadoutShell.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/ReadoutShell.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -57,7 +57,6 @@ package require Configuration package require DAQParameters package require InitializeConfiguration -package require spdaqwidgets Modified: trunk/nextgen/daq/readoutgui/directories.tcl =================================================================== --- trunk/nextgen/daq/readoutgui/directories.tcl 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/daq/readoutgui/directories.tcl 2009-04-08 21:21:45 UTC (rev 2119) @@ -96,11 +96,11 @@ # GenRunFileBase # Returns the basename of a run file. # A run filename has the form: -# [format run%d_%d-%d.evt run segment buffersize] +# [format run%d-%d.evt run segment] # We're going to return the run%d part of this. # proc ExpFileSystem::GenRunFileBase {num} { - return [format run%d $num] + return [format run-%04d $num] } # GenRunFile # Generate the full name of a run file. @@ -114,16 +114,11 @@ proc ExpFileSystem::GenRunFile {num {seq 0}} { set fname [GenRunFileBase $num] - set buffer [DAQParameters::getBufferSize] - set buffer [expr {$buffer/2}] - # The form of the name depends on the sequence: - if {$seq} { - set fname [format %s_%d-%d.evt $fname $seq $buffer] - } else { - set fname [format %s-%d.evt $fname $buffer] - } + + set fname [format %s-%02d.evt $fname $seq] + return $fname } # WhereisRunFile Modified: trunk/nextgen/sbs/nsclapi/sbsVmeApi.xml =================================================================== --- trunk/nextgen/sbs/nsclapi/sbsVmeApi.xml 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/sbs/nsclapi/sbsVmeApi.xml 2009-04-08 21:21:45 UTC (rev 2119) @@ -1544,12 +1544,13 @@ </methodsynopsis> <methodsynopsis> <type>CVME<T>&</type> <methodname>operator++</methodname> - <methodparam><type>Int_t</type> + <methodparam><type>Int_t</type> <parameter>dummy</parameter> </methodparam> </methodsynopsis> <methodsynopsis> <type>CVME<T>&</type> <methodname>operator--</methodname> - <methodparam><type>Int_t</type></methodparam> + <methodparam><type>Int_t</type> <parameter>dummy</parameter> + </methodparam> </methodsynopsis> <methodsynopsis> <modifier>volatile</modifier> <type>UChar_t*</type> @@ -1800,6 +1801,7 @@ to the current pointer and returns that pointer. Note that as with the <literal>+=</literal> operator on normal pointers, the object this is applied to is modified. + </para> <methodsynopsis> <type>CVME<T>&</type> <methodname>operator-=</methodname> <methodparam> @@ -1837,7 +1839,7 @@ </para> <methodsynopsis> <type>CVME<T>&</type> <methodname>operator++</methodname> - <methodparam><type>Int_t</type> + <methodparam><type>Int_t</type> <parameter>dummy</parameter> </methodparam> </methodsynopsis> <para> @@ -1849,7 +1851,8 @@ </para> <methodsynopsis> <type>CVME<T>&</type> <methodname>operator--</methodname> - <methodparam><type>Int_t</type></methodparam> + <methodparam><type>Int_t</type> <parameter>dummy</parameter> + </methodparam> </methodsynopsis> <para> Implements the post decrement operator @@ -2250,12 +2253,12 @@ <type>UInt_t</type> <parameter>nOffset</parameter> </methodparam> </methodsynopsis> - <parameter> + <para> Same as <methodname>pokeb</methodname> however a 32 bit <parameter>lword</parameter> is written to <parameter>nOffset</parameter> longwords fromt he base address of the address window. - </parameter> + </para> <methodsynopsis> <type>UInt_t</type> <methodname>readl</methodname> @@ -2281,7 +2284,7 @@ Where possible, this function performs each read at a longword width. </para> - <methosynopsis> + <methodsynopsis> <type>UInt_t</type> <methodname>readw</methodname> <methodparam> <type>void*</type> <parameter>pBuffer</parameter> @@ -2292,7 +2295,7 @@ <methodparam> <type>size_t</type> <parameter>words</parameter> </methodparam> - </methosynopsis> + </methodsynopsis> <para> Same as <methodname>readl</methodname> however, <parameter>nOffset</parameter> is a word (16 bit) offset and @@ -2431,7 +2434,7 @@ <para> This class is an exception that can be thrown by the <methodname>CVMEInterface::Map</methodname> method. It is derived - from the <link linkend="CException"><classname>CException</classname></link> + from the <link linkend="manpage.cexception"><classname>CException</classname></link> class. See that page for full documentation on exception objects. </para> </refsect1> Added: trunk/nextgen/sbs/puretcl/camac.xml =================================================================== --- trunk/nextgen/sbs/puretcl/camac.xml (rev 0) +++ trunk/nextgen/sbs/puretcl/camac.xml 2009-04-08 21:21:45 UTC (rev 2119) @@ -0,0 +1,445 @@ +<!-- chapter libraries --> +<chapter> + <title>The CES CBD 8210 Tcl CAMAC Package</title> + <para> + This chapter describes a Tcl package (<literal>camac</literal>) that + allows Tcl scripts to perform CAMAC operations via CES CBD 8210 VME + CAMAC branch highway controllers. This can be used to + write control applications for CAMAC based modules. Note that as the + CBD 8201 is no longer in production we strongly recommend that you not + build any new applications around this module. + </para> + <para> + The functions in this library are loosely based on the ESONE CAMAC + function library specification (IEEE 758). The remainder of this chapter + describes: + <itemizedlist> + <listitem> + <para>How to incorporate this package into your scripts</para> + </listitem> + <listitem> + <para>An overview of how to use this package.</para> + </listitem> + </itemizedlist> + </para> + <para> + Reference information is available as well. See + <link linkend="manpage.camactcl">camac(3tcl)</link> + </para> + <section> + <title>Incorporating <literal>camac</literal> into your scripts</title> + <para> + Incorporating this package requires that you first make the + NSCLDAQ Tcl package respository visible to the Tcl package load + subsystem. Having done that, you must then explicitly load the + package via the <command>package require</command> command. + </para> + <para> + The Tcl package load subsystem search paths are a combination of + an environment variable (<varname>TCLLIBPATH</varname>), and a + set of global script variables (<varname>auto_path</varname>). + You can extend either of these mechanisms to include the + NSCLDAQ Tcl package repository in the set of directories searched + by the package load subsystem. + </para> + <para> + In the remainder of this section we are going to assume that you + have defined the environment variable <varname>DAQROOT</varname> + to be the base of the directory tree into which NSCLDAQ has been + installed. + </para> + <para> + The bash shell script fragment below shows how to add the NSCLDAQ + package repository to the <varname>TCLLIBPATH</varname> environment + variable. This script extends any existing <varname>TCLLIBPATH</varname> + definition rather than overwriting it + <informalexample> + <programlisting> +export TCLLIBPATH="$TCLLIBPATH $DAQROOT/TclLibs" + </programlisting> + </informalexample> + </para> + <para> + The Tcl script example below shows how to append the NSCLDAQ package + repository path to the list of paths in the <varname>auto_path</varname> + global variable. + <informalexample> + <programlisting> +global auto_path +global env +lappend auto_path [file join $env(DAQROOT) TclLibs] + </programlisting> + </informalexample> + </para> + </section> + <section> + <title>An overview of the use of the <literal>camac</literal> package</title> + <para> + The unit of control for the ESONE CAMAC functions on which this + package is based is a CAMAC module. The package allows you to form + connections to specific modules in specific branches an crates. + </para> + <para> + All of the commands in <literal>camac</literal> are placed in the + <literal>camac</literal> namespace. The Tcl + <command>namespace import</command> command can be used to import them + into the current or global namespace. + <warning> + <title>Warning</title> + <para> + The <literal>wienercamac</literal> package has an identical + set of commands in the <command>wienercamac</command> + namespace. If you are using both packages it is best + not to import their commands. + </para> + </warning> + </para> + <para> + The command <command>cdreg</command> (remember this is in the + <literal>camac</literal> namespace) is used to create a handle + to a module in a specific CAMAC crate. Once this handle has been + created, commands like <command>cssa</command> and + <command>cfsa</command> are used to perform operations on that + module. Additional block transfer commands exist to do + Qstop, Qscan and block transfers. + </para> + <para> + The implementation does not support LAM triggered functions, however + extensions to the standard are provided that allow you to poll the + crate for LAMs. Other extensions allow you to determine the set + of available CAMAC crates as well as to peform C and Z operations + on any crate assuming the controller is compatible with the + IEEE specifications of the A1/A2 crate controller (IEEE 596). + </para> + </section> + </chapter> + +<!-- /chapter --> + +<!-- manpage 3tcl --> +<refentry id="manpage.camactcl"> + <refmeta> + <refentrytitle>camac</refentrytitle> + <manvolnum>3tcl</manvolnum> + </refmeta> + <refnamediv> + <refname>camac</refname> + <refpurpose>Provide access to CES CBD8210 CAMAC to Tcl scripts</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command> +package require camac + </command> + </cmdsynopsis> + <cmdsynopsis> + <command> +camac::cdreg <replaceable>b c n ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::cfsa <replaceable>reg f a ?d?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::cssa <replaceable>reg f a ?d?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::qstop <replaceable>reg f a ?maxn?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::qscan <replaceable>reg f a ?maxn?</replaceable> + </command> +</cmdsynopsis> + + <cmdsynopsis> + <command> +camac::cblock <replaceable>reg f a num</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::isOnline <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::getGl <replaceable>b ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::C <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> +<cmdsynopsis> + <command> +camac::Z <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::isInhibited <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::Inhibit <replaceable>b c bool ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <cmdsynopsis> + <command> +camac::ReadLams <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + </refsynopsisdiv> + <refsect1> + <title>DESCRIPTION</title> + <para> + This package provides access to CAMAC modules via the + CES CBD 8210 branch highway driver to Tcl scripts. + Prior to use you must add the NSCLDAQ package repository path to the + Tcl package search list. + </para> + </refsect1> + <refsect1> + <title> + PACKAGE COMMANDS + </title> + <para> + The commands below share many of the same parameters: + <variablelist> + <varlistentry> + <term><replaceable>b</replaceable></term> + <listitem> + <para> + Is a branch number. For the CES CBD 8210 this is the + number set in the front panel branch number switch. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><replaceable>c</replaceable></term> + <listitem> + <para> + A CAMAC crate number on some branch. This is set in the + front panel rotary switch of the A1 or A2 crate controller + installed in the right-most pair of slots of the crate. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><replaceable>n</replaceable></term> + <listitem> + <para> + The slot number of a module in a CAMAC crate. Slots in + a CAMAC crate are numbered from 1 starting at the left. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><replaceable>a</replaceable></term> + <listitem> + <para> + The subaddress within a module. A CAMAC modules is + defined to have 16 subaddresses numbered 0-15. + Each module uses this set of subaddresses differently.\ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><replaceable>vmecrate</replaceable></term> + <listitem> + <para> + A VME crate number in which at least one + CES CBD 8210 module has been installed. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><replaceable>reg</replaceable></term> + <listitem> + <para> + A CAMAC module handle. These are produced using the + <command>camac::cdreg</command> command below. This is + used to select the CAMAC module operated on by several + of the commands. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + <cmdsynopsis> + <command> +package require camac + </command> + </cmdsynopsis> + <para> + Loads the <literal>camac</literal> package into the interpreter. The + commands loaded are all in the <literal>camac</literal> namespace. + The Tcl <command>namespace import</command> command can be used to + allow access to these commands without using a fully qualified namespace, + however if you are using other CAMAC Tcl libraries, beware as they will + most likely implement the same commands in a different namespace. + </para> + <cmdsynopsis> + <command> +camac::cdreg <replaceable>b c n ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Creates and returns a handle to a CAMAC module specified by + <parameter>b</parameter> <parameter>c</parameter> + <parameter>n</parameter> and <parameter>vmecrate</parameter>. + If the <parameter>vmecrate</parameter> parameter is omitted, + VME crate 0 is used by default. The command returns a value + that should be used as the <parameter>reg</parameter> parameter + in subsequent operations in this package. + </para> + <cmdsynopsis> + <command> +camac::cfsa <replaceable>reg f a ?d?</replaceable> + </command> +</cmdsynopsis> + <para> + Performs a CAMAC operation on the module defined by <parameter>reg</parameter>. + If the operation is a write, the <parameter>d</parameter> parameter must + be supplied and is the data to write. The CAMAC bus is a 24 bit bus, + so only the least significant 24 bits of <parameter>d</parameter> will + actually be written. + </para> + <para> + The command returns a 3 element Tcl list. The first element of this + list is the data parameter to the command if the <parameter>f</parameter> + code was a write code. If <parameter>f</parameter> indicated a read, + the first element of the list is the data read. If the + <parameter>f</parameter> was a control operation, the first element of the + list is meaningless. The second element of the list is the + Q-response for the operation and the third element the X-response. + </para> + <cmdsynopsis> + <command> +camac::cssa <replaceable>reg f a ?d?</replaceable> + </command> + +</cmdsynopsis> + <para> + Same as <command>camac::cfsa</command> however for data transfer operations, + this only transfers the least significant 16 bits. Note that for + the CES CBD 8210 16 bit operations are significantly faster than + 24 bit operations as the data paths to the module are only 16 bits wide. + </para> + <cmdsynopsis> + <command> +camac::qstop <replaceable>reg f a ?maxn?</replaceable> + </command> +</cmdsynopsis> + <para> + Performs a Q-stop block transfer from the module specified by + <parameter>reg</parameter> with the read function <parameter>f</parameter>. + Only read Q-stops are supported. The function is repeated until no + Q response is present or until <parameter>maxn</parameter> transfers + have been performed, whichever is first. The result of this command is + a Tcl list. Each element of the list a value read from the module during + the read operation. + </para> + <cmdsynopsis> + <command> +camac::qscan <replaceable>reg f a ?maxn?</replaceable> + </command> +</cmdsynopsis> + <para> + Peforms a Q-scan block transfer. In a Q-scan operation the subaddress + is incremented until the module does not return a Q at which point the + subaddress is reset to zero and the slot is incremented. This process + repeats until the read does not return a valid X-response or when + <parameter>maxn</parameter> is exceeeded. + </para> + <para> + The command returns a list of the data that has been returned from the + module. + </para> + <cmdsynopsis> + <command> +camac::cblock <replaceable>reg f a num</replaceable> + </command> +</cmdsynopsis> + <para> + Repeats the read operation <parameter>num</parameter> times putting + the results of the reads into a list that is returned by the command. + </para> + <cmdsynopsis> + <command> +camac::isOnline <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Returns true if the CAMAC crate selected by the command parameters is + online. This is not reliable as a probe for crates on branches that don't + exist. + </para> + <cmdsynopsis> + <command> +camac::getGl <replaceable>b ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Returns the value of the graded lam register for the + specified branch highway module. + </para> + <cmdsynopsis> + <command> +camac::C <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Peforms a C cycle on the selected CAMAC crate. This means that the + crate dataway C line is pulsed by the controller. + </para> +<cmdsynopsis> + <command> +camac::Z <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Performs a Z cycle on the selected CAMC crate. + </para> + <cmdsynopsis> + <command> +camac::isInhibited <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Returns true if the specified CAMAC crate is inhibited (its + <literal>I</literal> line is asserted). + </para> + <cmdsynopsis> + <command> +camac::Inhibit <replaceable>b c bool ?vmecrate?</replaceable> + </command> +</cmdsynopsis> + <para> + Sets the inhibit line of the specified crate to + <parameter>bool</parameter> + </para> + <cmdsynopsis> + <command> +camac::ReadLams <replaceable>b c ?vmecrate?</replaceable> + </command> +</cmdsynopsis> +<para> +Returns the LAM register of the controller for the specified crate. +</para> + </refsect1> + +</refentry> + + +<!-- /manpage --> \ No newline at end of file Modified: trunk/nextgen/sbs/tclpackage/vmetcl.xml =================================================================== --- trunk/nextgen/sbs/tclpackage/vmetcl.xml 2009-04-08 19:13:45 UTC (rev 2118) +++ trunk/nextgen/sbs/tclpackage/vmetcl.xml 2009-04-08 21:21:45 UTC (rev 2119) @@ -1,6 +1,6 @@ <!-- chapter commands --> -<chapter> +<chapter id="vmetclintro"> <title>Tcl access to the VME via the SBS interface</title> <para> The NSCL uses the Tcl/Tk scripting language to provide user interfaces This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |