Changeset 882
- Timestamp:
- Jun 6, 2012 1:11:49 PM (11 years ago)
- Location:
- softGlue_examples/source/gated_scaler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
softGlue_examples/source/gated_scaler/gatedScaler.snap
r880 r882 348 348 xxx:softGlue:sseq1.STR1 1 0 349 349 xxx:softGlue:sseq1.DO1 1 0.000000000000000e+00 350 xxx:softGlue:sseq1.LNK1 1 "xxx:softGlue:UpCntr-1_COUNTS.PROC NPP"350 xxx:softGlue:sseq1.LNK1 1 "xxx:softGlue:UpCntr-1_COUNTS.PROC PP N" 351 351 xxx:softGlue:sseq1.WAIT1 1 NoWait 352 352 xxx:softGlue:sseq1.DLY2 1 0.000000000000000e+00 -
softGlue_examples/source/gated_scaler/index.rst
r880 r882 5 5 ======================== 6 6 7 This circuit shows one way to build a :index:`!gated scaler`. 7 8 This circuit shows one way to build a four channel :index:`!gated scaler`. 8 9 9 10 Circuit … … 11 12 12 13 .. image:: gatedScaler.gif 13 14 :width: 100% 14 15 15 16 This circuit implements four counter channels, a time base to control counting … … 21 22 22 23 This circuit uses a busy record (from the busy module) and a sseq record (from 23 the std module), which are loaded by softGlue_convenience.db. If these records 24 are not available, the circuit will still function, but the counters will not be 25 read immediately after the count time has elapsed, and it will not be useful to 26 drive the counter with a ca_put_callback(), because the callback will come 27 immediately, instead of coming after counting has finished. 24 the std module, but moved to the calc module for synApps 5.7), which are loaded 25 by softGlue_convenience.db. If these records are not available, the circuit 26 will still function, but the counters will not be read immediately after the 27 count time has elapsed, and it will not be useful to drive the counter with a 28 ca_put_callback(), because the callback will come immediately, instead of coming 29 after counting has finished. 28 30 29 31 Usage 30 32 ----- 31 33 32 # Connect field inputs to the counters by giving names to four field input 34 To load the circuit into softGlue: 35 36 1) Download this BURT snapshot file :download:`gatedScaler.snap <gatedScaler.snap>` 37 38 2) Edit the file to replace all occurrences of the string "xxx:softGlue:" 39 with whatever value you specified for $(P)$(H) when you loaded softGlue into 40 your IOC 41 42 43 3) Load the file with the command "burtwb -f gatedScaler.snap" 44 45 To use the circuit: 46 47 1) Connect field inputs to the counters by giving names to four field input 33 48 bits, and writing those names also to the clock inputs for up counters 1-4. 34 (As delivered, all counters count the signal named "Clock_8MHz", which is the35 name this circuit gives to the 8 MHz clock.)49 (As delivered, all counters count the signal named "Clock_8MHz", which is 50 the name this circuit gives to the 8 MHz clock.) 36 51 37 #Set the count time by writing a number, to the "N" input of DivByN-1. The38 t he timebase clock is 8 MHz, so the actual count time will be N/8e6 seconds.52 2) Set the count time by writing a number, to the "N" input of DivByN-1. The 53 timebase clock is 8 MHz, so the actual count time will be N/8e6 seconds. 39 54 40 #Start the counter by writing 1 to $(P)$(H)busy1 (one of the busy records55 3) Start the counter by writing 1 to $(P)$(H)busy1 (one of the busy records 41 56 in the EPICS database, softGlue_convenience.db, which is loaded by the 42 57 standard softGlue.cmd file). 43 58 44 #Either wait for the count time to elapse, or abort the count by writing59 4) Either wait for the count time to elapse, or abort the count by writing 45 60 0 to $(P)$(H)busy1. 46 61 47 #Read the accumulated counts from UpCntr-<n>_COUNTS, where <n> is in [1-4].62 5) Read the accumulated counts from UpCntr-<n>_COUNTS, where <n> is in [1-4]. 48 63 49 #Gating can be done either by EPICS, or by a field input.64 6) Gating can be done either by EPICS, or by a field input. 50 65 51 66 To gate with EPICS, write '1' to the second input of AND-1 to enable … … 74 89 of "count". 75 90 76 "clear" zeroes the counters (UpCntr-<n>), loads the count time (i.e., the number 77 of clock pulses) into the time base DivByN-1, and sets DFF-1 to 1, producing the 78 signal named "counting". "clear*" sets the output of DFF-3 to 1, producing the 79 signal "counting", which stays at 1 until it's time for the counters to stop 80 counting. 91 "clear" zeroes the counters (UpCntr-<n>), and loads the count time (i.e., the 92 number of clock pulses) into the time base DivByN-1. "clear*" sets the output 93 of DFF-3 to 1, producing the signal "counting", which stays at 1 until it's time 94 for the counters to stop counting. 81 95 82 96 "counting" is sent to field output bit 17, which must actually be configured as 83 97 an output, and which will generate an interrupt on the falling edge of 84 "counting" (when pulse counting has finished). The interrupt processes the 85 record $(P)$(H)sseq1, which causes EPICS records for all four counters to 86 process, reading their values so that a client can acquire them. 98 "counting" (when pulse counting has finished). The interrupt configuration 99 (which is not shown in the figure) is set so that the falling edge of "counting" 100 causes the record $(P)$(H)sseq1 to process, which causes EPICS records for all 101 four counters to process, reading their values so that a client can acquire 102 them. 87 103 88 104 * You can, of course, use any field output bit for this purpose, as long as
Note: See TracChangeset
for help on using the changeset viewer.