Presentation is loading. Please wait.

Presentation is loading. Please wait.

D0 CFT AFE Module Phase V Test Stand VBA Based Control Code PPD / EED VBA Class Session III May, 18 2004 M. Matulik.

Similar presentations


Presentation on theme: "D0 CFT AFE Module Phase V Test Stand VBA Based Control Code PPD / EED VBA Class Session III May, 18 2004 M. Matulik."— Presentation transcript:

1 D0 CFT AFE Module Phase V Test Stand VBA Based Control Code PPD / EED VBA Class Session III May, 18 2004 M. Matulik

2 EEDEED PPD / EED VBA Session III May 18, 20042

3 EEDEED PPD / EED VBA Session III May 18, 20043 VB_Writew Function VB_Writew(Address As Long, lValue As Long) As Integer Dim i As Integer i = writevmeli(Address, lValue) VB_Writew = i End Function

4 EEDEED PPD / EED VBA Session III May 18, 20044 InitializeSASEQ Static Function InitializeSASEQ(lHDIEnable As Long) As Integer 'Performs the operation of initializing the SASEQ. This results in the SVX chips being placed 'into initialize mode, ready for downloading. In addition, the parameter passed to this procedure 'is used to control the HDI enable bits (controls the output enables on the transceiver(s) connected 'to the SVX control and data busses). ' 'This sequence was copied from the SASEQ initialization list processor worksheet ' 'Required modules: io_617.bas or equivalent ' 'Compiled: M. Matulik Dim iPlace As Integer Dim lAdd As Long Dim lVal As Long InitializeSASEQ = 0 iPlace = VB_clrlatcherri ' clear the latching bit3 status error flg ' Write to SASEQ CROSSWID register lAdd = lSASeqBaseAdd + 6 '0x50D006 lVal = 48 '0x30 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ CALVOLT register lAdd = lSASeqBaseAdd + 8 '0x50d008 lVal = 0

5 EEDEED PPD / EED VBA Session III May 18, 20045 InitializeSASEQ lVal = 18 '0x12 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ PCID register lAdd = lSASeqBaseAdd + 12 '0x50D00C lVal = 208 '0xD0 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ IGNORE register (controls HDI enable) lAdd = lSASeqBaseAdd + 18 '0x50D012 lVal = lHDIEnable '0x03 enable HDI on chain 1 and 2 '0x12 ignore chain 1, enable HDI on chain 2 '0x21 ignore chain 2, enable HDI on chain 1 '0x30 ignore both chains, disable HDIs on both chains iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ CSR lAdd = lSASeqBaseAdd + 14 '0x50D00E lVal = 166 '0xA6 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ TRIGGER register lAdd = lSASeqBaseAdd + 24 '0x50D018 lVal = 0 ' set 132ns mode iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ TRIGGER register lAdd = lSASeqBaseAdd + 24 '0x50D018 lVal = 128 '0x80 set idle mode iPlace = VB_Writew(lAdd, lVal)

6 EEDEED PPD / EED VBA Session III May 18, 20046 InitializeSASEQ If VB_islatcherri = 0 Then 'No VME errors detected Else InitializeSASEQ = 1 iErrorCode = iSaseqError iTestCode = iSaseqInit iChannelNumber = -1 sErrorValue = -1 iBoardHanded = -1 Call SortErrors End If End Function

7 EEDEED PPD / EED VBA Session III May 18, 20047

8 EEDEED PPD / EED VBA Session III May 18, 20048 Scope of AFE Test Stand Code  Trivial user entry Entry error checking.  Verify Test Stand Hardware Functionality  Complete Test of AFE Module Verify 1553 Communication Path. Verify the Functionality of the FIFO. Verify Revision Level of Micro Firmware. Download VSVX CPLD parameters.

9 EEDEED PPD / EED VBA Session III May 18, 20049 Scope of AFE Test Stand Code  Complete Test of AFE Module Download SVX parameters. Perform VRef Sweep to determine operating point for each of the 32 SIFT chips on the AFE Module. Use these operating points for subsequent Data Collection.

10 EEDEED PPD / EED VBA Session III May 18, 200410 Scope of AFE Test Stand Code  Complete Test of AFE Module Perform Data Collection Routine. Write test specific values to registers on AFE Module and AFE Test Module. Obtain Digitized Mean and Discriminator Occupancy for all channels. Perform VLPC Bias Voltage and Cryogenic Temperature Control Tests as necessary.

11 EEDEED PPD / EED VBA Session III May 18, 200411 Scope of AFE Test Stand Code  Complete Test of AFE Module Analyze Channel Data for Correct Values of Discriminator Occupancy and Digitized Mean. Three types of AFE Modules can be tested with different expected Mean values.  Generate ACSII files listing results of tests just completed, appending to files of previous test results.

12 EEDEED PPD / EED VBA Session III May 18, 200412 Scope of AFE Test Stand Code  Save raw data of test results to ASCII files for off-line, more extensive data analysis.

13 EEDEED PPD / EED VBA Session III May 18, 200413

14 EEDEED PPD / EED VBA Session III May 18, 200414

15 EEDEED PPD / EED VBA Session III May 18, 200415

16 EEDEED PPD / EED VBA Session III May 18, 200416 Phase V AFE Test Stand VBA code  Collaborative effort, 5+ people writing code.  Highly modular – each code writer responsible for syntax within own module(s).  Pass variables to called functions.  Use of global variables across all modules.

17 EEDEED PPD / EED VBA Session III May 18, 200417 Phase V AFE Test Stand VBA code  Code sections freely stolen from existing/running VBA code, modified to utilize globally defined variables.  Each imported module was required to compile without errors – each code writer was given the most recent copy of the code.  Logic errors corrected during debug.

18 EEDEED PPD / EED VBA Session III May 18, 200418 Phase V AFE Test Stand VBA code  What did we wind up with? A lot of code. A lot of experience. A functioning set of code. A useful base for generating diagnostic programs.

19 EEDEED PPD / EED VBA Session III May 18, 200419 Phase V AFE Test Stand VBA code  What would we change? Don’t rely as much on global variables. Insist on a more common coding style from all of the programmers. Take more time up front to optimize subroutine and function operation.

20 EEDEED PPD / EED VBA Session III May 18, 200420 When you have problems:  Verify logic.  Check passed variables.  Call 2554.


Download ppt "D0 CFT AFE Module Phase V Test Stand VBA Based Control Code PPD / EED VBA Class Session III May, 18 2004 M. Matulik."

Similar presentations


Ads by Google