EPICS 10Hz + 20kHZ fault detect.

Requirement: - run pre/post at 20kHz on 96 channels - run mean at 10Hz. - demonstrate running a SNC sequence

1. Check Revisions

Firmware:
root@acq196_010 ~ #get.release.versions 
98.2034.2538

EPICS:
root@acq196_010 ~ #ls -l /bigffs/
-rw-r--r--    1 root     root       756065 Mar  2 21:28 acq2ioc.080302212915.tgz
lrwxrwxrwx    1 root     root           24 Mar  2 21:31 acq2ioc.tgz -> acq2ioc.080302212915.tgz
-rw-r--r--    1 root     root        35970 Feb 24 11:24 seq-arm-linux.tgz


/ffs/rc.local:
# EPICS - enable if needed. NB needs special EPICS image in /dev/mtd8  
tempmon &1 >/dev/null &      
load.mean                                 
start_epics                                                             
(cd /; tar xvzf /bigffs/seq-arm-linux.tgz)



2. Setup


Set the Event to trigger capture: (or use Events.cgi page).
root@acq196_010 ~ #set.event0 DI3 falling
root@acq196_010 ~ #get.event0
event0 DI3 falling ACTIVE

On the host:

Run the medm gui:

# the next two lines are site specific - your's will be different:
cd /home/pgm/PROJECTS/EPICS/EonK
. ./setup.epics

# set target to the hostname of board under test.
./extensions/bin/linux-x86/medm -macro "target=acq196_010" -x extensions/acq196_demo.adl

# Connect a S68 loopback cable from DIO32 to AI01-32.

3. Start Capture

# set up a capture:
# I ran a dt100rc, set 100K pre, 100K post, internal clock 20kHz, mode=TRIG
# press Arm on dt100rc
# DO NOT use the MEDM ARM button first time, because else no mode is configured.
# on dt100rc, leave on Control page, press "Min Size" 

Strip display shows zero data, all low

Go to DIO32.cgi, set d0 hi, lo, d1 hi, lo : confirm operation on trace.

4. Run the sequence:

on target:
caRepeater &
sncExample "host=acq196_010,ch=01,bo=00"

NB: you may have to set d0 to input to get the sequence to bootstrap.

Look for the nice display at 1Hz.

5. Test the trigger

Press the "Trigger" button on demo.adl panel, check dt100rc shows transition to POST

At the end of the shot, dt100rc will show "ST_POSTPROCESS", then "ST_STOP".
Then the waveform displays will auto update.

6. Show operation at 10Hz.

First kill ioc:
cd /EPICS/
lsac --socket /tmp/epics


acq2ioc _can_ run all 96 channels at .1s scan - you can try this as follows:

export SCAN0132=".1 second" SCAN=".1 second";./start.ioc

top shows acq2ioc running at 45%.

Actually, the mean device update can be optimised in two ways: (future option)

#1 Use a single XX device for all channels - reduce 96 system calls to 1.
#2 Make it event driven - XX device to block until new data, change AI records from scan to Event.

Simulate this reduced loading by running only first 32 channels at .1s:

export SCAN0132=".1 second" SCAN="1 second";./start.ioc 

interestingly the TOP display changes to:
  PID USER     STATUS   RSS  PPID %CPU %MEM COMMAND
17698 root     S       3600 17666 28.6  3.0 acq2ioc
17695 root     S       3600 17666 11.9  3.0 acq2ioc


... I guess one thread is scan1 and the other is scan0.1

... never mind, the event driven, single device scenario _will_ be more efficient!