Table of Contents

Name

camac_script_v2 - general definitions for CAMAC scripting language

Description

This manual page provides the definitions for the CAMAC scripting language used by AccelNET.

It uses BuildCAMACioLst() to parse the script file and build an AccelNET I/O list using IOTRANS and IODATA structures.

This package is typically used by a program where it is desired to have the program run a series of CAMAC commands as part of its operation. The scripting language allows the list of CAMAC operations to placed in a configuration file allowing the program to be reconfigured without recompilation.

BuildCAMACioLst() is called with the pathname of the script and a pointer to an IOTRANS pointer. BuildCAMACioLst() constructs an I/O list and fills in pointer with the address of the beginning of the list. The list is then called as necessary by the program using the BuildCAMACioLst() service.

Since an AccelNET I/O list is constructed by the camac_script facility a program using this service may change the data used in write operations or retrieve the data from read operations at any time.

Reserved words

These are the reserved words which may be used in a camac_script based configuration file.

Only one statement should appear on each line. The fields of a statement should be separated by one or more characters of whitespace. Whitespace is a tab or a space character.

A line is terminated by a newline character.

A # appearing anywhere on a line is treated as the beginning of a comment. The comment ends at the end of the line.

define <symbol> <value>

Define symbols which may be substituted in other statements. For example the slot number for an ADC may be defined here and used in later statements.

camac_nrm C N A F <value>

Perform a CAMAC normal mode I/O operation.

If F is between 16 and 23 the value field must be present and is used for the data to be written to CAMAC during this operation. Otherwise the value field is not required.

camac_scan C N A F <value> <cnt>

Perform a CAMAC scan mode I/O operation.

If F is between 16 and 23 the value field must be present and is used for the data to be written to CAMAC during this operation. Otherwise the value field is not used but must be present.

cnt is the number of IODATA records to create.

The IODATA.ChNo field is enumerated starting at zero.

camac_rpt C N A F <value> <cnt>

Perform a CAMAC repeat mode I/O operation.

The operation is repeated until Q=1 or the timeout in the device driver expires.

The value and cnt fields must always be present.

If F is between 16 and 23 the value field is used for the data to be written to CAMAC during this operation.

cnt is the number of times to perform the camac repeat. The minimum value is 1 and the maximum depends on the device driver. Presently the ksc2915 driver sets max at 10000.

One IODATA record is created.

camac_stop C N A F <value> <cnt>

Perform a CAMAC stop mode I/O operation.

The IODATA record list is traversed until Q=0 or the end of the list is reached.

If F is between 16 and 23 the value field must be present and is used for the data to be written to CAMAC during this operation. Otherwise the value field is not used but must be present.

cnt is the number of IODATA records to create.

The IODATA.ChNo field is enumerated starting at zero.

Example script

This script retrieves 32 channels of data from a KSC3516 located in crate 4 slot 5. The program utilizing this script could read the data values from the I/O list.
#
# test script
#
# define the crate number
define crate 4
# define the adc slot number
define Nadc 5
#
#
# set the mem address ptr
camac_nrm crate Nadc 1 17 0
# retrieve 32 chans
camac_stop crate Nadc 0 0 32

Manual page revision

$Id: camac_script_v2.5,v 2.0 2003/05/01 18:06:31 kitchen Exp $


Table of Contents