man5/lprg_v2

Table of Contents

Name

lprg_v2 - list processor program script

Description

lprg_v2 contains the program to load into the list processor.

It uses ProcLPscript() to parse the script file and build an AccelNET I/O list using IOTRANS and IODATA structures. The scripting language allows the list processor program to be changed without recompiling listp_v2(8) .

Reserved words

These are the reserved words which may be used in an lprg file. Check the Hytec 1341 users manual for more information.

crate N

Set the crate number to issue commands to. This should appear first in the file. If this directive is missing crate 0 is assumed.

lpslot N

Set the slot number of the list processor. This should appear second in the file. If this directive is missing slot 1 is assumed.

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 later used in camacio statements.

reset

Issue a reset to the list processor (F25 A15). Usually this instruction is used before any program instructions. This instruction is not loaded into the list processor memory.

book

Book the list processor. The list processor requires that it be booked before it will execute anything. This instruction is not loaded into the list processor memory. Issuing a reset unbooks the list processor.

enable

Enable the list processor (F26 A0). This instruction is not loaded into the list processor memory.

camacio N A F <data>

Perform a CAMAC I/O operation. This operation will be performed while loading the program into the list processor. It is not part of the instructions which are loaded into the list processor for execution.

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

Data from a read operation imbedded here is not retrievable from the lprg script. However, it could be retrieved by the program using the script.

nrm N A F

Perform a normal mode CAMAC I/O operation.

If F 0-7 data is read from CAMAC and placed in the memory location pointed to by the read data pointer and the read pointer is incremented.

If F 16-23 data is written to CAMAC from the memory location pointed to by the write data pointer and the write pointer is incremented.

Other F values do not use data.

If the Q=0 nothing is written or read and the appropriate data pointer is not incremented.

noq N A F

Perform a NoQ mode CAMAC I/O operation.

If F 0-7 data is read from CAMAC and placed in the memory location pointed to by the read data pointer and the read pointer is incremented.

If F 16-23 data is written to CAMAC from the memory location pointed to by the write data pointer and the write pointer is incremented.

Other F values do not use data.

The appropriate data pointer is always incremented.

jump <type> <address>

unc
Jump unconditionally to address.
noq
Jump if NoQ on last CAMAC operation to address.
trg
Jump to address and await trigger.
gt
Jump to address if value of last data read is greater than value of comparator register.
lt
Jump to address if value of last data read is less than value of comparator register.
eq
Jump to address if value of last data read is equal to value of comparator register.
res
Jump and restore write data pointer.

stop

Halt the list processor.

IPw <address>

Write the value of address to the instruction pointer.

This instruction is not written into the list processor instruction memory. If it is desired to include this instruction in the list processor program then use nrm or noq to build the correct CAMAC command in the list processor program.

IPr

Read the instruction pointer.

RDw <address>

Write the value of address to the read data pointer.

This instruction is not written into the list processor instruction memory. If it is desired to include this instruction in the list processor program then use nrm or noq to build the correct CAMAC command in the list processor program.

RDr

Read the read data pointer.

WRw <address>

Write the value of address to the write data pointer.

This instruction is not written into the list processor instruction memory. If it is desired to include this instruction in the list processor program then use nrm or noq to build the correct CAMAC command in the list processor program.

WRr

Read the write data pointer.

CMPw <value>

Write value to the comparator register. The comparator register is used in certain jump operations.

This instruction is not written into the list processor instruction memory. If it is desired to include this instruction in the list processor program then use nrm or noq to build the correct CAMAC command in the list processor program.

CMPr

Read the comparator register.

RDDw <value>

Write value to the memory location in the list processor pointed to by the read data pointer register. The read data pointer is incremented.

RDDr

Read data from the memory location pointed to by the read data pointer. The read data pointer is incremented.

WRDw <value>

Write value to the memory location in the list processor pointed to by the write data pointer register. The write data pointer is incremented.

This instruction is not written into the list processor instruction memory. If it is desired to include this instruction in the list processor program then use nrm or noq to build the correct CAMAC command in the list processor program.

WRDr

Read data from the memory location pointed to by the write data pointer. The write data pointer is incremented.

Example lprg script

This example is for use with a Phillips 7164 peak hold ADC. The list processor is located in slot 22 of CAMAC crate 4.

The Phillips ADC is located in slot 5.

A KSC3610 counter module is located in slot 4. Two counter channels are used. One channel is connected to the sequencer electronics count signal. It increments each time the Sequence Controller completes one jumping cycle. This count is read and placed in the 1st word of the data block.

Five ADC channels ohannels are read and placed in list processer memory, then the ADC is reset.

The data block is six 24 bit words long and looks like this:
cycle_number adc0 adc1 adc2 adc3 adc4 adc5

This information will be uploaded into the computer by listp_v2(8) when told to do so by MBSseqTask(8) . After the data has been uploaded it is processed for output into logging files, online transmission and histogramming display.

The rules for processing the data blocks and an example script for processing the data created by this script may be found in pconv_v2(5) .

#
# list processer program for use with Phillips 7164
#
#
        # setup

crate    4        # set the crate number
lpslot 22        # set the list processor slot number
        # definition operations

define Nadc 5        # adc
define Ncntr 4        # counter
        # initialization

reset            # reset the list processor
book            # book it
        # set up list processer registers

IPw 0            # initialize instruction pointer
# RDw 0xfc0000        # initialize read data pointer
           # this is done by listp program so don’t do it..

        # set up jump table

stop            # 0 trigger 1
stop            # 1 trigger 2
stop            # 2 trigger 3
stop            # 3 trigger 4
stop            # 4 trigger 5
stop            # 5 trigger 6
jump unc 7        # 6 trigger 7
        # trigger 7 list

nrm Ncntr 0 0        # 7 read counter
nrm Nadc 0 0        # 8 read adc chan 0
nrm Nadc 1 0        # 9 read adc chan 1
nrm Nadc 2 0        # 10 read adc chan 2
nrm Nadc 3 0        # 11 read adc chan 3
nrm Nadc 4 0        # 12 read adc chan 4
nrm Nadc 1 11        # 12 clear the adc hit register and lam
jump trg 0        # 13 jump back to beginning and await trigger
IPw 0            # reset instruction pointer to beginning
# enable            # fire up list processor
               # don’t do this (lp will be enabled by program)

See Also

listp_v2(8)

Manual page revision

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


Table of Contents