LDEFS(OPCS)		Optical Printer Control System		LDEFS(OPCS)

    NAME
        ldefs - load OPCS definitions file

    USAGE
    	ldefs filename.opc
    	ldefs -c <command and args>

    EXAMPLES
	ldefs hicon.opc               # load OPCSDEFS cmds from hicon.opc
	ldefs -c bigcounters nixie    # use nixie counters
	ldefs -c ramp a 10 180 10 150 # redefine ramps for a chan
	
    DESCRIPTION
        This command allows the operator to load other definitions files.
	Users can make copies of the OPCSDEFS.OPC file, and make changes
	to the copy, then load this new copy with the LDEFS command to put
	the changes into effect. This avoids modification of the original
	OPCSDEFS.OPC file.

	One can also run single line OPCSDEFS commands with the '-c' flag,
	which interprets all arguments to the end of the line or a '!'
	character (see BANG(OPCS)) as OPCSDEFS commands. Example:

	    ldefs -c bigcounters nixie
	    ldefs -c name a Aerial name b Main name c Cam ! echo OK

	OPCSDEFS files contain special commands that setup the OPCS system's
	internal parameters. Use 'man -k OPCSDEFS:' for a listing of all the 
	OPCSDEFS commands (such as the 'opcsdefs.opc' loaded on startup),
	or for any other files/commands used with LDEFS(OPCS).

    HISTORY
        The '-c' flag was added in OPCS version K2.00 to allow immediate
	execution of defs commands. In older releases to do the same, you
	had to first write commands into a temp file (e.g. using ECHO),
	then load that, e.g:

	    ! echo bigcounters off > tmpfile
	    ldefs tmpfile ! del tmpfile

	This trick is no longer needed in K2.xx, as you can use just
	'ldefs -c bigcounters off' for the same effect.

    TRICKS WITH DEFS FILES
    	People familiar with the IBM's operating system will be familiar with
	these capabilities...

        First, note that in K2.00 (and up), 'ldefs -c' can be used to run
	OPCSDEFS commands inside OPCS, e.g.

	    ldefs -c bigcounters on   # big counters

        Which makes many of the below techniques unnecessary extra work.
	However, in the older releases (K1.xx) this is not available so
	the below techniques must be used.
	    
	As with all DEFS file commands, you can execute motor definition
	commands from within the OPCS software by creating a small file,
	and the loading commands from it via LDEFS(OPCS)... In the following
	example, we switch back and forth between large and small counters:

	    ! echo bigcounters on  > tmpfile ! ldefs tmpfile   # big counters
	    ! echo bigcounters off > tmpfile ! ldefs tmpfile   # small counters

	This 'trick' can be used with any OPCSDEFS commands, and uses the 
	operating system's ECHO command and 'reroute output' symbol (>) to 
	create the file FOO, which is then loaded as a file with the LDEFS 
	command. This technique CAN be used within a script or when entering
	commands manually.

	You can create multiline files from within a script as shown in this
	example using MSDOS's > and >> (append) symbols:

	    ! echo flog 2.0         > tmpfile
	    ! echo logcounters yes >> tmpfile
	    ldefs  tmpfile

	This technique can be programmed into run scripts, so defs file
	information can be changed on the fly.

	Here is another way to enter DEFS commands directly to the LDEFS 
	command from within the OPCS software:

	    ldefs con            # Load the special MSDOS file CON...
	    logcounters no       # which is really the keyboard (console)
	    ppr a 400            # reading these commands from keyboard
	    ^Z                   # CTRL-Z and RETURN ends this mode..
	    cam 12               # ..back to OPCS commands

	The 'ldefs con' technique works well for interactive typing, but 
	cannot be programmed into a script, since it always reads from
	the keyboard. Use the 'echo' technique listed in the previous example
	for programming DEFS commands into a running script.

	These techniques are actually standard ways of using the DOS operating
	system, and are not particular to just the OPCS software.. they can be
	used by any program running under MSDOS that properly supports the
	operating system.

	Users not familiar with these techniques should learn them only if
	they think they might need them. At very least, operators should 
	be aware of this capability.

    SEE ALSO
       ECHO(OPCSDEFS)   - disable echoing of defs commands
       OPCSCMD(OPCS)    - run OPCS commands from within OPCSDEFS command mode
       man -k OPCSDEFS: - list OPCSDEFS commands with one line descripitions
       man -k OPCS:     - list OPCS commands with one line descriptions

    ORIGIN
	Gregory Ercolano, Los Feliz California 11/29/89
© Copyright 1997 Greg Ercolano. All rights reserved.