Home

Serial data frame generator for testing telecommunications circuits

image

Contents

1. U A ai a e M if BitPosition 0 or BitPosition gt 15 then call FGen Error SetBit BitPosition lt 0 or BitPosition gt 15 end if E if Sbit lt 0 or Sbit gt 1 then call FGen Error SetBit Sbit lt 0 or SBit gt 1 end if if Value 32768 or Value 32767 then call FGen Error SetBit Value 32768 or Value 32767 end if if BitPosition 15 then if Sbit O then Value binand Value bincmp 2 BitPosition else Value binior Value 2 BitPosition end if else if Sbit 0 then Value binand Value 32767 else Value binior Value 32768 end if end if subend Bub ReadInfo FileName Length Array Ome Sas dn we tm tee ee ee ne This routine reads an ASCII text file of INFORMATION field data one integer per line into an array until End Of File occurs The number of requested frames is passed through the lt Length gt parameter If the number of frames read from the file each sequence of Info field values is terminated by a 1 integer value does not equal the number of requested frames lt Length gt parameter an error is reported and program execution is stopped sd dd p n i ee 4 967 412 71 ELE 72 If a file error occurs during this subroutine an error is reported and program execution is stopped If more than 32766 integers
2. sub PCF repl frame Repl line ptr Repl line giobal Glb _repl_ error code Glb repl cols Glb valid repl_ chars global Glb _repl_ chars Glb master _repl_char global outfile End of file True False dim Templine 80 dim Master char 1 Data char 1 Find the index that matches the master replacement character Master index pos Clb valid repl chars Glb master repl char 4 967 412 223 224 if Master index 0 then call Abort Code genera end if tor could not find a Master Replace Character 0 Last_repl_index len Glb_valid_repl_chars Templine Repl line This loop repeats until an end of frame is encountered in the master data file or until one of the other data files runs out of data loop a 1 Now replace a character for each data file Datafile codel False Datafile code2 False Chars left flag False for File num 1 to Last repl index call Get char File num Data char Code Column Glb repl cols Repl line ptr File num Templine Column 1 Data char if File num Master index then save master code Master code Code else I Set flags based on results from Get char if Code 0 then Set the characters left in file flag Chars left flag True end if if Code 1 then Set the code 1 flag Datafile codel True end if if Code 2 then Set the code 2 flag Datafile code2 True end if end if next File
3. United States Patent n9 1 Patent Number 4 967 412 Cain et al 45 Date of Patent Oct 30 1990 54 SERIAL DATA FRAME T pa TESTING TELECOMMUNICATIONS dn OTHER PUBLICATIONS CIRCUITS Siemens Telecommunications Data Book 1987 pp 5 2 78 I tors Christopher B Cain Robert E through 5 10 and 4 148 through 4 151 Apr 1987 75 Inventors opher D 5 Robert B CCITT The International Telegraph and Telephone McAuliffe Lynn A Schmidt Elaine Consultative Committee Digital Networks Transmis S jd si E Leo oe sion Systems and Multiplexing Equipment 1985 pp jefers Fort Collins ali of Colo 85 94 Hewlett Packard Journal Oct 1984 pp 1 35 73 A lett Packar Pal gt PP 73 a Snee AI aie d Company Palo Hewlett Packard 3065X L Board Test System Users Manual vol 1 System Reference HP part number 21 Appl No 179 373 03065 90090 Aug 1987 Chapters 7 pp 7 1 7 17 9 22 Filed Apr 8 1988 pp 9 1 9 72 23 pp 23 1 23 40 T Primary Examiner Charles E Atkinson 51 Int CLS GOIR 31 28 GO6F 11 00 Attorney Agent or Firm Christopher J Byrne 52 US CL alii 371 20 1 371 20 4 di omo DI ABSTRACT 58 Field of Search 371 27 22 20 1 20 4 Disclosed is a serial frame generator which generates 371 27 364 200 900 375 10 379 1 serial data which conforms to a user selected telecom munication protocol The serial frame generator can be 56 References Cited
4. Err msg String variable containing error message This dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node status Default_output Error Opened Type if Type Device then assign Output_error Error to Default output write shared if not Error and Type Device then output Output error Err msg else printer is print The default error reporting device for FGen Error is not available print the printer destination has been reset to the CRT print Err msg end if stop subend 11111111112 414 Stabo 08 6 4 09 0 de eet eei e 4 4 0 0 0 anie ee seti eie bestiae sheet ot MERGE USER SUBROUTINES H e pm en i omm ie a HC 4 967 412 57 58 TELECOM GEN FRAME_HDLC Rev 3 0 FRAME GENERATOR for the HDLC X 25 frame structure Copyright Hewlett Packard 1987 All Rights Reserved dee de de de eee de d RE He He He E He e deed t de de dc de de ce de dec de de TTT ETE rT PTET RE kke kke k kk kk kek kk kk k oe en ee eee eae ew en ee a ee en a ee ee es ee ae et eS To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 This places the edit cursor at the last line merge file id Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that
5. 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error NO ERROR then if Error FILE EXISTS then print print The file FileName already exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error lt gt NO_ERROR then call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if else don t want to write over file call FGen Error OpenFile USER STOPPED PROGRAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if end if subend 4 967 412 139 140 sub PrintBits Value Number of_bits This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the lt Number of bits gt parameter GLOBAL OUTPUTS nO mee no global outputs are exported un no global inputs are imported Value integer parameter Range 32768 32767 Number of bits Size of the boclean representation of the integer paraneter Range 1 16 if Number of bits
6. M IOM FRAME GENERATOR This program will generate framing data for the Siemens IOM protocol to be used as input for the PCF Generator Tool Copyright Hewlett Packard 1987 All Rights Reserved Ddidioeieiebekeeeipeelbeieibeeieeopeeopeeebeickcibepeeopoopeeeiebieeioppppeeioeniedipeipdeoneeeeieieeeieipopeeeeeeiee To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 I This places the edit cursor at the last line merge file id Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine
7. Reset the first replacement flag Repl flag False 4 967 412 19 192 Insert the line number of the new replacement line into the list Glb repl lines Repl ptr Line count Repl ptr Repl ptr 1 if Repl ptr Max repl lines then there are too many replacement lines in the file call Abort Too many replacement lines in Format File 0 end if end if end if Get a new line from the Format File Ffile line U enter Ffile Error Ffile line exit if Error lt gt 0 Line count Line count 1 end loop Process errors if Error lt gt End of file and Error lt gt C then there was an error while reading the Format File cali Abort Error occurred while reading the Format File Errox b tt i eno i if Repl ptr 0 then There were no replacement lines in the Format File call Abort No Replacement lines found in Format File 0 else Glb_max_repl Repl_ptr end if End of file is the normal termination for this routine subend i I l SUBROUTINE SCAN FFILE LINE i OPERATION This routine will scan a format file line 80 character string and return information about the line Each type of line that may be found in a format file is described below The operation of the scanner for each type of line is also given 1 Blank line the calling program should check for zero length lines and shou
8. 20 CH30 20 0 21 CH30 21 0 22 CH30 22 0 23 CH30 23 0 24 CH30 24 0 25 CH30 25 0 26 CH30 26 0 27 CH30 27 0 28 CH30 28 0 29 CH30 29 0 30 Control 0 255 Signal 0 255 The output file will be 1111111100000001 4 967 412 I This index represents a frame of data as follows 0000001000000011000001000000010100000110000001110000100000001001 000010100000101100001100000011010000111000001111111111110001000000010001 0001001000010011000101000001010100010110000101110001100000011001 0001101000011011000111000001110100011110 GLOBAL OUTPUTS GLOBAL INPUTS SUBROUTINE PARAMETERS FileName Control no global outputs are exported no global inputs are imported A string containing the file pathname of the output file The numb r of frames to be generated Range 1 MAX LEN Array id parameter containing 30 channels of pcm data This array must be dimensioned as a two 2y dimension array prior to calling chis suL outlue The first dimension holds the 30 tine slot values while the second dimension represents the full frame values for one frame Array id parameter containing 8 bit 0 255 control field data This array must be dimensioned as a single 1 dimension array of O to MAX LEN elements 4 967 412 47 48 Signal Array id parameter containing 8 bit 0 255 signal field data This array must be dimensioned as a single 1 dimensio
9. dd 0 dd tn e 0 i de n e de eom gem w lt sub Scan ffile line Repl line num Ffile line Repl flag i global Glb PCFGEN chars Glb repl chars Comm found global Glb PCF cols Glb line type Glb PCFGEN comm global Glb PCFGEN paraml Glb PCFGEN param2 True False first null out all global outputs Glb line type ut Glb_PCFGEN_comm ww Glb_PCFGEN_paraml un Glb PCFGEN param2 Line_len len Ffile line Length of the line to be scanned if Line_len 0 then call Abort Blank line found by scanner 0 end if Comm len len Glb PCFGEN chars Length of the PCFGEN comm sequence Start scanning if Ffile line 1 1 I and Ffile line 2 Comm len Glb PCFGEN chars then The line must be a PCFGEN command call PCFcom scan Ffile line Comm found True else 1 Make decision based on the first non blank character Trimmed line trim Ffile line if Trimmed_line 171 I then Line is a comment 4 967 412 197 198 Glb_line_type comment else if not Comm_found then 5 No PCFGEN command was found in the source call Abori He FCSCON cod aana uu aa iva le Slovan si Furnidt riie u else if Trimmed line 1 1 then Line is PCF call PCF scan Repl line num Ffile line Repl flag else if Glb line types then A valid line type has not yet been found so the line must be VCL Glb line type VCL statement end if end if end if end if end if
10. 1 Glb valid PCF chars The set of valid PCF characters goutfile The at name of the output file i sub Get char Dfile num Dfile char Code global Glb dfile buffer Glb dfile buffptr global 0utfile global Glb valid PCF chars True False Line type End of frame 0 End_of data 0 End_of line 0 dim Curr chars 2 The data files may contain comment lines blank lines and data lines non commented lines The data file buffers will always contain a data line upon entry to this routine except for the first entry when the buffer will be empty or when the data pointer gt 80 First handle the first entry and data pointer 80 cases Temp ptr Glb dfile buffptr Dfile num if len trim Glb dfile buffer Dfile num 0 or Temp ptr gt 80 then Read a line from the data file into the buffer and reset the buffer pointer call Read line Dfile num Glb dfile buffer Dfile num Glb dfile buffptr Dfile num 1 end if i Tho following loop will repeat until the buffer pointer is pointing to a real data character which will be right away unless it is pointing tn the end of a line end of a frame or end of the data loop Repeat False Trimmed line trim Glb_dfile buffer Dfile num POSN Glb dfile buffptr Dfile num if len Trimmed line O then Found a blank line write it to the output output GOutfile Error Glb dfile buffer Dfile num if Error 0 then c
11. 4 967 412 83 mE 84 This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format 1 USER MODIFIABLE PARAMETERS I I 0 Scratch variable MAX LEN 1000 Maximum number of frames Same value used in data field array dimensioning LEN 0 Default number of frames to generate dim B1 1000 Channel B1 field array max elements 32766 dim B2 1000 Channel B2 field array max elements 32766 dim MONI 1000 Monitor field array max elements 32766 dim D 1000 Channel D field array max elements 32766 dim C 11209 C I field array max elements 32766 dim TE 1000 T and E fields array max elements 32766 print using e print IOM FRAME GENERATOR print print loop input Enter number of frames to be generated LEN exit if LEN gt 1 and LEN lt MAX A print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop 111111111111111111111111 11111 EXAMPLE 1111121112125221222812132122111211111 Data field Bl is generated from dsp subroutines tone and mu law print input Enter the tone frequency Hz to be generated f Frequency use rms value to produce full range VRMS 8159 sqr 2 for MU LAW Phase 0 SampFrequency 8000 call Tone VRMS Frequency Phase SampFrequency LEN Bl call MU law LEN B1 Be sure to merge TONE
12. This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if l 1 t t 1 eight 8 bits are requested in the Number of bits parameter 1 4 967 412 21 22 GLOBAL OUTPUTS MM vorsetsstenste no global outputs are exported mp u a no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 3 Ei if Number of bits 1 or Number of bits 16 then call FGen Error PrintBits Number of bits lt 1 or Number of bits 16 n xd if if Value lt 32768 or Value gt 32767 then call FGen Error PrintBits Value lt 32768 or Value gt 32767 end if Buffers n for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I print Value Buffer s subend sub FGen Error Err msg ame M t At M SS e un M 4 io dus ets t to M um at b dO Um HH D UU RE HD D SAS ID o aho RO ts an m m m s m c ma m nt t This routine reports an error message from the Err msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible
13. before and that we should assign the character to the arrays Glb repl chars Repl char num Current char Glb_ PCF _cols Repl_ char num PCF col Glb_ repl_ cols Repl line num Repl_ char num Column Repl_ char_num Repl char_ num 1 PCF_ col PCF col 1 else Repl flag was false end if Don t put the character into the arrays but check for correctness if Current_char lt gt Glb repl chars Repl char num then call Abort Invalid or out of order replacement character 0 end if if PCF col Glb PCF cols Repl char num then cali Abort Replacement character in wrong column 0 end if Glb repl cols Repl line num Repl char num Column Repl char num Repl char num 1 PCF col PCF_colk 1 end if if not Valid PCF char and not Valid repl char and PCF flag then We have found an invalid character inside of the PCF call Abort Invalid replacement character on PCF line 0 end if if Current char and not PCF flag then The current character is a comment and not inside a PCF field Set the comment flag Comment 1 d end if end if not Column Column 1 end loop If we get here and have not incremented Repl_ char num then there were no replacement characters Set the Glb_ line _ types variable accordingly if Repl char num 1 then no replacement characters Glb line type PCF norm else there were replacement characters Glb line
14. sno e e ti e a n e ae Tuis routine reads an ASCII text file of integer data cne integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain iengu sumer of integers an error occurs ana program execution is stopped GLOBAL OUTPUTS Ti SSeS sss no global outputs are exported GLOBAL INPUTS Nt ____ no global inputs are imported SUBROUTINE PARAMETERS FileName A string the containing file pathname of the file to be read into the Array parameter Length The number of integers to be read into the Array parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 we a nw oa ae oe ce re ee ee NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign File Error to FileName if Error NO ERROR then cali FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if for Index 0 to Length
15. 0 LowZero 0 Buffl Buff2 The DC balancing bit following the framing bit is always a low zero call Code SBUS_Bit 0 LowZero NumZeros Buff1 Buff2 output rilePtrl Buffl output FilePtr2 Buff2 Buffl Buff2 Bl channel octet NumZeros 0 Start counting zeros for balance bits LowZero FALSE First zero valued bit of Bl is a low zero call GetBitsSBUS Bl Frame 2 0 8 LowZero NumZeros Buff1 Buff2 output FilePtrl Buffl output FilePtr2 Buff2 Buffl Buff2 K i cl DC balancing bit 1 DC_Balance NumZeros 1 mod 2 7 call Code_SBUS_Bit DC_balance LowZero NumZeros Buff1 Buff2 D channel bit NumZeros 0 Start counting zeros for balance bits call GetBitsSBUS bit D Frame 3 l LowZero NumZeros Buff1 Buff2 i DC balancing bit i DC Balance NumZeros 1 mod 2 call Code SBUS Bit DC balance LowZero NumZeros Buff1 Buff2 Auxiliary framing bit I NumZeros 0 Start counting zeros ror balance bits dai IEEE Foros suxils Bvy harm Qe sc 4 Cage call Code SBUS Bit o Lewzero NumZeros Buff1 Buff2s j DC balancing bit om DC Balance NumZeros 1 mod 2 call Code SBUS Bit DC balance LowZero NumZeros Buff1 Buff2 output FilePtrl Buff1 output FilePtr2 Buff2 Buffl Buff2 B2 channel octet 1 NumZeros 0 Start counting zeros for balance bits call GetBitsSBUS B2 Frame
16. Glb PCFGEN comm the first param will be assigned to Glb PCFGEN param1 and the second parameter will be assigned to Glb PCFGEN param2 if a parameter does not exist it will be assigned the null string this type of line is defined as a line with a double quote as the first non blank character When the scanner finds this type of line it will check all characters between quotes to make sure they are either valid PCF characters or valid replacement characters The set of valid replacement Characters 3 is stored according to their replacement order in the array called Glb repl chars The PCF column associated with each replacement character is stored in the array Glb PCF cols If the Repl flag is set 1 values will be stored into the arrays otherwise the values will be compared to the existing array entries If valid replacements are found the value PCF repl will be assigned to Glb line type otherwise the value PCF norm will be assigned this type of line is defined as a line with any non blank and non character preceeding the first comment character or a line that does not contain a comment character The scanner DOES NOT check for correct VCL syntax When a line of this type is found the scanner will assign the value VCL_statement to the variable Glb line type Note that any line which begins with one or more statement separators will be interpreted as this type of line Re
17. LEN TE print call Generate iom iom file LEN Bl B2 MONI D C I TE print print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program He ten ie eee rene dis cerco A RO COSA aie tolti PROGRAM SUBROUTINES si LI RAZZE ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZEZZZ CERCA ZE ZE EC RE RE RE This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop An IOM frame is shown below o 0 a e ad em s dd 0 s I I I 1 dt te i ee e ed ee 4 967 412 qe e EI m ee ee ee ee re a B1 B2 MONITOR D c I T E The first three fields consists of eight bits MSB first LSB last Communication channels are the Bl B2 and D The MONITOR field is used to signal line termination and error rate information The C I field command indicate is used to control message flow and is four bits wide The D channel is two bits long and the T and E are a single bit each GLOBAL OUTPUTS WH Sete See no global outputs are exported GLOBAL INPUTS CT clicco no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output file Le
18. Nexwhsss i Set Ben if N xtchar lt len Glb dfile buffer Dfile num then s if Glb dfile buffer Dfile num Nextchar 1 1 then Set the end of data code Code 2 Set the end of frame code else Code 1 end if Set the end of frame code else Code 1 A end if end if Now increment the pointer for next time Glb dfile buffptr Dfile num Nextchar subend Dfile num The index number of the data file to be read OPERATION I This routine simplifies the access to the data files The index number of the file to be read is passed to H the routine and the next line in that particular file is read and passed back to the calling routine l i WC SS SS 3888 i 1 i INPUTS 1 l l i 1 4 967 412 233 234 1 OUTPUTS i f Dfile line The line read from the specified l file GLOBAL VARIABLES USED Dfilel Dfilel6 The at names of the 16 possible data files End_of_file The end of file error code i ues De 1 1 sub Reat lis2 0 i 1e cum ofile ines global Dfilel Dfile2 Dfile3 Dfile4 global Dfile5 Dfile6 Dfile7 Dfile8 global Dfile9 Dfilel0 Dfilell Dfilel2 global Dfilel3 Dfilel4 Dfilel5 Dfilel6 global End_of file Dfile line on Dfile num goto D1 D2 D1 enter Dfilel Error goto Exit D2 enter Dfil
19. Value I next I subend sub ReadArray FileName Length Array uo re A TV uu A ame e 702 This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped GLOBAL OUTPUTS um cmn no global outputs are exported GLOBAL INPUTS n _ _____ _ no global inputs are imported SUBROUTINE PARAMETERS FileName A string the containing file pathname of the file Lo he bead into the Assay pacanetec Length The number of integers to be read into the Array parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 em sm e NO_ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS Buffer String parameter to which the boolean representation 4 967 412 77 assign File Error to FileName if Error lt gt NO ERR
20. WRONG FILE TYPE 101015 i FILE NOT ASSIGNED 136 FILE EXISTS 275 assign File Error to FileName if Error lt gt NO_ERROR then Buffer String parameter to which the boolean representation 4 967 412 137 138 call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if for Index 0 to Length 1 enter File Error Array Index if Error lt gt NO ERROR then if Error EOF then call FGen_Error ReadArray MORE DATA EXPECTED FROM amp FileName amp else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if end if next Index subend sub OpenFile FileName FilePtr This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs the error is reported to the CRT and program execution stops GLOBAL OUTPUTS un no global outputs are exported GLOBAL INPUTS NNO veneer ssa ees no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output text file FilePtr The file pointer If the file is opened this pointer may be used by output statements to write data to the file e om om em om te ee te i i i pe a rs a er er a ae aa ae ee er ee nn ee ne enn NO_ERROR 0 EOF
21. computing means incorporated in said circuit board tester for controlling the operation of said genera tor data generation means for generating user specified input information 30 45 50 35 65 240 Since this routine is the last thing done in PCFGEN it is all right to ignore any file close errors that may occur data framing means for inserting said user specified input information into data frames which conform to a user selected protocol data sequence generation means for generating data sequences from said data frames which data sequences are executable by said computing means merge means for merging said data sequences with a programming language to create code which is executable by said computing means 3 In a circuit board tester a data code merger for merging circuit test data with a circuit test program ming language template to produce a hybrid data code file which can be executed by a circuit board tester said merger comprising computing means incorporated in said circuit board tester for processing data and programming lan guages parsing means controlled by said computing means for interpreting said programming language tem plate merge means controlled by said computing means and interfacing said parsing means for merging said circuit test data with said language template to produce said hybrid data code file x
22. if Error EOF then call FGen_Error ReadArray MORE DATA EXPECTED FROM EFileNamesa else call FGen Error ReadArray FILE ERROR amp rileNameS amp amp errm Error end if end if next Index subend sub OpenFile FileName FilePtr I This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs the error is reported to the CRT and program executi n stops GLOBAL OUTPUTS ui eee ea SSeS no global outputs are exported GLOBAL INPUTS WH no global inputs are imported SUBROUTINE PARAMETERS f FileName string containing the file pathname of the output text file FilePtr The file pointer If the file is opened this pointer may be used by output statements to write data to the file NO_ERROR 0 i EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error lt gt NO_ERROR then if Error FILE_EXISTS then print print The file FileName already exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error lt gt NO ERROR then call FGen_Error OpenFile FILE ERROR amp FileName amp S amp errm Err
23. the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS MU vTeemeece no global outputs are exported ui acccscssianen no global inputs are imported Err msg String variable containing error message This message is sent to the printer device se e sme t tu e I 1 1 i I I I I I I 1 1 I I I i I t I 1 i i l I I I I I I I I I I I i L I I dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node status Default output Error Opened Type if Type Device then assign eoutput_ error Error to Default output write shared if not Error and Type Device then output amp Output error Err msg else printer is print The default error reporting device for FGen Error is not available print the printer destination has been reset to the CRT print Err msg 4 967 412 23 24 TABLE OF CONTENTS APPENDIX B Tone PRBS A LAW MU_LAW f U_ noise G_ noise A to D Idle_Code Digital_mW DEEELELEEEEEELEEEEEEELELEEE EE EEREEEEEEIPEEILEELEEEEEEELE EE EL LLL ELLE LE EL ELLE tint I 1417 Itt MERGE USER SUBROUTINES HERE bcd rri il Dill 11r M in 1111111111111111111111111111 1111111811111111111111111111111111111111111 1111111 TELECOM GE
24. 1 enter File Error Array Index if Error NO ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileName amp else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if end if next Index subend sub OpenFile FileName FilePtr i l 1 i l a ae ae ee a ams cs ce se me t ee a a a tp e t ee we me M ne a ee rt en e e a eee This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs the error is reported to the CRT and program execution stops 4 967 412 107 108 uno _ no global outputs are exported GLOBAL INPUTS WN no global inputs are imported SUBROUTINE PARAMETERS E FileName A string containing the file pathname of the output text file FilePtr The file pointer If the file is opened this pointer may be used by output statements to write data to the file e o o o em sa die 0m tn om pme PPP NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE_EXISTS 275 assign FilePtr Error to FileName write new if Error lt gt NO_ERROR then if Error FILE EXISTS then print print The file FileName already
25. 2 0 8 LowZero NumZeros Buffl Buff2 2 output FilePtrl Buff1 output FilePtr2 Buff2 BufflS Rn f aae A 1 TOS DC balancing bit 1 4 967 412 149 150 DC_Balance NumZeros 1 mod 2 I t dem N call Code SBUS Bie Dc EUN LowZero NumZeros B ffl1 BEff2 D channel bit 1 NumZeros 0 Start counting zeros for balance bits call GetBitsSBUS bit D Frame 2 1 LowZero NumZeros Buffl Buff2 1 DC balancing bit DC Balance NumZeros 1 mod 2 call Code SBUS _Bit DC balance LowZero NumZeros Buffl Buff2 output FilePtrl Buffl output FilePtr2 Buff2 Buffls Buff2 B1 channel octet 1 NumZeros 0 Start counting zeros for balance bits call GetBitsSBUS Bl Frame 2 1 8 LowZero NumZeros Buffl Buff2 output FilePtrl Buffl output FilePtr2 Buff2 Buffl Buff2 I DC balancing bit DC Balance NumZeros 1 mod 2 call Code SBUS Bit DC balance LowZero NumZeros Buffl Buff2 1 D channel bit NumZeros 0 Start counting zeros for balance bits call GetBitsSBUS bit D Frame 1 1 LowZero NumZeros Buffl Buff2 DC balancing bit DC Balance NumZeros 1 mod 2 call Code SBUS _Bit DC balance LowZero NumZeros Buffl Buff2 pupur FilePtrl Buff1 output FilePtr2 Buff2 Buffl Buff2 w B2 channel octet 2 1 NumZeros 0 Start counting zeros for balance bits call Get
26. 8SH sie 139 GLZ ELZ M 697 ANILNOHENS NOLLVYIN30 INVUI TIVI 21030 L04d 19 SYANILNOY 2 90 3imo3x3 792 852 710301044 N3S0HD V OL ONIMHIHNOO SINVY4 40 YIENNN No S1S3n038 YISN 9314 VIVO NILLIHM HISN AVIY Avuuv v3 US Patent Oct 30 1990 Sheet 6of10 4 967 412 START FRAME GENERATION SUBROUTINE 280 284 CREATE FILE FRAME DATA FILE 130 CONVERT DAT FROM STEP 258 AND OR 264 TO FRAME FORMAT PRINT BITS 288 TO FRAME DATA FILE 130 CLOSE FRAME DATA FILE 130 4 967 412 Sheet 7 of 10 Oct 30 1990 US Patent G Sid YOLVYANAD 3002 DANOS Ad 3003 YNOS Ad 38 VdWA027 DA 313 INAINO Ad 4 967 412 Sheet 8 of 10 Oct 30 1990 US Patent o DI TE osl jpadaJ pua Iq INN 3jn2axo s w Gg jDadal Jod pua Bla pd SjuaWa DIS d PUD TJA sumjuo2 uolj3 s woIBOIY DIDD D p x Wet SJOJIBA d 3U ul 3D d 1 0 JajIDIDYD Auunp ayy SI ppaJ aq 0j ayy DIDD 3WDIj By SD DJDp D p sayi2eds ji punuwod usbj3d D SI BUIMO O4 Siq OM SUIDJUOI JOJIBA Dd XX iq jpg lt DjOp pIIDA S JapJ0 Aq aui xa 33002 Y Q 10 aJ JDWJOH US Patent Oct 30 1990 Sheet 90f10 4 967 412 a 2 be 9 ne A QJ cO 9 g T EPEE T 2 O LL LL o e we Q oo e e 2 US Patent Oct 30 1990 Sheet 100f10 4 967 412 75 F
27. Ease outs the Geb chaz Sig strut bile Purse a SSS LA routine PCF_repl_frame receives a data character and a result code from the Get_char routine and uses this information to build the PCF line and to set the value of Glb repl error code for the Code gen routine The result codes returned by Get_char are 0 Normal data character has been found 1 The last data character in a frame has been found 2 The last data character in the file has been found Note that code 2 takes precedence over code 1 that is the last data character in a file is indicated by code 2 even though it is also the last character in a frame INPUTS Repl line The current line to be replaced OUTPUTS none x GLOBAL VARIABLES USED Glb_repl_cols The array that specifies the columns where replacements are to occur Glb_valid_repl_chars The list of valid replacement chars Glb repl chars The ordered list of replacement chars Glb master repl char The master replacement char Glb repl error code The error code used by the Code gen routine outfile The at name of the output file i End of file The end of file error code 1 1 I i Il LI 1 i I 1 1 1 Repl_line ptr The index of the current replacement line I t 1 1 1 1 1 1 1 1 I 1 l 1 I 1 1
28. I TE 0 0 T 0 and E 0 TE 0 1 T 0 and E 1 TE 0 2 T 1 and E 0 TE 0 3 T 1 and E 1 Each element is sent in its boolean representation to the output file as part of a frame Must be dimensioned prior to calling this routine single dimension 1 32766 4 967 412 89 90 dim Buffer 80 call OpenFile FileName FilePtr for Frame 0 to Length 1 Buffer wn call GetBitsMSB Bl Frame call GetBitsMSB B2 Frame call GetBitsMSB Monitor Frame call GetBitsMSB D Frame call GetBitsMSB C I Frame call GetBitsMSB TE Frame i N fa IN 00 00 00 Li Li Buffers The last frame of data ends with two characters 1 if Frame Length 1 then output FilePtr Buffer else output FilePtr Buffer end if next Frame close the output file 1 assign FilePtr Error to subend sub GetBitsMSB Value Number_of_bits Buffer Ky This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter Note If the Value parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the ea string parameter GLOBAL O
29. If the Value parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter I 4 967 412 15 16 GLOBAL OUTPUTS tr sss no global outputs are exported WH _____ _ _ no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended e om om ome ome pme om i i tte if Number of bits lt 1 or Number of bits gt 16 then call FGen Error GetBitsMSB Number of bits 1 or Number _ of bits 16 end if if Value 32768 or Value 32767 then call FGen Error GetBitsMSB Value lt 32768 or Value 32767 end if for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend E rie GetBitsLSB Value Number of bits Buffer i es ee ee es cs re es ee 060000201 0 1 1110102 n 9 to t t n nanni This routine retrieves the boolean representation of an integer g paramecer and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in t
30. LEVEL 4 t ERROR HANDLER File Clean up 1 WARNING HANDLER i 1 ____ _ _ 1 INPUTS none I 1 OUTPUTS none GLOBAL VARIABLES USED i Ffile The at name of the Format File i outfile The at name of the Output File 1 Glb ffile name The name of the user supplied Format File Glb outfile name The name of the file where the PCFGEN output is to go note The Data File names are supplied by the Format file header block See Manuals for Syntax The following variables are used for the replacement character linked list data structure Each PCF replacement line found in the Format File is assigned an index number This index number is used to point into the arrays defined below 4 967 412 181 182 dim Glb_repl_lines 0 100 The Formac rile line number of each PCF replacement line is stored in this array The 100 dimension allows 100 replacement lines per Format File The following variables keep track of the current valid replacement characters those characters defined in the Format File header and the PCF column each of the characters is assigned to The max dimension of these arrays must match the Max repl chars constant dim Glb valid repl chars 16 A string containing all of the current valid replacement characters The array which maps a replacement character index to the actual replacement 1 e character dim Glb repl chars 1 16 1 The array w
31. LIL 1111 0111 1111 1111 1111111111111111111111111111111111111111111111111111111111111111111111111111111i TELECOM GEN FRAME SLD M Rev 3 0 Frame Generator for the Siemens SID protocol 4 967 412 lil 112 To add other DSP subroutines simply type in the following BIBasic commands at the command line edit 9999 merge file id This places the edit cursor at the last line Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format H The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine 1 The subroutines following the framing subroutine are standard throughout 1 the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine t 1 This allows the user to have complete contro
32. MAX LEN print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop RIG I SGC IAI OIC ISO GIO III II III IAT RR IA IIIS Retrieve Generate field data for frame s VHRR AK RH RRR KERR KIKI EEEE RAKE REI REE ARERR RIERA ER ERE ERIK EERIE RARE KERRI ERE 11111111 11111111111311111J11111 EXAMPL E 111111111111111 11111111111111111 DSL LL oo o o oo ona op o 1l A DI r Lo Sk 000 Retrieve CHANNEL1 field data from a text file 1 print FileName chi data print Retrieving CHANNEL1 field data from FileName call ReadArray FileName LEN CH1 print r print input Enter the tone frequency Hz to be generated Frequency 1 use rms value to pro uce full range VRMS 8159 sqr 2 for MU_LAW Phase 0 SampFrequency 8000 call Tone VRMS Frequency Phase SampFrequency LEN CH2 call MU law LEN CH2 1 Be sure to merge TONE and MU IAW at end of test print print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program 2 gs grea ATER DERI ican PER QE os PIE SEAS rel PROGRAM SUBROUTINES TELI rit III 2 c s q ae s sa ae TNT sl lllll2ll22t2t5lllblsy s 4 967 412 131 132 sub Generate frame FileName Length Channell Channel2 emm lt DYyykycakyk M aIi y od zq Q rF II IKK K P I K a M _ _ This routine will open the output fi
33. Number of bits gt 16 then call FGen Error GetBitsLSB Number of bits lt 1 or Number of bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsLSB Value lt 32768 or Value gt 32767 end if for I 0 to Number of_bits 1 Buffer Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped GLOBAL OUTPUTS SSO E SPSS SISI no global outputs are exported GLOBAL INPUTS NMC assseznsesone no global inputs are imported FileName A string the containing file pathname of the file to be read into the Array parameter Length The number of integers to be read into the Array parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 em em Om om ome pm i i eee s L NO_ERROR 0 EOF 101007 FILE NOT FOUND 100009
34. a single l dim cf 0 to MAX INFO elements Althoug e AGGr and Control arrays have each element placed i a frame the Info array can have any number of elements placed in a frame The values in the Info array are placed in the INFORMATION field of the HDLC frame until an integer value of 1 gh th is encountered in the sequence of elements in the Info array The number of elements in the Info array does NOT correspond to the number of elements in the Address or Control field arrays wee we ee we a ea we ee ee we we ww ow wen ee ew wn 111 2 70752 7 97 00 72 nee eee 59 4 967 412 m print using e print HDLC FRAME GENERATOR print print loop input Enter number of frames to be generated LEN exit if LEN 1 and LEN MAX LEN print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop 11111111111111111111111113111 EXAMPLE 11 111111111111111111111111111i 1 Retrieve ADDRESS field data from a text file print FileName hdlc addr print Retrieving ADDRESS field data from n FileName w call ReadArray FileName LEN ADDR print 1I1l111111111111111111111 EXAMPLE 11111111111111111111111111111111 1 1 Retrieve CONTROL field data from a text file print FileName hdlc ctrl print Retrieving CONTROL field data from FileName call ReadArray FileName LEN CTRL print 1111111111111111111111111111 1 EXAMPLE 111111111111111
35. amp can not be used as replacements call Abort EPCFGENS 0O end if 4 967 412 211 212 if pos Glb valid repl chars Glb PCFGEN naraml lt gt 0 then This replacement character has already been used ECFGENS Duplicate replacement chasvacece Gib PCFGEN caraml EPCFGENS EPCFGENS amp found in command line call Abort EPCFGEN S 0 end if if len Glb valid repl chars gt Max repl chars then The data files are all used up call Abort Too many replacement commands iin header 0 end if Glb valid repl chars Glb valid repl chars amp Glb PCFGEN paraml Glb repl count Glb repl count 1 P Assign the replacement character to a data file call Assign_dfile goto Exit Any additional commands should be implemented here and accessed with the command jump table Exit subend ol C be o G H Hi ti m m H Q g nj H p tj OPERATION This routine will assign an Dfile to the file name specified by Glb PCFGEN param2 The DfileX file that will be used is determined from X Glb repl count i INPUTS none OUTPUTS none GLOBAL VARIABLES USED Glb_repl_count The replacement count tells the routine which data file is to be used next Glb PCFGEN param2 This will be the file name to use for the assignment mme em Sd tm Vu ome Sm Il II Il Il H Il Il Il
36. analog samples as shown in box 53 is either read from a file or generated directly by the present invention This digital data is then inserted into a user selected serial frame protocol format as shown in box 56 As shown in box 56 a given serial frame protocol format will have defined fields Box 56 shows a 24 channel T1 frame having a lead framing bit followed by 24 8 bit data channel fields Typically when testing a telecommunications circuit with serial frames certain frame fields will remain constant from frame to frame while other fields such as a given chan nel in a T1 frame such as channelo will vary with each frame Thus the generated digital data as represented by box 53 will typically be inserted in the variable frame fields while the constant fields will simply be repeated from frame to frame The serial frames are then converted into VCL compatible PCF source code as shown in box 59 The PCF source code like VCL can be compiled linked and executed by the HP 3065 FIG 3 shows a schematic diagram of the present invention The user will input a request on an HP 3065 for serial frame data with which to test a given telecom munications circuit board User Input 75 is processed by Serial Frame Generator 125 User Input 75 will specify the type of data for which serial framing is required and the protocol to which the serial frame data must con form Serial Frame Generator 125 generates the actual serial frames which co
37. and MU LAW at end of test 11111111111111111111111111111 EXAMPLE 1 1 1111111111111111111111111 4 q 00 0 esa 1 Retrieve B2 field data from a text file l print FileName iom b2 print Retrieving B2 field data from FileName call ReadArray FileName LEN B2 print 1111111111111111111111111 111 EXAMPLE 111111111111111111111111111111 oe s i aq I 1 A4 PF I1 FE lh L sassa Retrieve MONITOR field data from a text file print FileName iom moni print Retrieving MONITOR field data from FileName call ReadArray FileName LEN MONI print 4 967 412 85 86 11 11111111111111111111i111111 EXAMPLE 1F 1 111111111111111 1111111111111 1 i Retrieve D field data from a text file 1 print FileName iomfa print Retrieving D field data from FileNameS call ReadArray FileName LEN D print 11 1111111111 111 1111 1 1 111 EXAMPLE 1 F1 111111111 1111111111111111111 1 1 Retrieve C I field data from a text file 1 print FileName iom c_ i print Retrieving C I field data from FileName call ReadArray FileName LEN C_I print 11 111111111111111111111111111 EXAMPLE 1111111111111111111111111111111i Retrieve T and E field data from a text file print FileName iom te print Retrieving T amp E field data from FileName call ReadArray FileName
38. are read from the file an error is reported and program execution is stopped Wir umen nem no global outputs are exported GLOBAL INPUTS It ee no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the file to be read into the lt Array gt parameter Length The requested number of frames parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned as a single 1 dimensioned array prior to calling this subroutine The array indices range from 0 to 32766 M e M ae e i ze 9 ee NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 END OF SEQUENCE 1 FrameCount 0 Index 0 assign File Error to FileName if Error lt gt NO ERROR then call FGen Error ReadFile FILE ERROR amp FileName amp amp errm Error end if loop enter File Error Array Index exit if Error EOF if Error lt gt NO ERROR then call FGen Error ReadInfo FILE ERROR amp FileName amp amp errm Error end if if Array Index END OF SEQUENCE then FrameCount FrameCount 1 if FrameCount Length then call FGen Error ReadInfo REQUEST
39. asi This routine does transparency bit checking and calculates the next CRC2 value for each bit in the lt Buffer gt parameter GLOBAL OUTPUTS WO imeem no global outputs are exported GLOBAL INPUTS _____ no global inputs are imported SUBROUTINE PARAMETERS TransCount Integer parameter Range 0 5 CRC2 Integer parameter Range 32768 32767 Buffer String parameter containing the latest output buffer dim Temp 80 Temp nm if TransCount 0 or TransCount 5 then call FGen Error ReadyForOutput TransCount lt 0 or TransCount gt 5 end if 4 967 412 67 68 if CRC2 lt 32768 or CRC2 gt 32767 then call FGen Error ReadyForOutput CRC2 32768 or CRC2 gt 32767 end if for I 1 to len Buffer Hbit val Buffer I1 1 Temp Temp amp Buffer I 1 t Insert transparency bit if a sequence of five ones is found t z if Hbit then 1 found increment transparency count TransCount TransCount 1 else t 0 found reset transparency count TransCount 0 end if if TransCount 5 then Insert transparency bit TransCount 0 Temp Temp amp o end if call CRC Hbit CRC2 next I Buffer Temp subend mus CRC Ibit Checksum me Q ay This routine calculates a the next CRC Cyclic Redundancy Check using Checksum as the previous CRC register value and Ibit a
40. at a time in parallel to the circuit board under test Telecommunication circuit boards however present a special problem in circuit board testing serial data protocols Essentially all modern telecommunication schemes obey some sort of serial data protocol such as the X 25 HDLC protocol for wide area networks the Integrated Services Digital Network ISDN S Bus pro tocol CCITT 1 430 the 24 channel U S T1 telephone protocol and so forth Common to all such protocols is the organization of information in the form of serial frames The protocol defines the structure of the frame Consider for instance the 24 channel U S T1 tele phone protocol analog voice signals are sampled and the samples are digitized each digitized sample consists of one byte of information samples are grouped in a 24 channel serial frame each frame is 193 bits long consisting of a lead framing bit followed by 24 bytes where each byte is a single sample from a given chan nel Communication over the T1 systems occurs via transmission of T1 frames A typical T1 circuit which may require testing is a T1 coder decoder Codec such as the National Semicon 5 10 15 20 25 30 35 40 45 50 55 60 65 2 ductor Company model TP 3064 Codec A Codec is a T1 circuit which interfaces between the network and a telephone and serves to convert analog signals to digital A D and digital signals to analog D A In the digi tizing pr
41. c output 6eFilePtr 22222222222222222222222222222222 RECEIVE for end if next Frame else a7 Place field data in the second half frame Frame 0 to Length 1 output grilePtr 22222222222222222222222222222222 Buffer call GetBitsMSB CHA Frame 8 call GetBitsMSB CHB Frame 8 call GetBitsMSB call GetBitsMSB Control Frame 8 Signal Frame 8 The last frame I If the user requests that the data be placed in the second frame pad the first frame with drive don t cares Z RECEIVE Buffer Buffer Buffers Buffers of data ends with two characters if Frame Length 1 then output amp FilePtr Buffer TRANSMIT else output FilePtr Buffer TRANSMIT end if next Frame close the output file ssign FilePtr Error to subend Fub GetBitsMSB Value Number of bits Buffer om am om t parameter and appends it to a string parameter are stripped from MSB most significant bit to LSB least Example decimal value 23 Note If the lt Value gt parameter range for the lt Number of bits gt significant bit eight 8 bits are requested in This routine retrieves the boolean representation of an integer The boolean values 00010111 if the Number of bits parameter is greater than the 2 s complement parameter requested the extra bits 4 967 412 119 qus 120 withing the Value parameter are ig
42. call FGen Error PrintBits Value lt 32768 or Value gt 32767 end if Buffer for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I print Value Buffer subend sub FGen_Error Err_msg This routine reports an error message from the Err msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS UC omne nente no global outputs are exported MI SSS mm isis no global inputs are imported Err msg String variable containing error message This message is sent to the printer device dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node 4 967 412 81 82 status Default output Error Opened Type if Type Device then assign Output error Error to Default output write shared if not Error and Type Device then output output_error Err_msg else printer is print The default error reporting device for FGen Error is not available print the printer destination has been reset to the CRT print Err_msg end if stop subend EEEEELEEEELEEELELEEELEEEEEELEELELEEEEEEL E ELE LELELELELE LEE EE LEE LLL LER L 2 1111 fry 1111 MERGE USER SUBROUTINES HERE CELI prr E LiL TIT V V n TELECOM GEN FRAME IOM I Rev 3 0 me
43. contains a sequence of 8 bit values 0 255 followed by the integer value of 1 This allows the user to define any number of 8 bit boolean data values for the INFORMATION field within an HDLC frame HDLC bit stream FLAG ADDRESS CONTROL FCS FLAG FLAG ADDRESS CONTROL INFORMATION FCS FLAG Where FLAG 01111110 bit pattern ADDRESS 8 or 16 bits CONTROL 8 or 16 bits INFORMATION N number of octets 8 bit words N is an integer value FCS Frame Check Sequence calculated from ADDRESS CONTROL and INFORMATION fields EXAMPLE Generate one frame of HDLC from the following data within the field data arrays Address 0 168 Control 0 85 Info 0 1 Info 1 2 Info 2 3 Info 3 4 Info 4 1 Produces the following cutput file GLOBAL OUTPUTS ME LL SSPSSSSESE no glebal outputs are exported GLOBAL INPUTS UNO e no global lo are imported SUBROUTINE PARAMETERS FileName String containing file pathname of the output file Length The number of frames to be generated Range 1 MAX LEN Address Array id parameter containing the HDIC address field data This array must be dimensioned as a single 1 dimension array of 0 to MAX LEN elements prior to calling this subroutine Control Array id parameter containing the HDIC control field data This array must be dimensioned as a single 1 dimension array of 0 to MAX LEN
44. elements prior to calling this subroutine 4 967 412 63 64 Info Array id parameter containing the HDLC information field data This array must be dimensioned as a single 1 dimension array of 0 to MAX INFO elements Although the Address and Control arrays have each element placed in a frame the Info array can have any number of elements placed in a frame The values in the Info array are placed in the INFORMATION field of the HDLC frame until an integer value of 1 is encountered in the sequence of elements in the Info array The number of elements in the Info array does NOT correspond to the number of elements in the Address or Control field arrays Bo dd ee n A e Puk 9o f 4 aom 0 dim Buffer 80 FLAG 8 FLAGS 01111110 MAX BUFFER SIZE 60 ADDRESS_SIZE 8 CONTROL SIZE 8 call OpenFile FileName FilePtr InfoCount 0 for Frame 0 to Length 1 FirstBuffer 1 Boolean used to output opening flag Buffer ww Initialize output buffer BitCount 0 Counter for frame bits TransCount 0 Transparency bit counter CRC2 0 Second CRC for FCS calculation BitCount BitCount ADDRESS SIZE TM Lari VELZICSLSB Aduress Irae j SOLRESS_ 517 Dail erg BitCount BitCount CONTROL SIZE sLS call GetBit B Control Frame CONTROL SIZE Buffer loop exit if Info InfoCount 1 BitCount BitCount 8 call GetBitsMSB Info InfoCount 8 Buffer InfoCount InfoCou
45. if for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend sub GetBitsLSB Value Number of bits Buffer s s s o am P This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the Nunber of bits parameter More D the lt Value paerameter is greater thes Une ife Cosmplonont range for the Number of bits parameter requested the extra bits withing the lt Value gt parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS nie wassap no global outputs are exported 4 967 412 7 76 nto l no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 is appended OM if Number_of bits lt 1 or Number_of bits gt 16 then call FGen Error GetBitsLSB Number of bits l or Number of bits gt 16 end if if Value 32768 or Value 32767 then call FGen Error GetBitsLSB Value 32768 or Value 32767 end if for I 0 to Number of bits 1 Buffer Buffer amp val bit
46. il Il Il it Il ll Il Il Il I Il Il Il Il Ii Il Il l Il Il Il Il Il Il q Il l Il Il Il lI Il Il Il Il Il Il Il il Il Il Il Il il Il Il Il H Il lI Il Il Il Il Il Il Il Il It It li ll li lI sub Assign_dfile qinhal Glh ren connt Glb PCFGEN param2 Max repl chars global File not found Wrong file type PURI A MEL DN gropai evfiled 6eDriieo Drlle7 WUfiiai global Dfile9 DfilelO Dfilell Dfilel2 global Dfilel3 Dfilel4 Dfilel5 Dfilel6 al BOSiLtear NIMMT yt tss Imp Glb repl count This is the jump table for the assignments on Jmp goto D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 4 967 412 213 214 Di assign Dfilel Error to Glb_PCFGEN_param2 read shared goto Exit D2 assign Dfile2 Error to Glb PCFGEN param2 read shared goto Exit D3 z assign Dfile3 Error to Glb PCFGEN param2 read shared goto Exit D4 assign Dfile4 Error to Glb_PCFGEN_param2 read shared goto Exit D5 assign Dfile5 Error to Glb_PCFGEN_param2 read shared goto Exit D6 assign Dfile6 Error to Glb PCFGEN param2 read shared goto Exit D7 assign Dfile7 Error to Glb PCFGEN param2 read shared goto Exit D8 assign Dfile8 Error to Glb PCFGEN param2 read shared goto Exit D9 assign Dfile9 Error to Glb PCFGEN param2 read shared goto Exit D10 assign Dfilel0 Error to Glb_PCFGEN_param2 read shared goto Exit D
47. is not valid PCF call Abort Invalid PCF character found in data file 0 end if Assign the character and return code Dfile char Curr chars 1 1 aw Code 0 Nextchar Glb_dfile buffptr Dfile num 1 _if Nextepar gt len Glb dfile buffer Dfile num then call Read line Dfile num Glb dfile buffer Dfile num Nextchar 1 end if loop Repeat False Trimmed_line trim Glb dfile bufferS Dfile num if len Trimmed line O then Found a blank line write it to the output output outfile Error Glb dfile buffer Dfile num if Error lt gt 0 then call Abort Error occurred while writing to output file Error end if Repeat True else if Trimmed line 1 1 then Found a comment line write it to the output output outfile Error Glb_dfile buffer Dfile num 4 967 412 231 232 if Error lt gt 0 then call Abort Error occurred while writing to output file Error end if Repeat True else if Glb dfile buffer Dfile num Nextchar 1 then The buffer pointer is pointing to a space In this case all following characters are ignored Repeat True end if end if end if If any of the above conditions are true we must read in a new line and try again exit if not Repeat di call Read line Dfile num Glb dfile buffer Dfile num Nextchar 1 end loop i We are not at tne ena of the buffer so we may look at the next char Poi Gib_drile buffer Di ie sum
48. m mm aae if Number of bits 1 or Number of bits 16 then call FGen Error GetBitsMSB Number of bits lt 1 or Number of bits 16 end if if Value 32768 or Value 32767 then call FGen Error GetBitsMSB Value lt 32768 or Value gt 32767 end if for I Number of bits 1 to Q step 1 Buffer Buffer amp val pit value I next I subend sub GetBitsLSB Value Nurber of bits Buffer This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the Number of bits parameter Note If the Value parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS meme nei no global outputs are exported GLOBAL INPUTS Hi s s no global inputs are imported b s ome e dn bm ome v e een it 4 967 412 2135 136 SUBROUTINE PARAMETERS Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the RR integer parameter Range 1 16 is appended e o o if Number of bits 1 or
49. not found on command line 0 end if exit if PCFcom line Column 1 lt gt end loop We are now pointing to the command character Glb PCFGEN comm PCFcom line Column l Now find the first parameter Only spaces may occur between the command character and the first parameter field loop Column Column 1 exit if Column Line len exit if PCFcom line Column 1 lt gt end loop if Column Line len then First parameter not found Glb PCFGEN paraml else if PCFcom_line Column 1 lt gt then A non blank character has been found between fields call Abort expected on command line in Format File 0 else get the first parameter Temp col Column 1 loop Loop until end of line or next double quote Column Column 1 if Column gt Line len then call Abort Incomplete first parameter on PCFGEN command line 0 end if exit if PCFcom line Column 1 WWW end loop Save the parameter Glb PCFGEN paraml PCFcom line Temp col Column Temp col end if end if Now find the second parameter only spaces are allowed between fields loop Column Column 1 exit if Column gt Line len exit if PCFcom line Column 1 lt gt end lop if Column gt Line len then Second parameter not found Glb PCFGEN param2 else if PCFcom line Column 1 lt gt nen then A non blank character has been found between fields call Abort expected on command
50. then A IND O set up for all tap points COMB 0 CIND 0 add in all tap points loop COMB COMB exor bti REG PAT CIND 1 CIND CIND 1 exit if CIND gt 3 exit if PAT CIND 0 end loop shift register OUT bti REGS 1 1 REGS REG 2 amp itb COMB add the bit complement if desired A IND shift A IND 1 OUT exor COMPLEMENT pack bits in word BITC BITC 1 mod 16 move to next word when full if BITC 0 then IND IND 1 exit if IND gt int LENGTH end loop end if end if end if Isubend PRBS se e e de e e de e e k k e k k e he de k k k k k R R e e he e e R Fe k k k k SK k T He TOKO KOR k cHe He k de He He He je ecce e bee he je LA LI ee e he LA e e KEKE K K K sub U_noise VPEAK SEED LENGTH X file pathname telecom gen u noise Rev 3 0 This routine will generate Length values in the array X The values are uniformly distributed pseudo random numbers over the interval 1 VPEAK VPEAK the routine also requires a seed value for the random sequence Copyright Hewlett Packard 1987 All rights reserved randomize SEED E if LENGTH 1 or LENGTH gt 32767 then call DSP type error U noise Length parameter out of range else for IND 0 to LENGTH 1 X IND VPEAK 2 rnd 1 next IND end if subend U noise OR k k k He Fe He He Fe Fe He e F He Fe He IIR dci accede III III III III OI III III III IAAI IIIS I IIIS eee K sub A_to_
51. u i EP AS AN ES EY AD This routine reads an ASCII text file of integer data one integer per lirie into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped e s sm om em s s M GLOBAL OUTPUTS MI oa no global outputs are exported GLOBAL INPUTS mir no global inputs are imported SUBROUTINE PARAMETERS FileName A string the containing file pathname of the file to be read into the Array parameter Length The number of integers to be read into the Array parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 de 0 PPP NO_ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 4 967 412 35 4 36 assign File Error to FileName if Error lt gt NO ERROR then call FGen_Error ReadArray FILE ERROR amp FileName amp Serrm Error end if for Index 0 to Length 1 enter File Error Array Index if Error lt gt NO ERROR then
52. used with a circuit board tester to create test vectors for U S PATENT DOCUMENTS telecommunications circuits which require serial data input The serial frame generator is user adaptable so LISTE 3 1984 Gilets TT 371 27 that serial frame data can be produced for essentially 4 507 576 3 1985 McCracken et al lt 371 27 any kind of serial frame protocol 4 517 661 5 1985 Graf et al wee 371 27 4 555 663 11 1985 Shimizu 371 27 3 Claims 10 Drawing Sheets VCL COMPATIBLE PCF SOURCE CODE 175 4 967 412 Sheet 1 of 10 Oct 30 1990 US Patent 02 ng ISIL YANN 39IA3Q L Sid US Patent Oct 30 1990 Sheet 20f10 4 967 412 ANALOG SIGNAL 50 11111111 10101010 DIGITAL SERIAL Ta FRAME T4 10101019 56 FRAMING 8 BIT 8 BT 8 BIT BIT CHANNEL CHANNEL CHANNEL 93 10 MEN 540 end pef repeat 185 times execute Null_bit end repeat FIG 2 VCL COMPATIBLE PCF SOURCE CODE 59 Sheet 30f10 4 967 412 Oct 30 1990 US Patent Old 3009 394N0S dd 38LLIVdA09 TOA INI INdINO 40d GLb YOLVYSNS9 40d LVJ 3unidv9 Ni311Vd oel Sheet 40f10 4 967 412 Oct 30 1990 US Patent V 9ld GZ Qn N tar 07 313 1V04 01 INA VIVO 3AVHJ l DEL Sheet 5 of 10 Oct 30 1990 US Patent T Vi Old HOME N39 sug INR TN 8S1 sug 139
53. 11 i assign Dfilell Error to Glb_PCFGEN_param2 read shared goto Exit D12 assign 8Dfilel2 Error to Glb PCFGEN param2 read shared goto Exit D13 assign GDfilel3 Error to Glb PCFGEN param2 read shared joto Exit D14 assign Dfilei4 Error to Glb PCFGEN param2 read shared goto Exit I D15 assign Dfilel5 Error to Glb PCFGEN param2 read shared goto Exit D16 assign Dfilel6 Error to Glb PCFGEN param2 read shared ws goto Exit Exit if Error File_not_found then call Abort Data replacement file amp val Imp amp does not exist Error end if if Error Wrong_file type then call Abort Data replacement file amp val Jmp amp is of wrong type Error 215 end if if Error then call Abort Error end if subend 4 967 412 216 assigning data replacement file amp val Jmp amp Error li Il Il Il ll ll Il li Il Il II li Il Il Il Il Il Il Il tl Il Il Il Il il Il ll ll It li Il Il ii li I l Il M li ll Il lI li il Il H Il Il Il Il Il li ll Il Il tt I Il tl Ii Il Il il Il I a Was Wd wa ee Wao aom acm a ey SE EE EA pue di Siri Ram Ren ET n mmm dii a a me Dos co Sum pi iii er xm om que ee Sev Tn n a ee eee dre V subroutine Code_ge OPERATION The code g to generat is encount PCF_repl_f and write code gener is placed defined as 0 1 giles still contain data This condition is
54. 11111111111111111 I 1 Retrieve INFORMATION field data from a text file t print FileName hdlc info print Retrieving INFORMATION field data from FileName call ReadInfo FileName LEN INFO print call Generate hdlc hdlc file LEN ADDR CTRL INFO print print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program 11 5 859229292 ee ae a 2 ZEZZZZEZZZZZZZZTZZZEZZZZZEZEZAnI fruit EEE PROGRAM SUBROUTINES nnd peu ted S iq ew wee 9224 223429599224 9922922942994 429962785299 24 4 59 92 22822G4 9242972 amp 09224 9999 0297 42425 4 967 412 61 62 sub Generate_hdlc FileName Length Address Control Info MEMMIUS a cme tae Nae Ome Gam Oo Cae Cae Gum Gam Gum Sam Baw Saw ome ene wae Gam Gos me oom Ome Gam Ome E en en Bae Bae fan pe gam Ban een Gum Gas e 0 Gay Om Cun ss se This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop The HDLC frame structure consists of three user defined data fields The first two fields ADDRESS and CONTROL are simply 8 or 16 bit boolean data fields with a bit order of LSB to MSB The INFORMATION field consists of any number of 8 bit boolean data MSB to LSB The ADDRESS and CONTROL arrays have each element contain a data value for each frame the INFORMATION array
55. 11111111111111111111111111111111111111111111111111111111111111111111111111 i M TEE CENI MERGE USER SUBROUTINES HERE phy 1111 Pee ae ae 11111111111111111111111111111111111111 11111111111111111111111111111111111111111 TELECOM GEN FRAME_SBUS_TE Rev 3 0 Basic User Network Interface S reference Frame Generator TE gt NT Copyright Hewlett Packard 1987 All Rights Reserved k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k kak k k k k k k k Kk k k k k K ce dece kok KOK kc ke k k k k k k k k k k k kk nici a ee S S To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 This places the edit cursor at the last line merge file id Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted
56. ATOR print print loop E input Enter number of frames to be generated LEN exit if LEN gt 1 and LEN lt MAX LEN print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop K K K k k k kkk k KR k errr ST k k R k k k k k k k kk kk k kok k k k kk kk k k k k kk kk k kk kok kk kkk kok kkk k kkk kk k k kk k k f Retrieve Generate field data for frame s E DIG Fe E e Fe FE He FE oko eek IG ICICI OCI ICICI Ae Ae e e e ICICI II IOI IR RIOR IIIT IR IRA KKK EEE 11111111111111111111111111111 EXAMPLE 011111 p n rri f n 1 Retrieve Bl CHANNEL field data from a text file print FileName sbus b1 print Retrieving Bl CHANNEL field data from SsFileName call ReadArray FileName LEN 2 Bl1 print ELTE E rt rp treet LEE rrt EXAMPLE 111111111 11 1111 1 1111111111 1 1 13 4111411111l2424 554 S i Ekes e a ji Roda 4d o cab e 465 e e f tom s mom s Som Ho HO s s 1 Retrieve B2 CHANNEL field data from a text file print FileName sbus b2 print Retrieving B2 CHANNEL field data from FileName call ReadArray FileName LEN 2 B2 print 1 111 1111 1111111111111111111 EXAMPLE 11111111111111111111111111111111 UE een eee KAR Sie Se k a k food TL LC o4 Wes seine ace proce e si sue ce ev 8 gere s dari EE Retrieve D CHANNEL field data from a text file print FileName sbus7 d print Retrieving D CHANNEL field data from FileName call R
57. BitsSBUS B2 Frame 2 1 8 LowZero NumZeros Buff1 Buff2 output FilePtrl Buff1 output FilePtr2 Buff2 Buffl Buff2 next Frame 1 DC balancing bit DC Balance NumZeros 1 mod 2 call Code SBUS Bit DC balance LowZero NumZeros Buffl Buff2 i D chanriei ELE J NumZeros 0 1 Start counting zeros for balance bits call GetBitsSBUS bit D Frame 0 1 LowZero NumZeros Buffl Buff2 t DC balancing bit 1 DC Balance NumZeros 1 mod 2 call Code SBUS Bit DC balance LowZero NumZeros Buff1 Buff2 1 The last frame of data ends with two characters 1 if Frame Length 1 then output FilePtrl Buffl output FilePtr2 Buff2 4 else output FilePtrl Buffl output 8FilePtr2 Buff2 end if close the output files 4 967 412 151 152 assign FilePtrl Error to assign FilePtr2 Error to subend en sm e bm e bm m om om em bu oum pa ace doe to tem dn 0 em s s ime o om ee eo This routine retrieves the boolean representation of an integer parameter and appends it to the string parameters according to the CCITT I 430 standard for pseudo ternary coding The two string parameters represent the values of the two signals combined at the transformer to for the pseudo ternary signal The Number_of bits parameters represents the number bits within the integer value to convert to its pseudo te
58. CF Output File 175 DESCRIPTION OF THE PREFERRED EMBODIMENT FIG 1 shows a schematic diagram of a circuit board testing machine such as would be used with the present invention Computer 5 Test Station 10 and Test Fixture 15 comprise the circuit board testing machine such as the HP 3065 circuit board tester The object of testing is the Device Under test DUT 20 DUT 20 is a circuit board and in particular a telecommunications circuit board Computer 5 controls the interaction of Test Sta tion 10 and test Fixture 15 in the testing of the DUT 20 FIG 2 shows a step wise flow diagram of the present invention Box 50 shows an analog signal which has been sampled at regular intervals Box 53 shows digital data conversions of such samples Box 56 shows a serial frame protocol The digitized samples from box 53 would be inserted into the serial frame format of box 56 The serial frame s of box 56 are then converted into VCL compatible PCF source code as shown in box 59 The code in box 59 would be directly executable by an HP 3065 circuit board tester Note in box 59 that the serial frame data which would be used as stimulus input to a telecommunications circuit board under test is included directly within the PCF code It should be 4 967 412 5 noted that FIG 2 is in fact schematic the present inven tion does not actually sample and digitize an analog signal Rather the digital information which is repre sentative of digitized
59. CL allows a programmer to operate the HP 3065 with source code like programming instructions VCL is fully explained in chaper 23 of the HP 3065 X L user s manual Vol I System Reference The PCF Generator includes a Parser 300 and a PCF Source Code Generator 350 which generates VCL compatible source code User written Format File 140 is the input file to the Parser 300 Frame Data File 130 is the input file to the PCF Source Code Generator 350 Parser 300 processes the syntax information in the Format Dile 140 and issues commands to PCF Source Code Generator 350 PCF Source Code Generator 350 processes Frame Data File 130 together with the output of Parser 300 to produce the PCF Output File 175 containing VCL compatible PCF source code A complete explanation of the opera tion of PCF Source Code Generator 350 together with prescriptions of Format File 140 syntax is contained in Chapter 1 of HP 3065 X L user s Manual Vol III Rev C pages 9 62 through 9 70 An implementation of PCF Source Code Generator 350 in the BT BASIC programming language is listed in Appendix D FIG 6 shows an example of Format File 140 Format File 140 is written by the user Instructions for writing the Format File are listed in Chapter 9 of HP 3065 X L user s Manual Vol III Rev C As shown in FIG 6 the Format File has two sections a header section and a program section The header section lines are indicated by leading characters The progra
60. CL statement is found or if a PCF statement is found If the loop exits before finding a PCFGEN command an error will be reported s a loop The line input variable must be set to null before doing the enter statement so that blank lines will be handled as desired If the the line is not nulled a copy of the previous line will be returned by the enter statement t im oe a Ffile line enter Ffile Error Ffile line exit if Error lt gt 0 Glb_line_type i Repl_ptr 0 Prepare to find the first replacement line if len trim Ffile line lt gt 0 then The line is not blank so send it to the line scanner call Scan ffile line Repl ptr Ffile line Repl flag end if u i 4 967 412 189 190 1 Exit on the first occurrence of a non header line all header lines namely comments and PCFGEN commands must come before any real VCL or PCF lines exit if Glb line type VCL statement exit if Glb line types PCF norm exit if Glb line type PCF repl a PCFGEN command has been found call the command processor if Glb line type PCFGEN command then call Comm proc Line count Line count 1 end loop process errors if Error then if Error End of file then an error occurred while reading the file call Abort Error occurred while reading Format File Error else We are at end of file No real VCL or PCF lines in file call Abort Unexpected end of Format
61. D LIM SCALE COMPLEMENT LENGTH X file pathname telecom gen a to d Rev 3 0 This routine will take the real values passed in by the array X and convert l them to a quantized value that is between 2 SCALE 1 and 2 SCALE 1 exclusive 1 2 SCALE is included for twos complement The elements of the array will be expected to be in the range LIM to LIM any values outside this range are treated as one of the boundary values Two s complement numbers are biased so that zero input occurs in the middle 1 of the zero output quanta a LENGTH is the number of elements in the array which are to b converted 1 COMPLEMENT indicates whether one s or two s complement notation is used 1 Copyright Hewlett Packard 1987 All rights reserved parameter check 4 967 412 175 176 if LENGTH lt 1 or LENGTH gt 32767 then call DSP_type_error D_to_A Length parameter out of range else if SCALE 1 or SCALE gt 16 then call DSP_type_error D_to_A Scale parameter exceeds associated bandwidth else if LIM lt 0 then call DSP_type_error D_to_A Limit parameter out of range else if COMPLEMENT lt 1 or COMPLEMENT gt 2 then call DSP_type_error D_to_A Complement parameter out of range else compute upper limit of output QMAX 2 SCALE 1 if COMPLEMENT 2 then compute the interval size DELT 2 LIM 2 SCALE 1 for IND 0 to LENGTH 1 if input beyond limit set to max code if
62. DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format 1 t 1 1 i The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine 1 LI 1 I 1 J 1 The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used ina particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format USER MODIFIABLE PARAMETERS Scratch variable im A 256 Transmit data string print using e print RS232 FRAME GENERATOR print print Ay This is an example of a text string to be framed by this Frame Generator 2 c EJ call Generate rs232 rs232 file A print i print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program LIES EEEE EE EA 6 0 8 0 ice 0 0 0 a e 0 eee Sa s s Se 0 S 2 0 a dd 0 900000 1111 PROGRAM SUBROUTINES Litt ee ee e
63. E PARAMETERS FileName A string the containing file pathname of the file to be read into the Array parameter Length The number of integers to be read into the Array parameter 1 32766 gt Array 2 2 9 7 2 7 Array id ace returned i7 The integer values read from the file LLS gacamevaey Yho accaye be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array array indices are assumed to start at zero 0 stop at Length 1 or greater than Length 1 The and NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 P WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 s assign File Error to FileName if Error lt gt NO_ERROR then call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if for Index 0 to Length 1 enter File Error Array Index if Error NO ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileNameS amp else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if end if next Index subend sub OpenFile FileName FilePtr This routine opens an ASCII text file for exists the user is prompted for overwrite output If the file already If the file does not exist the file is created If any other file error occurs the error is reported to the CRT and program execution stops G
64. ED FRAMES lt gt FRAMES IN INFO FILE end if end if Index Index 1 if Index 32766 then call FGen Error ReadInfo ATTEMPT TO READ MORE THAN 32766 ELEMENTS end if end loop subend 4 967 412 73 74 MS 0 o i i This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the lt Number of bits gt parameter Note If the lt Value gt parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS WN ______ e _ no global outputs are exported WH ______ no global inputs are imported Value Integer parameter Range 32768 32767 Number_of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended mmm EE e Se A CS aD if Number_of bits lt 1 or Number_of bits gt 16 then call FGen Error GetBitsMSB Number of bits lt 1 or Number_of_bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen_Error GetBitsMSB Value lt 32768 or Value gt 32767 end
65. File no VCL statements found Error end if end if If we get here then everything is OK there were no errors and valid PCFGEN command s were found in the header Line count is pointing to the first line of the program block Check one last thing if no master replace command was found then issue a warning Ffile line contains the first line of the Format File program block if Glb master repl char then Issue the warning call Warning No master replacement command found default is first file Assign the first Data File to be the master Glb master repl char Glb valid repl chars 1 1 end if Save the line number of the start of the program block Glb start line Line count 4 if Glb line type PCF repl then Repl flag False We have found a replacement line Reset the first replacement flag This loop processes the program block of the format file The loop will exit if an error occurs including end of file and will abort if 1 a PCFGEN command is found if len trim Ffile line lt gt O then Line is not blank so we may pass it to the scanner call Scan ffile line Repl ptr Ffile line Repl flag Process the results from the Scanner if Glb line type PCFGEN command then This line is illegal in the program block so abort call Abort PCFGEN command found in program block of Format File 0 end if if Glb line type PCF repl then We have found a replacement line
66. Frequency 8000 call Tone VRMS Frequency Phase SampFrequency LEN TEMPCH1 call MU law LEN TEMPCH1 t transfer to appropriate row of channel array t for I 0 to LEN 1 CH 0 I TEMPCH1 I next I Be sure to merge TONE and MU LAW at end of test AE ee St ee ae Oe ee RL PIO EXAMPLE 111111111 11 11111 111111111 11111111 Retrieve channels 2 through 24 data from fils dim TempArray 1000 Dimensioned to MAX LEN elements print a for Channel 2 to 24 FileName ch24 data amp val Channel print Retrieving channel val Channel field data from FileName call ReadArray FileName LEN TempArray for I 0 to LEN 1 CH Channel 1 I TempArray I next I next Channel print call Generate 24ch ch24 file LEN CH print 4 967 412 27 28 print o itvME GENDRALOR SUCCESSrULLY COMPLETED dias end main program 1111311111222 209222222222222 221220222 02212222 10222222 122222222221222212 02222 022021210 pnnroc 1111 1111 PROGRAM SUBROUTINES x 1111 111 pide 3111 Pree 9 0 0 0 0 os 0 9 eee see ee 0 0 0 4 0 0 e 4 OS a 0 5 4 S dd S 0 9 0 E SS 0 A Se 0 4 Sd 0 0 9 00 0 dd 0 od sub Generate 24ch FileName Length CH24 This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program
67. GEN chars Glb valid PCFGEN comm 100 lI Max_repl_lines Max_repl_chars 16 om ae True 1 False 0 Error codes End_of_file 101007 File not found 100009 Wrong file type 101015 File not assigned 136 File exists 275 MR 184 The list of valid PCF characters The PCFGEN command indicator The list of defined PCFGEN commands single character commands o ene sn this should match the array size of Glb repl lines a nd Glb repl cols this should match the array size of Glb valid repl chars Glb repl chars and Glb PCF cols print chr 27 H chr 27 J print BSAASEAIHHHHEE E HE E E E ES HHH E E EE E ER print print i HP3065 Pattern Capture Format print Source Generator print print i print Copyright 1987 w print Hewlett Packard Company print print 444 4 4 4 4 444 4 tnt tt 7 input Enter name of Format File G h ffile names assign Ffile Error to Glb_ffile_name ac Error lt gt 0 tien 34 iin dig Lan TT ii ig 4 dan 4 hain mr call Abort Error accessing format file Error end if loop input Enter name of Output File Glb_outfile name assign Outfile Error to Glb_outfile_name write new exit if not Error if Error lt gt File exists then call Abort Problem assigning Output File Error else 4 967 412 185 186 print The file Glb outfile
68. GLOBAL OUTPUTS HI _________ no global outputs are exported GLOBAL INPUTS MI _____ no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output text file FilePtr The file pointer If the file is opened this pointer may be used by output statements to write data to the file NO_ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error NO ERROR then if Error FILE EXISTS then print print The file FileName already exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error NO ERROR then call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error s end if Bo d joni t vant co weit er File coil Poon Error pensiile USL STODMEC VYRXINAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if end if subend sub PrintBits Value Number of bits e am sm scm oc acm ooe om pm pm em oce om eom am 4 967 412 125 126 This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed fro
69. LLY COMPLETED end main program rn ML I d ER whet PROGRAM SUBROUTINES FELL 22 8 ee e a a SS a 4 1 i i sub Generate 30ch FileName Length CH30 Control Signal This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop This subroutine reproduces the CEPT 30 channel frame structure G 732 A 30 channel frame consists of an 8 bit control field 15 fields of codec field data 8 bits an 8 bit signal field and 15 more fields of codec field data 8 bits All fields consists of 8 bits MSB to LSBr For example if Length 1 and the CH30 array is filled with the following values ome a bee i Channel 0 29 for 30 channels of data s s sm sm sm me em tee tee ame tee Ome Cae me Gem me we Ome tae ae me Oem me ee i be me tae 45 CH30 0 0 1 CH30 1 0 2 CH30 2 0 3 CH30 3 0 4 CH30 4 O 5 CH30 5 0 6 CH30 6 0 7 CH30 7 0 8 CH30 8 0 9 CH30 9 0 10 CH30 10 0 11 CH30 11 0 12 CH30 12 0 13 CH30 13 0 14 CH30 14 0 15 CH30 15 0 16 CH30 16 0 17 CH30 17 0 18 CH30 18 0 19 CH30 19 0
70. LOBAL OUTPUTS UIC Gesa no global outputs are exported GLOBAL INPUTS WI unes eme no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output t xt file FilePtr The file pointer If the file is opened this pointer may be used by output statements to write data to the file 4 967 412 161 162 NO ERR R 2 EOF 101007 FILE_NOT_FOUND 100009 ow Hn Wo u WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error NO ERROR then if Error FILE EXISTS then print print The file FileName already exists a print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then y assign FilePtr Error to FileName write 3 if Error lt gt NO_ERROR then i call FGen_Error OpenFile FILE ERROR amp FileName amp amp errm Error end if perse don t want to write over file iios call FGen Error OpenFile USER STOPPED PROGRAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileNameS amp amp errm Error end if end if subend sub PrintBits Value Number of bits em sm e s ie e ao TO CLIL LE a ma grad em ee wana do ms di S a S mmm eoim E mde riesen Decem mosto ce This routine prints the boolean represen
71. N FRAME_24CH Rev 3 0 FRAME GENERATOR for Bell system 24 channel frame structure Copyright Hewlett Packard 1987 All Rights Reserved ARKRKKKKKKKKKKRXKKKKKKKKKKKkKKKkEKKkKKKKkKkKkKKkkkKkKkkkkkkkkkkkkKXkkkkkKkkkKkkkkkkk kk ML ce re ee ee GG er t om em tm sm s To add other DSP subroutines simply type in the following BTBasic commands at the command line i edit 9999 1 This places the edit cursor at the last line merge file id Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each s
72. Number of bits 1 to 0 step 1 call Code_SBUS_Bit bit Value I LowZero NumZeros Buffl Buff2 next I subend ea pm om e g m m O nn lt e sm om e pme am ao a This routine converts a boolean value to its CCITT I 430 psuedo ternary coding representation and appends this code to the Buffl and Buff2 parameters The LowZero parameter represents the current zero value with TRUE lower than zero and FALSE higher than zero voltage potential The NumZeros parameter is used to keep track of the number of zero values in the SBUS frame This is used to set the balancing bits to the correct code GLOBAL OUTPUTS un 22 no global outputs are exported GLOBAL INPUTS eM 0902775 nO global days fana io SUBROUTINE PARAMETERS BitValue Boolean parameter Range 0 1 LowZero Boolean parameters representing the coding of the next zero parameter TRUE lower than zero FALSE higher than zero NumZeros Integer parameter to count the number of zeros boolean value 0 in the Value parameter Buffl First string parameter to which the boolean representation is appended Buff2 Second string parameter to which the boolean representation is appended Zero 00000000 One 11111111 Off XXXXXXXX if BitValue 0 or BitValue gt 1 then call FGen Error Code SBUS Bit BitValu
73. OR then call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if 78 for Index 0 to Length 1 enter File Error Array Index if Error NO ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileName amp else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if end if next Index subend This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs the error is reported to the CRT and program execution stops GLOBAL OUTPUTS ur Courrier no global outputs are exported GLOBAL INPUTS ww no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output text file FiiePtr fhe 6 file pointer If the file is opened this pointer may be used by output statements to write data to the file em sm i e i i lt NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error lt gt NO_ERROR then if Error FILE EXISTS then print print The file FileName already exists print Do you want to write over this file yes or n
74. S ZE E ZZZ AZ ZZZ ZE ZZZ ZZZ E s A i sub Generate rs232 FileName String This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop This subroutine converts an ASCII string into it boolean representation LSB to MSB and then is framed with start and stop bits The values of the start stop and ASCII character bits are inverted so that correct RS232 drive levels are output zero 0 gt 3V and one 1 lt 3V E A er 4 967 412 101 102 GLOBAL OUTPUTS I um casei ee nae no global outputs are exported GLOBAL INPUTS WI 22 no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing file the pathname of the output file String A string containing the ASCII string to be converted to the RS232 frame format em di me tma oum pum ry dim Buffer 256 call OpenFile FileName FilePtr for I 1 to len String Buffer 1 Start bit co22 Tet BitsLSB bincmp num String I 1 8 Buffers Buffers Buffer amp 00 Stop bits i The last frame of data ends with two characters 1 if I len String then output FilePtr Buffer else output FilePtr Buffer end if next I 1 close the output file 1 assign FilePtr Error to subend s
75. TS fi no global inputs are importi d SUBROUTINE PARAMETERS d FileName string the containing file pathname of the riie to be read into the Array parameter Length o The number of integers to be read into mie Array parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign File Error to FileName if Error lt gt NO ERROR then call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if for Index 0 to Length 1 enter File Error Array Index if Error NO ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileNameS amp else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if end if next Index 3 4 967 412 19 20 subend sub OpenFile FileName FilePtr This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs
76. TS I f Repl line num The line number of the current Format File line being scanned PCF line The line to be scanned by PCF scan Repl flag See subroutine Scan ffile line OUTPUTS none GLOBAL VARIABLES USED Glb repl chars The array of replacement characters Glb PCF cols The array indicating the PCF column associated with each replacement character 4 an dee a a i Glb valid PCF_chars The string of valid PCF characters These characters CAN NOT be used as replacement characters e em ec sm em e ome pm o x I omm om pm ba OM Om ome tum l e s s im ie tt 4 967 412 203 204 Glb_valid_repl_chars The set of current valid replacement characters 1 Glb repl cols the array containing the actual column number of each replacement character on each replace ment line Glb line type See subroutine Scan ffile line sub PCF scan Repl line num PCF line Repl flag global Glb repl chars Glb PCF cols global Glb valid PCF chars Glb line type Glb valid repl chars global Glb repl cols True False PCF_col 1 The current PCF column Repl char num 1 The current replacement character index The flag to indicate whether we are inside PCF flag False or outside of a pcf block Line len len PCF line Comment False Repl len len Glb valid repl chars The comment found flag
77. The number of valid repl chars Find the non PCF replacement characters Column 1 loop exit if Column Line len exit if Comment If we haven t reached a comment character then go ahead Current char PCF_line Column 1 1 Check for a valid PCF character Valid PCF_CHAR pos Glb valid PCF chars Current_char lt gt 0 Check for a valid replacerent character big repi ubag pus lo vak d sapi zhf ss Sera Shar gd s 0 E i EE i JAY if Current char then means we have either entered or exited a PCF area Toggle state of PCF flag PCF flag not PCF flag else Otherwise look at the character if Valid PCF char and PCF flag then m The current character is a valid PCF character inside of a valid PCF field PCF col PCF col 1 end if if Valid repl char and PCF flag then The current character is a replacement character if Repl flag then The replacement character must be stored in the arrays We first check to see if the particular replacement character has been used before 4 967 4 205 dose 206 for Count 1 to len Glb_ valid repl chars if Glb repl chars Count Current char then call Abort Second use of the a replacement character 0 end if next Count if Repl_char_num gt len Glb_valid_repl_chars then call Abort Too many replacement characters on PCF line 0 end if If we get here then we know that the character has not been used H
78. UTPUTS Bro no global outputs are exported Wh eee no giobal inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended if Number of bits 1 or Number of bits 16 then call FGen Error GetBitsMSB Number _ of bits lt 1 or Number of bits 16 end if n 412 91 4 967 92 if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsMSB Value lt 32768 or Value gt 32767 end if E for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend am im tum pua pan e OD e te eee This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the lt Number of bits gt parameter Note If the lt Value gt parameter is greater than the 2 s complement range for the lt Number of bits gt parameter requested the extra bits withing the lt Value gt parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS MI _ no global outputs are expo
79. UTPUTS i cem no global outputs are exported LL ME LL laa no global inputs are imported ome pm eue pme pue pam Value Integer parameter Range 32768 32767 4 967 412 3 55 56 Number of bits Size of the boolean representation of the integer parameter Range 1 16 e ene if Number of bits lt 1 or Nuitber_of_bits gt 16 then call FGen Error PrintBits Number of bits l or Number_of_bits gt 16 end if Hd if Value 32768 or Value 32767 then call FGen Error PrintBits Value lt 32768 or Value gt 32767 end if Buffer for I Number of bits 1 to 0 step 1 i Buffer Buffer amp val bit Value I next I i print Value Buffer subend sub FGen_Error Err_msg t ee ee ce cae ee me ne re me ce et meB m _ m_ __ ____ _ _ _ __ _ _ _ 2 This routine reports an error message from the Err_msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported message is sent to the printer device 1 I 1 1 i GLOBAL OUTPUTS Uo l22 no global outputs are exported GLOBAL INPUTS Wi no global inputs are imported SUBROUTINE PARAMETERS
80. X IND gt LIM then X IND QMAX 1 else if X IND lt LIM DELT 2 then X IND QMAX else code with 5 delta shift to center zero X IND int X IND DELT 0 5 end if end if next IND y else ones complement mode compute the interval size DELT 2 LIM int 2 SCALE 0 5 for IND 0 to LENGTH 1 1 if input beyond limit set to max code if X IND lt LIM then X IND QMAX else if X IND gt LIM then X IND QMAX 1 else X IND int X IND DELT end if end if next IND end if m end if end if end if end if subend A to D 1 a aa Se A Se A A A D DEE HEE A A KEE W A SE KK AE AE R AEE A AE E A E E AE A BE A AE AEE A A E E AE E E sub Digital mW Law Length Samples 1 Digital mW file pathname telecom gen digital mw Revision 3 0 1 Description Generates the digital milliwatt sample sequence defined by the CCITT Red Book Fascicle III 3 rec G 711 encoded in either mu or A law 1 Copyright Hewlett Packard 1987 All rights reserved dim Digital mW table 0 7 if not Length lt 1 or Length gt 32767 then if upc Law 1 1 M then u law table s Digital mW table O bti 00011110 1 Digital mW table 1 bti 00001011 11 Digital mW table 2 bti 00001011 11 s Digital mW table 3 bti 00011110 30 Digital mW table 4 bti 10011110 158 Digital mW table 5 bti 10001011 139 Digital mW table 6 bti 100010J 139 Di
81. _FREQ gt SAMP_FREQ then call DSP type error Tone Frequency parameter out of range else if LENGTH lt 1 or LENGTH gt 32767 then call DSP type error Tone Length parameter out of range else if PHASE O or PHASE gt 360 then call DSP_type error Tone Phase parameter out of range else compute constant parts of the equation AMP sqr 2 VRMS DELT ANGLE 2 pi SIG FREQ SAMP FREQ PHARAD 2 pi PHASE 360 fill the array for IND 0 to LENGTH 1 X IND next IND end if end if end if subend tone AMP cos DELT ANGLE IND PHARAD Bde Te de je eee de de de k k de KK k k k k kde e k k k RIKKI de ke e de k k eee de e k kk k kk kkk deje e deje KARI n akk kok kokk kkk k sub A LAW LENGTH X 1 file pathname telecom gen a law Rev 3 0 This routine will take the real values passed in by the array X and convert them to a non uniform encoding via the A law le The elements of the array are expected to be in the range 4096 4096 Any element outside this range will be treated as the closest boundary value LENGTH is the number of elements in the array which are to be converted 1 aw Values produced will be an 8 bit code The boundary value will contain the code of the higher region Copyright Hewlett Packard 1987 All rights reserved 4 parameter check if LENGTH lt 1 or LENGTH gt 32767 then call DSP type error A law Length pa
82. a File 130 and associates that name with the replacement character the in FIG 6 4 967 412 9 10 TABLE OF CONTENTS APPENDIX A FRAME_1CH FRAME IOM sub EI s FRAME RS232 _ Sub Generate ch RET CUBE FRAME 30CH sub Generate 30ch sub Generate frame FRAME HDLC 10 FRAME SBUS TE sub Generate hdlc sub Generate Sbus TE TELECOM GEN FRAME 1CH Rev 3 0 FRAME GENERATOR for simple one time slot channel pcm generator Copyright Hewlett Packard 1987 All Rights Reserved HI HIRE RK KK II KK IIIA AIAR E RIA ERE IIIS IIR REITER IK IARI EERIE HARRIE ERASERS To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 This places the edit cursor at the last line merge file id Merge the file id source at the current edit line em sm em em t oma E E I e Leni s e a s cnc eru lt Pr my _ __ __ __m___y ______ _ _ _ _ _ le m e This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame
83. aining file pathname of the file to be read into the Array parameter Length The number of integers to be read into the Array parameter Range 1 32766 Array 7 7 7 Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 bm s am ee ee ee dt ee dd e ia NO_ERROR 0 EOF 101007 FILE_NOT_FOUND 100009 WRONG FILE TYPE 101015 FILE_NOT_ASSIGNED 136 FILE_EXISTS 275 assign File Error to FileNames if Error lt gt NO EFROR then nM Elke fiale QUAM seo nen siae i duca ian Mead terri Libor eG ele ray iiL Lice Ge GN AGr irm for Index 0 to Length 1 enter File Error Array Index _ if Error lt gt NO ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileName amp 4 967 412 123 124 else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if end if next Index subend pub OpenFile FileName FilePtr This routine opens an ASCII text file for Bitgde If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs the error is reported to the CRT and program execution stops
84. all Abort Error occurred while writing to output file Error end if Repeat True else if Trimmed line 1 1 then Found a comment line write it to the output output GOutfile Error Glb dfile buffer Dfile num if Error lt gt 0 then call Abort Error occurred while writing to output file Error end if Repeat True else if len Glb_dfile_buffer Dfile_num lt POSN then 4 967 412 229 i 230 The buffer pointer is pointing to end of line Repeat True else Curr chars Glb dfile buffer Dfile num POSN 1 if Curr chars 1 1 then 1 The buffer pointer is pointing to a space In this case all following characters are ignored Repeat True else if Curr chars 1 1 then The buffer pointer is pointing to either an end of frame or end of data marker Repeat True end if end if end if end if end if If any of the above conditions are true we must read in a new line and try again exit if not Repeat call Read line Dfile num Glb dfile buffer Dfile num Glb dfile buffptr Dfile num 1 x 1 end loop Po When we get here we know that the buffer pointer is pointing to a data character We need to check for a valid PCF character and also check to t character on a line last character in io the dota ts see if the character is the las vi Eyni OF ue lant chara s if pos Glb_valid_PCF_chars Curr_chars 1 1 0 then The character
85. ame A string containing the file pathname of the outp t text file FilePtr The 8 file pointer If the file is opened this pointer may be used by output statements to write data to the file ame ome sam p eme tme pam t m pme eum pmm eam ame or ey NO_ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error lt gt _NO_ERROR then if Error FILE EXISTS then print print The file FileName already exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error lt gt NO_ERROR then call FGen Error OpenFile FILE ERROR amp FileName amp errm Error end if else 1 don t want to write over file call FGen Error OpenFile USER STOPPED PROGRAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileNameS amp amp errm Error end if end if subend BUE PrintBits Value Number of bits This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter GLOBAL O
86. arameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 E z d if Number of bits 1 or Number of bits 16 then call FGen Error PrintBits Number Of bits 1 or Number of bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen Error PrintBits Value lt 32768 or Value 32767 end if Buffer 4 967 412 97 98 for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I print Value Buffer subend sub FGen Error Err msg 2 em e om pmm pum pan pus This routine reports an error message from the Err_msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS UHO _____ _ __ no global outputs are exported GLOBAL INPUTS no global inputs are imported SUBROUTINE PARAMETERS Err msg String variable containing error message This message is sent to the printer device conc M dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node status Default output Error Opened Type if Type Device then assign amp Output
87. arameter is greater than the 2 s complement t GLOBAL OUTPUTS t Tf0STervealoce no global outputs are exported 4 967 412 49 50 GLOBAL INPUTS mu ____ _ no globali inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended e m om pa 6m o oa td if Number_of_bits lt 1 or Number_of bits gt 16 then call FGen Error GetBitsMSB Number _ of bits 1 or Number of bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsMSB Value 32768 or Value gt 32767 end if for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend sub GetBitsLSB Value Number of bits Buffer This routine retrieves the bdolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the Number of bits parameter Note 1 the Vaiue parameter is greater than the 2 s complement range for the Nurber of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the Buf
88. cm is 4 967 412 T Glb_start_line The Format File line number corres sponding to the first line of the program block see Code_gen Max repl lines The global constant defining the maximum number of replacement lines that may exist in a Format File Glb max repl The global variable defining the maximum number of replacement lines that were found in the Format File Glb master repl char The replacement character assigned to the Master replacement file Glb valid repl chars The list of current valid replace ment characters I 1 1 1 1 1 I 1 1 l End_of_file The global end of file error code I ND sub Parse ffile global Ffile i global Glb line type Glb PCFGEN comm Glb_PCFGEN_paraml global Glb PCFGEN param2 Glb repl lines Comm found global Glb start line Max repl lines Glb master repl char global End of file Glb valid repl chars True False Glb max repl dim Ffile line 80 Comm found False Command found flag Line count 1 s Repl_flag True will write the PCF column numbers of the replacements to the Glb_PCF_cols array The flag will be set to false after the first replacement so that subsequent replacements will check for a match with the Glb_PCF_cols e en e wanuy a SRL This loop will process the header of the format file The loop will exit if a file read error occurs including end of file or if a V
89. e III 3 Tables 1a G 711 amp 1b G 711 A law and 2a G 711 amp 2b G 711 Mu law Finally this informa tion must be converted one bit at a time to the corre sponding test pattern language which the given circuit board tester requires It has been prior art practice to generate such data manually that is a test programmer has had to calcu late the necessary serial frame test data and transform it into test pattern language information which the given circuit board tester can accept Thus for a given serial device the test programmer must generate the sample data generate the serial frames from the sample data and then generate the test data from the serial frames Obviously generating such large amounts of complex telecommunication serial frame test data is tedious and time consuming Generating such test data manually could very well consume weeks of an individual s time Moreover ensuring the accuracy of the test data is very difficult and to the extent that there are doubts about the accuracy of the test data the test results are suspect The result has been that prior art testing of complex telecommunications circuits has been limited by the difficulty of generating sufficient amounts of accurate serial frame test data SUMMARY OF THE INVENTION The present invention provides for quick and accu rate generation of serial frame test data for telecommu nications circuit boards Through software the present inv
90. e an 8 bit code Boundary values will be coded as the lower value Copyright Hewlett Packard 1987 All rights reserved parameter check if LENGTH lt 1 or LENGTH gt 32767 then call DSP type error Mu law Length parameter out of range else for each element in the array for IND 0 to LENGTH 1 limit check if X IND 8158 then MLAW 128 else if X IND 8158 then MLAW O else TEMP int abs X IND segment 0 check if TEMP 1 then INTVSZ 1 MLAW 0 segment 1 check else if TEMP lt 31 then INTVSZ 2 TEMP TEMP 1 MLAW int TEMP 2 1 else initialize to segment 2 INTVSZ 4 END 95 LEND 31 SEGSZ 128 SEG 2 locate proper segment loop exit if SEG 9 failsafe exit since 2 8 32 8192 exit if TEMP lt END LEND END END END SEGSZ 4 967 412 169 170 SEGSZ SEGSZ 2 INTVSZ INTVSZ 2 SEG SEG 1 end loop compute displacement into segment TEMP TEMP LEND compute code 3 bit segment 4 bit displacement MLAW 16 SEG 1 int TEMP INTVSZ end if end if E set msb according to sign if X IND gt O then MLAW 255 MLAW else MLAW 127 MLAW end ir end if X IND MLAW next IND end if subend Mu_law 1 dece de te He He SIH II II II FR HTK IA TOK IR IR RII IRR LILI AKI IK IIHR IR IIA RIKI IKEA RII RE HRI eek sub G_noise VRMS SEED LENGTH X file pathname telecom gen g_noise Rev 3 1 This rout
91. e lt 0 or BitValue 1 end if if LowZero 0 or LowZero 1 then call FGen Error Code SBUS Bit LowZero lt 0 or LowZero l end if if BitValue then Buffl Buffl amp Zero Buff2 Buff2 amp Zero else NumZeros NumZeros 1 4 967 412 155 156 if LowZero then 1 if last zero was a low zero then code this bit as high zero 1 Buffl Buffl amp Zero Buff2 Buff2 amp One LowZero 0 else t if last zero was not a low zero then code this bit as low zero Ji Buff1 Buffl amp One Buff2 Buff2 amp Zero LowZero 1 end if end if subend sub GetBitsMSB Value Number of bits Buffer M This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if bit ns ala requested in che tab Pe DG h Fara pea aie set it Note If the lt Value gt parameter is greater than the 2 s complement range for the lt Number_of bits gt parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS WH _____ no global outp
92. e used as a replacement character EPCFGENS Valid PCF characters amp Glb PCFGEN paraml EPCFGENS EPCFGENS amp can not be used as replacements call Abort EPCFGEN 0 ci end if if pos Glb valid_repl_chars Glb PCFGEN paraml lt gt 0 then This replacement character has already been used EPCFGENS Duplicate replacement character amp Glb_PCFGEN_paraml EPCFGEN EPCFGENS amp found in command line call Abort EPCFGEN 0 end if if Glb_master_repl_char lt gt then This is not the first M command call Abort Multiple master replacement commands found 0 end if if len Glb valid repl chars gt Max repl chars then The data files are all used up call Abort Too many replacement commands in header 0 end if Glb master repl char Glb PCFGEN parami Glb valid repl chars Glb valid repl chars amp Glb PCFGEN paraml Glb repl count Glb repl count 1 Assign the replacement character to a data file call Assign dfile goto Exit R Replace command if len Glb PCFGEN paraml lt gt 1 then The parameter for this command is not exactly one character long Report error call Abort Invalid first parameter for R command 0 end if if pos Glb valid PCF chars Glb PCFGEN paraml lt gt 0 then The parameter is a valid PCF character so it can not be used as a replacement character EPCFGENS Valid PCF characters amp Glb PCFGEN paraml EPCFGENS EPCFGENS
93. e2 Error goto Exit D3 enter Dfile3 Error goto Exit D4 enter Dfile4 Error goto Exit D5 enter Dfile5 Error goto Exit D6 enter GDfile6 Error goto Exit D7 enter Dfile7 Error goto Exit D8 enter Dfile8 Error goto Exit D9 enter Dfile9 Error goto Exit D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 Dfile line Dfile line Dfile line Dfile line Dfile line Dfile line Dfile line Dfile line Dfile line D10 enter Dfilel0 Error Dfile line goto Exit D11 enter Dfilell Error Dfile line goto Exit 4 967 412 235 236 D12 t enter Dfilei2 Error Dfile line goto Exit D13 _ enter Dfilel3 Error Dfile line Soto ain da D14 enter GDfilel4 Error Dfile line goto Exit D15 enter Dfilel5 Error Dfile_line goto Exit D16 enter Dfilel6 Error Dfile lines ow goto Exit Exit if Error End of file then call Abort Unexpected end of data file Error end if if Error lt gt 0 then call Abort Error reading one of the data files Error end if subend OPERATION 1 i This routine prints an error message closes all files and halts execution of the progran 1 TAE T INPUTS Err msg The error message to print Err num The system error message number OUTPUTS none GLOBAL VARIABLES USED none sub Abort Err msg Err num cali Close files roe US print ERROR print Err_msg if E
94. eadArray FileName LEN D print s Filel sbus filel File2 sbusifile2 call Generate Sbus TE Filel File2 LEN B1 B2 D 4 967 412 145 _ 146 print print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program 1111114224 2424123 SS SS 2 c s 2 os ose IlINIIIIlIIIIIIIII111111111111111111111 J 1111 111 11 1 1111111111J111111111J1111 4214222212 0 4 4 9 hd 0 5 8 0 o 4 0 a q 6 q q o dd q s s q aq S q q ao q s s q vd 0 s e o s e sos e es e ee t PROGRAM SUBROUTINES ud sub Generate Sbus TE Filel File2 Length Bl B2 D a f ome dme um pma pme pme pm I bm tme pme pma ee qe e acm ao ao ac sm dd This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop GLOBAL OUTPUTS my Mem no global outputs are exported GLOBAL INPUTS I MMS esss sesesaze no global inputs are imported SUBROUTINE PARAMETERS Filel String containing file pathname of the first half output file File2 String containing file pathname of the second Half output file Length The number of frames to be generated Range 1 MAX_LEN Bl Array id param
95. el A of data is generated from dsp subroutines tone and mu_law print input Enter the tone frequency Hz to be generated Frequency use rms value to produce full range VRMS 8159 sqr 2 for MU LAW Phase 0 SampFrequency 8000 call Tone VRMS Frequency Phase SampFrequency LEN CH_A call MU law LEN CH A 1 Be sure to merge TONE and MU LAW at end of test 1 1111111111111111111111111111 EXAMPLE 1 111 11111111111111111111111111111 1 Channel B of data is set to zero 0 1 print print Setting channel B to zero 0 for I 0 to LEN 1 CH_B I next I print FILLLLELE BILL LLHIBIILIBIHIH U EXAMPLE 1111111111111111111111 11111111 Retrieve CONTROL field data from a text file print FileName sld ctrl print Retrieving CONTROL field data from FileNane cail ReadArray rildiameL LEN CTRLi j print 1111111111111111111111111 11 1 EXAMPLE 0H9ItH rabbi E ELEE ELE LI EEG 4 6 4 i itis il s Retrieve SIGNAL field data from a text file print I FileName sld sigl ae print Retrieving SIGNAL field data from FileName call ReadArray FileName LEN SIGL print call Generate sld sld file LEN FIRST CH A CH B CTRL SIGL print print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program ger een ay pre eMe e eR EE TEE eR ERR CONO l Aa LLRI PROGRAM SUBROUTINES 1111 1111 we 0 e
96. en_Error PrintBits Value lt 32768 or Value gt 32767 end if Buffer w for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I print Value Buffer subend sub FGen_Error Err_msg This routine reports an error message from the Err_msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS WM emeret no global outputs are exported GLOBAL INPUTS MI _ no global inputs are imported SUBROUTINE PARAMETERS Err msg String variable containing error message This message is sent to the printer device mo ee u u M i aa u ys dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node status Default output Error Opened Type if Type Device then assign Output error Error to Default output write shared if not Error and Type Device then output amp Output error Err msg else r printer is print The default error reporting device for FGen Error is not available print the printer destination has been reset to the CRT plums Bor qd end if stop subend DHELEEELLEELEEEEELELEEEELEL EE ELLELEEL LL ELE ELLE LEE LEA B E E E FTH E LL EL LL UU G 1111 1111 TIT MERGE USER SUBROUTINES HERE
97. ention performs the major steps of 1 generating the data 2 generating the serial frames from the data and 3 generating the test data from the serial frames Al though the present invention could be easily adapted to work with essentially any modern circuit board tester it has been implemented on the HP 3065 circuit board tester machine and it will therefore be described in 4 967 412 3 connection with the HP 3065 The invention is imple mented using a form of the BASIC programming lan guage which has been adapted for use on board test machines and dubbed BT BASIC BT BASIC is well known in the prior art and is fully explained in connec tion with the HP 3065 instruction manual The first major step of generating digital data is per formed by a so called Serial Frame Generator The Serial Frame Generator includes a Data Generator a collection of Data Generation Conversion DG C routines and user written Data Files and a Frame Gen erator The Data Generator produces the digital data which is representative of a given analog signal by ei ther reading data from a user written Data File or gen erating data by executing a given DG C routine The DG C routines produce the digital data representative of single or multi tone sine waves pseudo random bit sequences such as a 511 bit error rate BER signal CCITT G 711 reference and noise signals and CCITT PCM A law and Mu law conversions In addition the Data Generator and DG C
98. er can write applications for his her indi vidualized needs The prior art alternative to the pres ent invention is manual coding which would require significant programmer time in calculating complex serial frames and checking them for accuracy The present invention therefore enables the circuit board testing programmer to produce large amounts of com prehensive and accurate serial frame test data which would simply be too tedious and or time consuming to reasonably produce with prior art alternatives BRIEF DESCRIPTION OF THE DRAWINGS FIG 1 shows a schematic diagram of a circuit board testing machine such as would be used with the present invention FIG 2 shows a step wise flow diagram of the present invention FIG 3 shows a schematic diagram of the present invention FIG 4 shows a schematic diagram of Serial Frame Generator 125 of FIG 3 FIG 4A shows a blow up of Data Generator 200 of FIG 4 FIG 4B is a blow up of box 267 of FIG 4A FIG 5 shows a schematic diagram of PCF Generator 150 of FIG 3 FIG 6 shows an example of Format File 140 FIG 6A shows the contents of the d a data file of FIG 6 FIG 6B shows an example of a PCF Output File 175 which has been derived from the Format File 140 of FIG 6 and the Frame Data File 130 of FIG 6A FIG 7 shows pseudo code which shows how Parser 300 and PCF Source Code Generator of 350 process Format File 140 and Frame Data File 130 respectively to produce P
99. error Error to Default _output write shared if not Error and Type Device then output Output_error Err_msg else printer is print The default error reporting device for FGen Error is not available print the printer destination has been reset to the CRT print Err_msg end if stop subend 111111111111111111111111111111111 1111111111111111111111111111111111111111111111 rr Erk 1111 MERGE USER SUBROUTINES HERE 1111 IrL 1111 fess LEI 15E522115212211222222021 2212122313212321311223221122223112223231313312233313132 3 21 213 13 13 0012 1 1 13 3 3 0 TELECOM GEN FRAME RS232 Rev 3 0 Frame Generator for the serial RS232 format Copyright Hewlett Packard 1987 All Rights Reserved e k k e k k k k k k x k k k k k k x k k ec e k k k k e k k k k k k k k k k k k k k kk k k k k k k k k k k eee ck kk kk K e kk kk x To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 This places the edit cursor at the last line merge file id Merge the file id source at the current edit line M M wn a a ew ee ee ee 4 967 412 99 100 This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or
100. eter containing B1 CHANNEL field data Each element is sent in its boolean representation to the output file as part of a frame The array is dimensioned as a single 1 dimensioned array prior to calling this subroutine B2 Array id parameter containing B2 CHANNEL field data Each element is sent in its boolean repr sentation to the output file as part of a frame The array is dimensioned as a single 1 dimensioned array prior to calling this subroutine p Array id parameter containing D CHANNEL icid Fath ei cono X seer Gs giu Conseca veli s yar nee Lui representativ co Che Cuipuc siie Le The array is dimensioned as a single 1 dimensioned array prior to calling this subroutine dim Buff1 80 Buff2 80 4 967 412 147 148 1 0 TRUE FALSE u I call OpenFile Filel BFilePtr1 call OpenFile File2 FilePtr2 for Frame 0 to Length 1 1 se The LowZero boolean parameter is used to toggle the 0 coding values If LowZero is TRUE then the last bit was coded as a low zero and the 1 current bit should be coded as a high zero value If LowZero is FALSE then the last bit was coded as a high zero and the current bit should be coded as a low zero value The Code SBUS Bit routine will toggle the LowZero parameter is a zero bit value is coded LI LowZero Buff1 Buff2 f TRUE nn Framing bit is always a high zero call Code SBUS Bit
101. execution will stop This subroutine reproduces the Bell System 24 channel frame structure The 24 channel frame consists of a master frame bit followed by 24 time slots of data Each time slot consists of 8 boolean values MSB to LSB For example if Length 1 and the CH24 array is filled with the following values ___ Channel 0 23 for 24 channels of data a This index represents a frame of data Channel 0 0 1 Channel 1 0 2 Channel 2 0 3 Channel 3 0 4 Channel 4 0 5 Channel 5 0 6 Channel 6 0 7 Channel 7 0 8 Channel 8 0 9 channel 9 0 10 u Channel 10 0 11 Channel 11 0 12 Channel 12 0 13 Channel 13 0 14 Channel 14 0 15 Channel 15 0 16 Channel 16 0 17 Channel 17 0 18 Channel 18 0 19 Channel 19 0 20 Channel 20 0 21 Channel 21 0 22 Channel 22 0 23 Channel 23 0 24 4 The output file will be as follows 100000001 I d 0000001000000011000001000000010100000110000001110000100000002002 0000101000001011000011000000110100001110000011110001000000010001 0061001000010011000101000001010100601032025202101121090011000 em oem em ore em EDD ww no global outputs are exported rd 4 967 412 data The array must be dimensioned as a two 2 dimensional array prior to calling this subroutine The first dimension holds the 24 time slot values while the second dimension represents
102. exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error lt gt NO_ERROR then call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if else don t want to write over file call FGen Error OpenFile USER STOPPED PROGRAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if end if subend sub PrintBits Value Number_of_bits This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter E l 1 1 GLOBAL OUTPUTS Mio mmm mmm no global outputs are exported GLOPAL INFUTS ino vem e no gioDa i puts are imported SUBROUTINE PARAMETERS Number of bits Size of the boolean representation of the 1 t Value Integer parameter Range 32768 32767 t t integer parameter Range 1 16 t 4 967 412 109 110 if Number of bits 1 or Number of bits 16 then call FGen Error PrintBits Number of bits lt 1 or Number of bits gt 16 end if DL mr if Value 32768 or Value 32767 then 4 call FG
103. f routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format USER MODIFIABLE PARAMETERS 4 967 412 129 130 1 I 0 Scratch variable MAX LEN 1000 Maximum number of frames Same value used in T data field array dimensioning LEN 0 Default number of frames to generate dim CH1 1000 Channel 1 field array max elements 32766 Chahnel 2 field array max elements 32766 print using print rEAME GiNERATOR print loop input Enter number of frames to be generated LEN exit if LEN gt 1 and LEN lt
104. fer string parameter GLOBAL OUTPUTS ii emm no global outputs are exported Ws sontattosttss no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended e i e ie e E d if Number of bits lt 1 or Number of bits gt 16 then call FGen Error GetBitsLSB Number_ of_bits lt 1 or Number of bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsLSB Value lt 32768 or Value gt 32767 end if 4 967 412 51 52 for I 0 to Number of bits 1 Buffers Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped GLOBAL OUTPUTS WH een no global outputs are exported GLOBAL INPUTS ui _ no glebal inputs are imported SUBROUTINE PARAMETERS FileName A string the containing file pathname of the file to be read into the Array parameter Length The number of integers to be read in
105. fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format The second half of this program consists of a subroutine that formats the values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to pe used for a different frame format USER MODIFIABLE PARAMETERS 0 Scratch variable MAX LEN 1000 Maximum number of frames Same value used in data field array dimensioning LEN 0 Default number of frames to generate dim CTRL 1000 dim ADDR 1000 dim INFO 32766 1 r Control field array Address field array Information field array Array id parameter containing the HDIC information field data This array must be I 1 1 1 t t 1 dimensioned as
106. flagged as INPUTS none OUTPUTS none GLOBAL VARIABLES U Ffile outfi Glb ff Glb ou Glb ma Glb re Glb st n enerator uses the information generated by the parser es the output PCF file Each time a PCF replace line ered the routine PCF repl frame is called The rame routine will attempt to build a replacement frame it to the output file A code will be returned to the ater to indicate the result of the attempt The code in the global variable Glb repl error code and is a No errors there is still data in the master data file No errors but the last piece of data from the master file has been used Error out of data one of the data files did not have enough data to fill the frame Error the master file is out of data but other data a warning SED The Format File at name le The Output File at name ile name The name of the Format File This parameter is used in addition to the at name because the routine must be able to close and re open the Format File tfile name The name of the output file The Code gen routine does the output file assignment so must have access to this variable x repl The global variable defining the maximum number of replacement lines that were found in the Format File pl lines The array of Format File replacement line pointers art_line The line number of the first line of the Format File
107. format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format em i et a USER MODIFIABLE PARAMETERS F ome ome 0 Scratch variable MAX LEN 1000 Maximum number of frames Same value used in data field array dimensioning LEN 0 D fault number of frames to generate Channel field array 4 967 412 11 12 print using e print NONE CHANNEL FRAME GENERATOR print print loop input Enter number of frames to be generated LEN exit if LEN gt 1 and LEN lt MAX LEN print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop LRRARERERKK EKER EERE RE LERE EE EE ERA REL EERERE EERE REERERERERERERER EERE RERERERRREEERER Retrieve Generate field data for frame s aet LG EIEIO I I I A A O O I EEG IOS A TA AG it x LUEETELEEUGEEEEELELETMNEEEEPIS EXAMPLE CLIL TEL Ep ELLE ELE UR PER ELLI One channel of da
108. frame structure 6 732 Copyright Hewlett Packard 1987 All Rights Reserved ke he e e k e k k e k k e e k k k k e k k k k k k k k k k k k Xx k k k de k ce ee k k k k k k k k k k k k k k e k k k k k kk kk k k k k k To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 This places the edit cursor at the iast line merge file id Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists of routines that fill pre defined variables arrays or numeric variables with values from data files user entry or DSP subroutine generated data These predefined variables reflect the data field s within this particular serial frame format values within the predefined variables into this serial frame format The manner in which the predefined variables are formatted is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment t 1 i The second half of this program consists of a subroutine that formats the l 1 1 1 1 1 section proceding the implementation section of each subroutine 4 967 412 41 42 This allows the user
109. ge end if end if if LENGTH lt 1 or LENGTH gt 32767 then call DSP type error Idle code Length parameter out of range else for IND 0 to LENGTH 1 X IND V next IND end if subend idle code oxkkChgt adudQedekt US I DEA Ce LAORE IUE hwi GEAR THO EUR Hoe n ag s EUR sub PRBS SCALE COMPLEMENT LENG i A file pathname telecom gen prbs Rev 3 1 This routine will generate LENGTH values in the array A The values are generated from a shift register which has elements exclusively or ed to feed the lowest bit The description of the circuit is obtained from the array PAT which Iw inicates the bits of the register REGS which are to be Xor ed together to form the next LSB The SCALE parameter indicates the bit width of the shift register to be used The register is initialized to alll bits The COMPLEMENT parameter indicates whether the output stream hould be complemented The bit stream is packed 16 bits in each array element with earliest bit in the sequence as the high order bit Copyright Hewlett Packard 1987 All rights reserved Scale 16 d Complement 0 Length 32000 dim A 32700 i dim PAT 3 Scale is associated with bandwidth limits set for 3065AT if SCALE 6 or SCALE gt 16 then call DSP type error PRBS Scale parameter out of range else if LENGTH 1 or LENGTH 32767 then call DSP type error PRBS Length parameter out
110. gital mW table 7 bti 1001 10 4 158 else if upc Law 1 1 A then A law table Digital mW table 0 bti 00110100 52 Digital mW table 1 bti 00100001 33 Digital mW table 2 bti 00100001 33 Digital mW table 3 bti 00110100 52 Digital mW table 4 bti 10110100 180 e ene s e sm a n i e CC die ii e e 4 967 412 bti 10100001 161 bti 10100001 161 bti 10110100 180 177 178 Digital_mW_table 5 Digital mW table 6 Digital mW table 7 else call DSP_type_error Digital_mW error Law lt gt nM or MAI end if end if wow w for Index 0 to Length 1 Samples Index Digital mW table Index mod 8 next Index call DSP type error Digital mW error Length lt 1 or Length gt 32767 end if subend APPENDIX D _ TELECOM GEN PCFGEN Pattern Capture Format Generator Copyright Hewlett Packard 1987 All Rights Reserved OPERATION This program may be run by typing get util pcfgen run on the command line The Pattern Capture Format Source Generator PCFGEN is a general purpose flexible program designed to produce Vector Control Language VCL compatible PCF source code PCFGEN takes a user written skeleton file called the Format File and user written or machine generated Data Files and combines them into a VCL compatible Output File PCFGEN does not check for correct VCL syntax however so it is
111. he Number of bits parameter Note If the Value parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter Un none no global outputs are exported _____ _ _ ___ no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended m 4 967 412 17 18 if Number_of bits lt 1 or Number_of_bits gt 16 then call Fcen Error GetBitsLSB Number of_bits lt l or Number of bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsLSB Value lt 32768 or Value gt 32767 end if for I 0 to T of bits 1 Buffer Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped GLOBAL OUTPUTS mn no global outputs are exported GLOBAL INPU
112. he user serial frame data will either be generated with a given DG C routine or read from a given Data File The eight framing protocol options available in the preferred embodiment of the present invention are as follows 1 channel 24 channel and 30 channel T1 frames Siemens IOM and SLD frames serial RS232 frames and X 25 HDLC frames and the ISDN S Bus protocol conforming to the CCITT 1 430 standard Typically data for the RS232 the X 25 and the ISDN 20 25 30 35 45 50 55 65 6 S Bus CCITT 1 430 protocols will reside in memory structure 210 in user written Data Files Typically data for the remaining protocols will be generated with a given DG C routine Given the user selected protocol and the appropriate data either generated with a DG C or read from a user written Data File Frame Generator 250 formats the data into serial frames con forming to the selected protocol The serial frames are then stored in Frame Data File 130 As noted above the present invention is implemented in software in the BT BASIC programming language The BT BASIC implementation of Serial Frame Generator 125 is listed in Appendices A and B Appendix A contains the BT BASIC code for Data Generator 200 and Frame Gener ator 250 Appendix B contains the BT BASIC code for the DG C routines FIG 4A shows a blow up of Data Generator 200 of FIG 4 As shown in box 255 Data Generator 200 re ceives input requesting N number of se
113. hich maps a replacement character index to the PCF replacement column assigned to that character dim Glb PCF cols 1 16 This array does the mapping between the PCF column number of a replacement character and the actual column number of that character The first dimension must be the same as the Max repl lines constant and the second dimension must be the same as the Max repl chars constant dim Glb repl cols 0 100 1 16 t p o p pm e The type of line found by the Format dim Glb line type 80 File scanner t e I These variables store the PCFGEN command and parameters found by the PCFGEN command scanner dim Glb PCFGEN comm 1 Glb PCFGEN param1 80 Glb PCFGEN param2 80 dim Glb master repl_char 1 The character to be used as the Master Glb master repl char replacement character si The following arrays are the buffers and buffer pointers for the Data Files THE UPPER ARRAY DIMENSION 16 MUST NOT BE CHANGED UNLESS THE ROUTINES ASSIGN DFILE AND READ LINE ARE CHANGED ALSO dim Glb dfile buffer 1 16 80 The line buffers for the data files dim Glb dfile buffptr 1 16 The pointers into the line buffers t Glh repl count 0 The total n mber of c valid replacement The global variable defining the maximum number of replacement lines that were found in the Format File Glb max repl 0 om qows 4 4 967 412 Glb_valid_PCF_chars lO0HLXZPN hlxzpn Glb PCF
114. hose which have a as the first non blank character Blank lines are written to the output file but are otherwise ignored Commented lines are written to the output file as they are encountered Non commented lines are loaded into a line buffer and are then accessed character by character as each subsequent call to the routine is made If a non PCF character is found the following actions will take place if the character is a space or a semicolon new lines will be read from the data file until end of file or another non commented line is found Otherwise an error message will be generated Once a valid data character has been found a look ahead scheme is used to determine if the character is the last character in a frame the character is followed by a single semi colon or the last character in the file the character is followed by a double semi colon The code returned to the calling routine is set accoraingiy s INPUTS Dfile_num The index of the data file to be used by Get_char OUTPUTS Dfile_char The valid data replacement i character found by Get char Code The end of frame or end of data code discussed in the operation section above GLOBAL VARIABLES USED 5 file em s om gt oum s ae om om a o s 5 i 4 967 412 227 228 Glb dfile buffer The line buffer used to hold the current non commented line i Glb_dfile buffptr The pointer into the line buffer
115. i 1 l i i 4 967 412 95 96 FilePtr The 8 file pointer If the file is opened this pointer may be used by output statements to write data to the file NO ERROR o EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign FilePtr Error to FileName write new if Error NO ERROR then if Error FILE EXISTS then print print The file FileName already exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error NO ERROR then call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if else don t want to write over file call FGen Error OpenFile USER STCPPED PROGRAM end if else file error of some sort call FGen_Error OpenFile FILE ERROR amp FileNameS amp SerrmS rror end if end if subend sub PrintBits Value Number of bits This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits gt parameter GLOBAL OUTPUTS uu Sse sessess no global outputs are exported WH no global inputs are imported Value Integer p
116. important that the original Format file be Syntactically correct with the exception of the special constructs and commands allowed by PCFGEN The manuals contain complete information on correct Format and Data file syntax use of PCFGEN and examples Please consult the manuals for information on proper use of PCFGEN Subsequent comments contained here will address detailed operation and organi zation of the PCFGEN software rather than its use The PCFGEN software consists of two major modules the Format File Parser and the Code Generator Each module contains several lower level sub modules In addition there are general purpose subroutines for error handling and program termination The software is organized as follows Rev 3 0 dedo deed dod dece ERE TTTTITTTI TITTI TTTTITTI TITTI TT LITI ee Li ii iii e sm ao o ao aom i i ee om em di om ere o nee ene cnn ones 0m 9 o Crm dem s lt o o dem gue ome b x oue o e em One sce s om ome s tae oc om So om Saw oc oc Ge om ecm fom s fm nn 4 967 412 79 180 LEVEL 1 LEVEL 2 LEVEL 3 FORMAT FILE PARSER Su Format File Line Scanner a PCFGEN Command Scanner PCF Scanner PCFGEN Command Processor Data File Assigner CODE GENERATOR PCF Replacement Frame 1 I Processor Data File Scanner Data File Line Reader
117. ine will generate LENGTH values in the array X The values are Gaussian distributed pseudo random numbers Copyright Hewlett Packard 1987 All rights reserved if LENGTH 1 or LENGTH 32767 then call DSP type error G noise Length parameter out of range else I Twopi 2 pi di f set up random number generator randomize SEED SEED2 10000000 rnd randomly generate values between 1 amp 1 for IND 0 to LENGTH 1 X IND cos Twopi rnd next IND E reinitialize the random number generator randomize SEED2 apply 2nd degree of randomness for IND 0 to LENGTH 1 X IND X IND VRMS sqr 2 log 1 rnd next IND end if subend G noise BER TRAIT IR RIERA TTT TT ER RARER RK RRR UAR EE IIR ITER OXON RR A sub Idle Code C LENGTH X 1 file pathname telecom gen idle code Rev 3 0 This routine will generate LENGTH values in the array X The values are generated as alterating sign values starting with the positive value first C is used to indicate the code type desired If C starts with the letter A A law will be used and 1 s will be l generated If C starts with the letter M Mu law code will be used and 1 O s will be generated Copyright Hewlett Packard 1987 All rights reserved a if lwc C 1 1 a then V 213 else if lwc CS 1 1 m then 4 V 255 4 967 412 171 172 else call DSP_type error Idle code Law parameter out of ran
118. ing values Channel 0 128 Channel i 255 Channel 2 0 Channel 3 255 aem The output file will be as follows 10000000 f 11111111 00000000 11111111 GLOBAL OUTPUTS UR no global outputs are exported uno _ _ _ no global inputs are imported FileName String containing file pathname of the output file Length The number of frames to be generated Range 1 MAX LEN Channel Array id parameter containing 8 bit 0 255 single pcm channel of data This array must be dimensioned as a single 1 dimension array of 0 to MAX LEN elements prior to calling this subroutine onor nn dim Buffer 80 call OpenFile FileName FilePtr for Frame 0 to Length 1 Buffer call GetBitsMSB Channel Frame 8 Buffers I The last frame of data ends with two characters I if Frame Length 1 then output FilePtr Buffer else output FilePtr Buffer end if hoo oe next Frame close the output file 1 assign PilePtr Erzor to subend sub GetBitsMSB Value Number_of bits Buffer This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter Note
119. is discussed in the comment section of the framing subroutine The subroutines following the framing subroutine are standard throughout the frame generator programs Not all of these subroutines are used in a particular frame generator These subroutines are documented in the comment section proceding the implementation section of each subroutine This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format e e M me s e P eee ewe won USER MODIFIABLE PARAMETERS 4 967 412 143 144 1 I 0 Scratch variable MAX LEN 1000 Maxim m number of frames Same value used in data field array dimensioning LEN 0 Default number of frames to generate dim B1 1000 Channel Bl field array max elements 32766 dim B2 1000 Channel B2 field array max elements 32766 diu D 10C0 D channel field array max elements 32766 dim E 1000 D echo channel field array max elements 32766 am ACL isles Aub yacine Git fice sige AT e Pasi 1 re mmm a ae en M vv f i print using e print SBUS TE gt NT FRAME GENER
120. ix A The implementations as listed in Appendix A are shown in Tabie 1 The imple mentations are quite self explanatory Note also that for each protocol Frame Generator 250 will call a given Frame Generation Subroutine as shown in box 267 Each Frame Generation Subroutine in turn will call the subroutines GetBitsMSB box 269 GetBitsLSB box 271 OpenFile box 273 PrintBits box 275 and possi bly FGen 3 Error box 277 The Frame Generation Subroutines corresponding to each protocol are listed Table 2 below The subroutines called by the Frame Generation Subroutine of box 267 are also explained and defined in Appendix A as listed in Table 2 TABLE 1 BT BASIC Protocol Implementations Appendix A page numbers in parentheses PROTOCOL IMPLEMENTATION 1 X 25 HDLC FRAME HDLC 30 44 2 RS232 FRAME RS222 54 62 3 1 channel T1 FRAME ICH 1 9 4 24 channel T1 FRAME 24CH 10 19 5 30 channel T1 FRAME 30CH 20 29 4 967 412 7 TABLE 1 continued BT BASIC Protocol Implementations Appendix A page numbers in parentheses PROTOCOL IMPLEMENTATION 6 Siemens IOM FRAME_IOM 44 53 7 Siemens SLD FRAME_SLD 62 71 8 ISDN S Bus CCITT 1 430 9 user definable protocol template FRAME SBUS 83 94 FRAME TEMPLATE 72 80 TABLE 2 Protocol Frame Generation Subroutines Appendix A page location in parentheses PROTOCOL SUBROUTINE 1 X 25 HDLC Generate hdlc 32 2 RS232 Generate rs232 55 3 1 cha
121. l and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format eem m a ae n M ee eS i T s I 0 Scratch variable MAX LEN 1000 Maximum number of frames Same value used in data field array dimensioning LEN L 0 Default number of frames to generate FIRST TRUE Fill first frame half with XMITdata FALSE second 1 1 I 1 dim CH_A 1000 Channel A field array max elements 32766 dim CH_B 1000 Channel B field array max elements 32766 dim CTRLY20CC Control field array max elements 32766 dim SIGL 1000 Signal field array max elements 32766 print using print SLD FRAME GENERATOR print print loop input Enter number of frames to be generated LEN exit if LEN gt 1 and LEN lt MAX LEN print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop loop input Send data in first 1 or second 0 half frame FIRST exit if FIRST lt 1 and FIRST gt 0 print VALUE OUT OF RANGE RANGE 0 1 RETRY end loop A REERAEERAAERAEA EAE RA EL ARES AE READ EASA EAE LATS RARE ELERRE EAR ERA EARLE AREER TS OUR EN Retrieve Generate field data for Frame s lt lt lt kk ERE KK ERE KEK REE REE RE KEKE KEK EKER RK ERKEEKRREKRERREK KK KEEREREER 4 967 412 113 114 PCE ELE EEE ERE FerELE LD EXAM PILE LETISEEEEDIEGUCUPEEUEELEEEUEELLEEI Ji Chann
122. ld NOT pass those lines to the scanner 1 l l 1 I 2 Comment line a comment line will be defined as a line whose first non blank character is a followed by anything except the special PCFGEN command sequence defined by the global string Glb_PCFGEN_chars If a line is found i to be a comment by the scanner the value comment will be assigned to the global string Glb line type 3 PCFGEN command line a PCFGEN command line is defined as a line witH a comment Character in column 1 which is I Dee eme s eme o o om om pm emm sm x o pme a dm e ee e e e em I 4 o om dun de em om o aA sm E i om em a m em e oc s p e ome 4 A PCF line 5 A VCL statement INPUTS 193 4 967 412 194 immediately followed by the PCFGEN command sequence defined by Glb PCFGEN chars The syntax for a PCFGEN command is chars command param 1 param 2 where chars the PCFGEN command sequence command the single character PCFGEN command param 1 the first PCFGEN command parameter param 2 the second PCFGEN command param the PCFGEN command may be followed by comments When a PCFGEN command line is found by the scanner the value PCFGEN command will be assigned to Glb line type the command field will be assigned to
123. le generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop GLOBAL OUTPUTS UR ee ea a em tm ori no global outputs are exported GLOBAL INPUTS em en no global inputs are imported SUBROUTINE PARAMETERS FileName String containing file pathname of the output file Length The number of frames to be generated Range 1 MAX LEN Channeli Array id parameter containing CHANNEL 1 field data Each element is sent in its boolean The array is dimensioned as a single 1 dimensioned array prior to calling this subroutine Channel2 Array id parameter containing CHANNEL 2 field data Each element is sent in its boolean The array is dimensioned as a single 1 dimensioned array prior to calling this subroutine s s o oan bma bm ome pam s ome x ome E Ld dim Buffer 80 call OpenFile FileName FilePtr for Frame 0 to Length 1 Buffer Get the lower eight bits of each element of the Channell array MSB gt LSB call GetBitsMSB Channell Frame 8 Buffer tm oe call GetBitsLSB Channel2 Frame 16 Buffer The last frame of data ends with two characters if Frame Length 1 then output FilePtr Buffer else output FilePtr Buffer end if next Frame 1 cl
124. line of Format File 0 else 4 967 412 201 202 1 get the second parameter Temp col Column 1 loop Loop until end of line or next double quote Column Column 1 if Column gt Line_len then call Abort Incomplete second parameter on PCFGEN command line 19 end if exit if PCFcom line Column 1 end loop Save second parameter Glb PCFGEN param2 PCFcom line Temp col Column Temp col end if end if Glb line type PCFGEN command subend OPERATION This subroutine will accept a line of PCF and will do one of two things depending on the state of Repl flag If Repl flag is true lt gt 0 the PCF line will be scanned for replacement characters Each time a replacement character is found the PCF column for that character will be entered in the Glb PCF cols array and the character itself will be put into the Glb _repl_ chars array Checking is performed to make sure a given character is only used once E replacement characters and each character will be checked to make sure it is in the correct column In both cases the actual Format File column of the replacement character will be saved in the Glb repl cols array The Glb repl cols array has an actual column entry for each replacement character in each replacement line t I 1 I l 1 i If Repl flag is false 0 the line will be scanned for 1 t l 1 1 1 INPU
125. losed As noted above Data Generator 200 either reads data from a user written Data File or produces data by in voking DG C routines In the preferred embodiment of the present invention the DG C routines are also im plemented in the BT BASIC programming language The DG C routine BT BASIC implementations are listed in Appendix B The DG C routines are also described and explained in Chapter 9 of HP 3065 X L user s Manual Vol III Rev C sections 9 4 3 through 9 4 12 FIG 5 shows a schematic diagram of PCF Generator 150 of FIG 3 PCF Generator 150 merges data with a programming language to produce a file which is di rectly executable by computer 5 In the preferred em bodiment of the present invention PCF Generator 150 has two input files data is contained in Frame Data File 130 and a programmable language is contained in For mat File 140 The data in Frame Data File 130 may be supplied by the user or it can be generated by Serial Frame Generator 125 Format File 140 is written by the 10 40 50 60 8 user Format File 140 will contain executable VCL code together with instructions for merging the data in Frame Data File 130 with the executable VCL code to produce an executable PCF Output File 175 As noted above VCL stands for Vector Control Language VCL is a feature of the HP 3065 circuit board tester VCL is a high level language which is compiled linked and executed by the HP 3065 computer V
126. lt 1 or Num of bits gt 16 then call FGen_Error PrintBits ber of bits 1 or Number of bits gt 16 end if if Value 32768 or Value 767 then call FGen Error PrintBits 3e 32768 or Value gt 32767 end if Buffer for I Number of bits 1 to ap 1 Buffer Buffer amp val b alue I next I print Value Buffer subend sub FGen Error Err msg z This routine reports an message from the Err_msg string parameter and stops program sution This routine attempts to report the error on the pri device and if this is not possible the printer device is reset the CRT and the error is reported GLOBAL OUTPUTS WH _____ no al outputs are exported GLOBAL INPUTS 0 ___ no val inputs are imported SUBROUTINE PARAMETERS Err msg st variable containing error message This me e is sent to the printer device dim Default output 80 Default output dev crt t Device 4 satus value of an HFS device node Status Default output Errc ned Type if Type Device then assign put_error Error to Default output write shared tee pam oma s om pm i die 4 967 412 141 142 if not Error and Type Dex then output output error Err E else printer is print The default error orting device for FGen Error is not available print the printer desti on has been reset to the CRT print Err msg end if stop subend 11111
127. lue Number of bits Buffer This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean Values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the Number of bits parameter Note If the Value parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS DI a Sectors seen eee no global outputs are exported i a cs no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended if Number of bits lt 1 or Number of bits gt 16 then call FGen Error GetBitsLSB Number of bits lt 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then i call FGen_Error GetBitsLSB Value lt 32768 or Value gt 32767 end if 4 967 412 105 106 for I 0 to Number of bits 1 Buffer Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array e e m sm em tm tm sm ee om e ee i te tt
128. m MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter GLOBAL OUTPUTS Ul ume SS no global outputs are exported WH __ _ ___ no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 if Number of bits lt 1 or Number of bits gt 16 then call FGen Error PrintBits Number of bits 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then call FGen Error PrintBits Value lt 32768 or Value 32767 end if Buffer for I Number of bits 1 to 0 step 1 Buffer Buffer amp val DER Value I next I print Value Buffer subend S 1 l 1 1 1 ub FGen_Error Err_msg M a ee en M a _____________ This routine reports an error message from the Err msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS n _ _ no global outputs are exported un 22 no global inputs are imported Err msg String variable containing error message This me
129. m section is the remaining part of the Format File and contains VCL and PCF statements Recall that PCF is explained in chapter 7 of the 3065 X L user s manual Vol III and VCL is explained in chapter 23 of the 3065 X L user s manual Vol I The lines beginning with the character are comment lines in VCL However a line begin ning with I is a replacement command to the PCF Generator The command will specify a replace ment character and the name of a Frame Data File 130 In FIG 6 the PCF command line is M di3 a data The asterisk is the replacement character and d_a_data is the name of the Frame Data File 130 The command tells the PCF Generator to replace the asterisk with data from the d a data file wherever the asterisk occurs in the PCF code in the program section of the Format File The PCF code is bounded by the statements pcf and end pcf in the program section FIG 6A shows the contents of the d_ a data file of FIG 6 The d a data file is the Frame Data File 140 FIG 6B shows an example of a PCF Output File 175 which has been derived from the Format File 140 of FIG 6 and the Frame Data File 130 of FIG 6A FIG 7 shows pseudo code which shows how Parser 300 and PCF Source Code Generator of 350 process Format File 140 and Frame Data File 130 respectively to produce PCF Output File 175 Parser 300 detects the t line in Format File 140 reads the name of the Frame Dat
130. m we ne ghebal cui puts are saporite GLOBAL INPUTS 1 n 2 2 2 no global inp ts are imported LI T SUBROUTINE PARAMETERS Value Integer parameter Range 32768 32767 1 Number_of_bits Size of the boolean representation of the integer parameter Range 1 16 1 Buffer String parameter to which the boolean representation is appended 1 1 co ee eee ew e n J T M if Number of bits 1 or Number of bits 16 then call FGen Error GetBitsLSB Number of bits l or Number of bits gt 16 end if if Value 32768 or Value gt 32767 then call FGen Error GetBitsLSB Value lt 32768 or Value gt 32767 end if for I 0 to Number of bits 1 Buffer Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped GLOBAL OUTPUTS Wi Qs no global outputs are exported GLOBAL INPUTS W svossstrenat no global inputs are imported Gee p b ome e e i tue v ee t ta dt mp 4 967 412 159 160 SUBROUTIN
131. merging the data in the Frame Data File with the exe cutable VCL code to produce an executable PCF Out put File VCL stands for Vector Control Lan guage VCL is a feature of the HP 3065 circuit board tester VCL is a high level language which is compiled linked and executed by the HP 3065 computer VCL allows a programmer to operate the HP 3065 with source code like programming instructions VCL is fully explained in chapter 23 of the HP 3065 X L user s manual Vol I System Reference The PCF Generator includes a Parser and a PCF Source Code Generator which generates VCL compatible source code The Format File is the input file to the Parser The Frame Data File is the input file to the PCF Source Code Generator The Parser processes the syntax information in the Format File and issues commands to the PCF Source Code Generator The PCF Source Code Gener ator processes the Frame Data File together with the output of the Parser to produce the PCF Output File containing VCL compatible PCF source code 20 25 30 40 45 50 55 65 4 The VCL compatible PCF source code that is the PCF Output File may be compiled linked and exe cuted by the HP 3065 Thus the present invention al lows the HP 3065 user to quickly specify and generate serial data frames for the testing of telecommunications circuits The invention allows for high programmer productivity as well as providing adaptability so that the programm
132. meter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the Number of bits parameter Note If the Value parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS Ul omine iniri m no global outputs are exported e im sm s om pae x GLOBAL INPUTS 4 967 412 33 34 WH no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended eme em amm oum Gmm t O oue od if Number_of_bits lt 1 or Number_of_bits gt 16 then call FGen Error GetBitsLSB Number of bits 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then call FGen Error GetBitsLSB Value lt 32768 or Value gt 32767 end if for I 0 to Number of bits 1 Buffer Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array Dn ee ee ee re te ee a d60 11726 n oS A u
133. msg String variable containing error message This message is sent to the printer device dim Default_output 80 Default_output dev crt amp crt Device 4 status value of an HFS device node status Default output Error Opened Type if Type Device then assign Output_error Error to Default output write shared if not Error and Type Device then output 0utput_ error Err msg else printer is print The default error reporting device for FGen Error is not available print the printer destination has been reset to the CRT print Err msg end if stop subend D PIL MERGE USER SUBRCUTINES HERE um LI LI prr mS 4 4 2 a I wk E 4 a E 3 1 5 9 9 ni me Ome om am De om pan t o o ns 4 967 412 165 166 ya amp akina S ku p A LA a PRON pr dt 8 hok RA e aha tk sub Tone VRMS SIG_FREQ PHASE SAMP FREQ LENGTH X file pathname telecom gen tone APPENDIX B D uy ae 2 TE This routine will generate LENGTH values in the array X The value at N is computed by the formula t La X N 2 1 2 Vrms cos 2 pi SIG FREQ N SAMP FREQ PHASE 360 1 where LE Vrms is the signal amplitude in volts rms 1 SIG_FREQ is the signal frequency I SAMP FREQ is the sampling frequency avt t PHASE is the initial phase angle ix Copyright Hewlett Packard 1987 All rights reserved 3 parameter check if SAMP_FREQ lt 0 or SIG
134. n afray of 0 to MAX LEN elements dim Buffer 80 call OpenFile FileName FilePtr 0 to Length 1 nt for Frame Buffer for Channel 0 to 29 I 1 Before the first channel put out the control field 1 if Channel 0 then call GetBitsMSB Control Frame 8 Buffer end if i Before the 16th channel put out the signal field if Channel 15 then call GetBitsMSB Signal Frame 8 Buffer end if call GetBitsMSB CH30 Channel Frame 8 Buffer I Output Buffer so that overflow will not occur 1 if Channel mod 8 0 then output FilePtr Buffer Buffer end if next Channel 1 The last frame of data ends with two characters if Frame Length 1 then output amp FilePtr Buffer else output FilePtr Buffer end if next Frame 1 x close the output file I assign FilePtr Error to subend sub GetBitsMSB Value Number of_bits BufferS This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter i 4 1 1 Note If the Value p
135. name already exists print Do you want to write over the file ee or no input Temp if lwc Temp 1 1 y then assign Outfile Error to Clb outfile name write if Error then call Abort Could not assign output file Error end if else input Do you want to select a different file Y or N Temp if lwc Temp 1 1 lt gt y then stop end if end if exit if not Error end loop print print Parsing Glb ffile_name call Parse_ffile print Generating PCF call Code_gen call Close_ files end OPERATION the parser performs three major functions 1 The parser will look for command lines in the header of the format file and will pass any commands it finds to the command processor 2 the parser will find the start of the program block 3 the parser will create the linked list containing the line numbers of valid replacement lines in the format file INPUTS none OUTPUTS none GLOBAL VARIABLES USED Glb line type The type of line found by the Format File Scanner see routine Scan ffile line Glb PCFGEN comm Glb_ PCFGEN paraml I Glb_ PCFGEN param2 The PCFGEN command found by the PCFGEN Command Scanner see routine PCFcom scan Glb repl lines The array containing the actual Format File line number of each replacement line e pmm ome ae x pme ome pce am sm a E sm eme ac om pc em a m a ee be 4 te a
136. nform to User Input 75 These serial frames will then be stored in Frame Data File 130 User Input 75 will also include a user written Format File 140 The Format File 140 is a user written file containing executable VCL code together with instruc tions for merging the data in the Frame Data File 130 with the executable VCL code to produce an execut able PCF Output File 175 Frame Data File 130 and Format File 140 are input files to Pattern Capture For mat PCF Generator 150 Obeying the merge instruc tions in Format File 140 PCF Generator 150 merges the serial frame data from Frame Data File 130 with the executable VCL code in Format File 140 to produce PCF Output File 175 containing VCL compatible PCF source code which is executable by the HP 3065 An example of such a PCF Output File 175 is shown in box 59 of FIG 2 FIG 4 shows a schematic diagram of Serial Frame Generator 125 of FIG 3 Serial Frame generator 125 includes Data Generator 200 memory structure 210 containing DG C routines and Data Files and Frame Generator 250 As noted above User Input 75 will specify the particular telecommunications protocol to which the desired serial frame data must conform In the preferred embodiment of the present invention eight widely followed protocol options are available as well as a general template option with which the user can tailor a protocol that is not among the eight options Depending upon the protocol chosen or tailored by t
137. ngth The number of frames to be generated Range 1 MAX LEN B1 Array id parameter containing B1 channel field data Each element is sent in its boolean representation to the output file as part of a frame Must be dimensioned prior to calling this routine single dimension 1 32766 B2 Array id parameter containing B2 channel field data Each element is sent in its boolean representation to the output file as part of a frame Must be dimensioned prior to calling this routine single dimension 1 32766 Monitor Array id parameter containing MONITOR field data Each element is sent in its boolean f representation to the output file as part of a frame Must be dimensioned prior to calling this routine single dimension 1 32766 D Array id parameter containing D channel field data Each element is sent in its boolean representation to the output file as part of a frame Must be dimensioned prior to calling this routine single dimension 1 32766 C_I Array id parameter containing C I field data Each element is sent in its boolean representation to the output file as part of a frame Must be dimensioned prior to calling this routine single dimension 1 32766 TE Array id parameter containing T and E field data Both T and E bits are encoded in each element of this array Bit O is the E bit while Bit 1 is the T bit Examples
138. nificant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter Note If the lt Value gt parameter is greater than the 2 s complement range for the lt Number of bits gt parameter requested the extra bits withing the lt Value gt parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS MI _____ no global outputs are exported mi no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended i x s e pae x x pme pae X P onore uo qq iii M te o ii iaia i 70 if Number_of bits lt 1 or Number_of bits gt 16 then call FGen Error GetBitsMSB Number of _bits lt 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then call FGen Error GetBitsMSB Value 32768 or Value 32767 end if for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend sub GetBitsLSB Value Number of bits Buffer This routine retrieves the boolean representation of an integer parameter and appends it to a string para
139. nnel T1 Generate__ich 2 4 24 channel T1 Generate _24ch 12 5 30 channel T1 Generate__30ch 22 6 Siemens IOM Generate iom 46 7 Siemens SLD Generate sld 64 8 ISDN S Bus CCIT 1 430 Generate_sbus 83 9 user definable protocol Generate frame 74 template i FIG 4B is a blow up of box 267 of FIG 4A A given Frame Generation Subroutine such as Generate__24ch is called in box 280 In box 282 a counter variable is initialized to zero Frame Data File 130 is then created in box 284 The data to be formatted into a frame will have been produced by Data Generator 200 either by invocation of a DG C and or reading from a user writ ten Data File In the preferred embodiment of the pres ent invention the data produced by Data Generator 200 will reside in a temp file in main memory in computer 5 In box 286 the first line of such data is inserted into a given frame format as dictated by the user chosen protocol The frame information generated in box 286 is then written to Frame Data File 130 The counter vari able is then incremented in box 290 A check is made in diamond 292 to see if the number of frames N re quested by the user have been written If not the pro cess loops back to box 286 and the next line of data in the temp file is formatted into a frame On the other hand when the N frames requested by the user have been generated and written to Frame Data File 130 then Frame Data File 130 is c
140. nored and not put into the lt Buffer gt string parameter o ome GLOBAL OUTPUTS MU ebete cem no gicbal outputs are exported 3 aw e dn ui no global inputs are imported Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended 4 fv D if Number of bits 1 or Number of bits 16 then call FGen Error GetBitsMSB Number of bits 1 or Number of bits 16 end if if Value lt 32768 or Value gt 32767 then call FGen_Error GetBitsMSB Value lt 32768 or Value gt 32767 end if for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend sub GetBitsLSB Value Number of bits Buffer Hs as HIYAOLSIL rsccu eee eoveeeou gt _P y y This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the lt Number_of bits gt parameter Note If the lt Value gt parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not p
141. nt 1 if len Buffer gt MAX BUFFER SIZE then call ReadyForOutput TransCount CRC2 Buffer if FirstBuffer then FirstBuffer 0 output FilePtr Flag Buffer else output FilePtr Buffer end if Buffers end if end loop 1 Skip end of frame marker 1 in info array t InfoCount InfoCount 1 call ReadyForOutput TransCount CRC2 Buffer if FirstBuffer then FirstBuffer 0 output FilePtr Flag Buffer else output FilePtr Buffer end if 4 967 412 65 66 Buffer l 1 l BitCount 16 15 14 1 16 12 5 Calculate CRC for X X X X t X 1 X X X 1 CRC1 bti 1111111111111111 o r I 1 to BitCount call CRC 0 CRC1 next I 16 16 12 5 Calculate CRC for X frame bits X X X 1 where the frame bits are from the last bit of the opening flag to the first bit of the frame crc word exculsive or I 1 to 16 call CRC 0 CRC2 next I em Hr mam ro o h Frame Check Sequence calculation from the two base CRC s call GetBitsMSB bincmp bineor CRC1 CRC2 16 Buffer call ReadyForOutput TransCount CRC2 Buffer 1 The last frame of data ends wifh two characters E i if Frame Length 1 then output FilePtr Buffer FIAGS else output FilePtr Buffer FLAGS end if next Frame close the output file y assign FilePtr Error to subend T Mt M t A n a re ta t a
142. num I Write the PCF line to the output file output QOutfile Error Templine if Error 0 then call Abort Error writing to output file Error end if Exit the loop if the master data file is at the end of a frame or the end of the file exit if Master code 1 or Master code 2 1 Exit the loop if any data file has run out of data exit if Datafile code2 end loop if Master_code 2 then if Chars_left_flag then The last master character has been used but there is still data in a data file Glb repl error code 3 else 4 967 412 225 226 The master file and all data files have run out of data at the same time Glb repl error code 1 end if else Master code must equal 1 if Datafile code2 then One of the data files has run out of data before the master Glb repl error code 2 else There is still data in the master file and all data files Glb repl error code 0 end if end if subend t a om aom t e e ee amp one dia de hua 9 9 e s qo Ao Sas a E paq SS aseo a ama w OPERATION The routine Get_char is a data file scanning routine It will scan the a specified data file and always find the next valid data character skipping over comments blank lines and all characters on a line trailing an end of frame character A data file may contain three types of lines blank lines commented lines and un commented lines Commented lines are t
143. o input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error NO ERROR then call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if else don t want to write over file call FGen Error OpenFile USER STOPPED PROGRAM end if eise file error of some sort call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if end if subend 4 967 412 79 80 sub PrintBits Value Number of bits 1 i dd x i i e er Le 2 T 2 2 2 This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter GLOBAL OUTPUTS ur sessione no global outputs are exported MI _______ no global inputs are imported SUBROUTINE PARAMETERS Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 if Number of bits 1 or Number of bits 16 then call FGen Error PrintBits Number Of bits lt 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then
144. ocess the Codec samples the analog signal at the rate of 8 KHz Thus for instance eight samples would be required to digitize a 1 KHz analog signal These eight samples would be inserted in the same chan nel position of eight consecutive T1 frames The general procedure for digitizing a given analog signal with a Codec is as follows 1 generate the voltage sample of the sine wave for each sampling interval of time 2 convert the voltage sample to the appropriate pulse code modulated PCM eight bit code that is digitize the sample 3 insert the eight bit digitized sample value into the proper channel position of a 24 channel T1 frame 4 repeat steps 1 through 3 for the next sample value This procedure however becomes exceedingly tedious and time consuming even for relatively sim ple signals like a sinusoidal frequency For instance sampling a 1010 Hz signal at a sampling rate of 8 KHz would require 800 samples before the samples would begin to repeat themselves These 800 samples would be inserted in the same channel position of 800 consecutive T1 frames This amounts to 800X 193 154 400 bits of information which would be necessary to test a Codec to determine if it properly digitized a 1010 Hz signal In addition the PCM analog to digital conversion process may require application of a complex transfer function See the International Telegraph and Telephone Con sultative Committee CCITT Red Book Vol III Fas cicl
145. of range else if COMPLMENT lt 0 or COMPLEMENT gt 1 then call DSP type error PRBS Complement parameter out of range else on SCALE 5 goto VI VII VIII IX X XI XII XIII XIV XV XVI the values in this array indicate the bit positions that are Xor ed to get the lsb The value 1 indicates the msb of the register 1 VI PAT 0 1 PAT 1 2 PAT 2 0 PAT 3 0 1 110000 goto INIT VII PAT 0 1 PAT 1 4 PAT 2 O PAT 3 O 1001000 goto INIT VIII PAT O 1 PAT 1 3 PAT 2 4 PAT 3 5 10111000 goto INIT IX PAT 0 1 PAT 1 5 PAT 2 0 PAT 3 O 100010000 goto INIT X PAT 0 1 PAT 1 4 PAT 2 0 PAT 3 0 1001000000 goto INIT A XI PAT 0 1 PAT 1 3 PAT 2 O PAT 3 0 10100000000 goto INIT XII PAT 0 1 PAT 1 2 PAT 2 5 PAT 3 7 1 110010100000 goto INIT da XIII PAT 0 1 PAT 1 2 PAT 2 4 PAT 3 5 1101100000000 goto INIT XIV PAT 0 1 PAT 1 2 PAT 2 7 PAT 3 11 1 11000010001000 goto INIT XV PAT 0 1 PAT 1 2 PAT 2 0 PAT 3 0 1 110000000000000 goto INIT XVI PAT 0 1 PAT 1 2 PAT 2 4 PAT 3 13 1 1101000000001000 INIT 2 INITREG 1111111111111111 initialize register to all ones actual size REG INITREGS 1 SCALE 4 967 412 173 174 BITS G Tr 3 i Lor all elements in the array loop initialize array element when new item if BITC 0
146. ommands Glb_valid_repl_chars The string containing all of the valid replacement characters found in the Format File header Glb master repl char The master replacement character this variable should be set to the null string at the start of PCFGEN em s die om x O i x d n aom sub Comm proc global Glb PCFGEN comm Glb PCFGEN paraml Glb_PCFGEN_param2 global Glb valid PCFGEN comm Glb master repl char Max repl chars global Glb repl count Glb valid repl chars True False global Glb valid PCF chars first convert the command to an index number for the jump table 4 967 412 209 tee 210 Comm_index pos Glb_valid_PCFGEN_comm Glb_PCFGEN_comm if Comm_index 0 then T This condition can never really exist but the check is here just in case the calling routine is modified such that a non valid command may be passed to this routine call Abort Unknown command found by command processor 0 end if 1 Here is the command branch statement jump table war Comm index goto M X M master replace command if len Glb_PCFGEN paraml lt gt 1 then The parameter for this command is not exactly one character long Report error call Abort Invalid first parameter for M command 0 end if if pos Glb valid PCF chars Glb_PCFGEN_paraml lt gt 0 then dA The parameter is a valid PCF character so it can not b
147. or end if else don t want to write over file call FGen Error OpenFile USER STOPPED PROGRAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if end if subend 4 967 412 37 38 ae PrintBits Value Number of bits em em em tm pme 0 tt This routine prints the boolean representation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to ISB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the lt Number of_bits gt parameter GLOBAL OUTPUTS un farsi no globad outputs are exported GLOBAL INPUTS uo eee em cere oe oe ee no global inputs are imported SUBROUTINE PARAMETERS Value Integer parameter Range 32762 32767 Number of bits Size of the boolean sasan of the integer parameter Range 1 16 if Number of bits 1 or Number of bits 16 then call FGen Error PrintBits Number of bits 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then call FGen Error PrintBits Value lt 32768 or Value gt 32767 end if Buffer for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I print Value Buffer subend sub FGen_Error Err msg This routine reports an e
148. ormat file for D A CODEC text The PCF order is I gt Valid_data Data bit Xx PCF vector contains two bits Following is a Pcfgen command it specifies d_a_dala as the frame data file to be read is the dummy character to replace in the PCF vectors l l I I l nt Ma t a data l Program Section contains VCL and PCF statements pct Waal 4 0 M 0 bri u end pcf repeat 185 times execute Null_bit end repeat PCF aw Wan Wag Wan WAAN W447 sl end pcf repeat 185 limes execute Null bit FIG 6B 4 967 412 1 SERIAL DATA FRAME GENERATOR FOR TESTING TELECOMMUNICATIONS CIRCUITS BACKGROUND OF THE INVENTION The disclosed invention relates generally to the field of circuit board testing and more specifically to the art of testing telecommunications circuit boards Gener ally a given circuit board consists of numerous semi conductor chips such as a microprocessor memory chips counter chips control chips etc laid out accord ing to some interactive design Following design and layout of the circuit board it is necessary to test the board to ensure that all the chips as laid out perform as expected Testing will involve application of test vec tors to pins of a given chip or cluster of chips on the board A test vector for a given chip or cluster of chips generally consists of a binary word having an input portion and an outp
149. ose the output file 1 assign FilePtr Error to subend sub GetBitsMSB Value Number of bits Buffer representation to the output file as part of a frame representation to the output file as part of a frame Get the lower sixteen bits of each element of the Channel2 array LSB gt MSB 4 967 412 133 2 134 This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the lt Number of bits gt parameter Note If the lt Value gt parameter is greater than the 2 s complement range for the lt Number of bits gt parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS nn ___ no global outputs are exported ui 2 no global inputs are imported Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range i 16 Buffer String parameter to which the boolean representation is appended a pae x x lt x ite in i ce i a SS i ae a am ma aaa
150. ow reopen it file pointer will point to the first line assign Ffile Error to Glb_ffile_name if Error lt gt 0 then call Abort Could not assign format file Error end if Line ptr 1 Repl ptr 0 Advance the file pointer to the start of the program block loop 4 967 412 219 220 exit if Line_ptr Glb_start_line Dummy w enter Ffile Error Dummy if Error lt gt 0 then call Abort Error reading format file Error Line_ptr Line_ptr 1 end loop The line pointer is now be pointing to the first line of the program block of the format file loop This inner loop reads lines from the format file program block if the line read is a replacement line determined by the linked list of replacement lines the replace frame routine is called Otherwise the line is simply copied to the output file This loop will exit if any of the data files run out of data the replace frame routine returns a code of 2 or 3 or when end of file is encountered om Ffile line anter Gjydlo Vlror ride snae it Error lt gt 0 and Error lt gt End of file then call Abort Error reading format file Error end if exit if Error End_of_file if Line_ptr Glb_repl_lines Repl_ptr then 1 this is a replacement line so call the frame replace routine call PCF repl frame Repl ptr Ffile line Repl ptr Repl ptr 1 mod Glb max repl 35 else not a replacement line so write it to the o
151. pl line num The Format File line number of the current Ffile line Repl flag line being processed This parameter is used by the PCF scan routine The Format File line to be scanned This must pe a non blank line The replace flag If this parameter is 1 and the line being scanned is a replacement line the replacement characters and their PCF column addresses will be stored into the Glb repl chars and Glb PCF cols arrays If the parameter is 0 the replacement characters will be compared to the present values in the arrays I I 1 1 1 1 I I l 1 i 1 t i I i t 1 1 l I l I 195 POTIS 196 OUTPUTS none GLOBAL VARIABLES USED s lt s om em o pm Glb PCFGEN chars The sequence of characters that are reserved to indicate a PCFGEN command The sequence must immediately follow a ea eaa nme a ea thactwchev fs ld C PC we ANT Yaw recognized as the command sequence Glb_repl_chars The current set of valid replacement characters Glb PCF cols The PCF column associated with each replacement character Glb line type The type of line the scanner has found Glb PCFGEN comm The PCFGEN single character command found by the scanner Glb_PCFGEN_paraml The first PCFGEN parameter found by the scanner Glb_PCFGEN_param2 The second PCFGEN parameter found by the scanner
152. program block 4 967 412 217 218 Glb_repl_error_code The error status returned by the PCF_repl frame routine End o file The end of file error code e a i ce o e em om om sub Code_gen global Glb ffile name Glb outfile name global Ffile GOutfile global Glb repl lines True False global Glb start line Glb repl error code End of file Glb max repl dim Dummy 80 Close the input file so that it may be re opended Opening the file will set the line pointer to the beginning assign Ffile Error to if Error then call Abort Error closing Format file Error end if f assign Ffile Error to Glb ffile name if Error then call Abort Error opening Format File Error ene if Copy the header block to the output file for Line ptr 1 to Glb start line 1 Templine enter Ffile Error Templine if Error lt gt 0 then call Abort Error reading format file Error end if i output Outfile Error Templine if Error lt gt 0 then call Abort Error writing to output file Error a end if next Line_ptr Q Now process the program block loop This outer loop continues until all data from the master data file has been used PCF_repl frame returns a code 1 or until one of the data files runs out of data code of 2 or 3 close the format file assign Ffile Error to if Error lt gt 0 then call Abort Could not un assign format file Error end if 1 N
153. qr 2 for A_LAW Phase 0 s SampFrequency 8000 call Tone VRMS Frequency Phase SampFrequency LEN TempCHl call A_law LEN TempCHi tranfer to appropriate row of channel array for I 0 to LEN 1 CH 0 I TempCH1 I next I 1 Be sure to merge TONE and A LAW at end of test t 1 111111111111111111 1111111111 EXAMPLE 111111111111111111111J111 11111 Retrieve channels 2 through 30 data from files dim TempArray 1000 Dimensioned to MAX LEN elements print for Channel 2 to 30 FileName ch30 data amp val Channel 4 967 412 43 44 print Retrieving channel val Channel field data from FileName call ReadArray FileName LEN TempArray for I 0 to LEN 1 CH Channel 1 I TempArray I next I next Channel print 1111111 111 11111111111111 1111 EXAMPLE 11111111111111111111 11111111111 b r Retrieve CONTROL field data from a text file 1 print FileName ch30 ctrl print Retrieving CONTROL field data from rFileName call ReadArray FileName LEN CTRL print 151131331111120125312312111312111 EXAMPL E 11111111111111111111111111111111 Retrieve SIGNAL field data from a text file print FileName ch30 sigl print Retrieving SIGNAL field data from FileName call ReadArray FileName LEN SIGL print call Generate 30ch ch30 file LEN CH CTRL SIGL print print FRAME GENERATOR SUCCESSFU
154. rameter out of range eise for all the elements in the array for IND 0 to LENGTH 1 truncate value to closest magnitude TEMP int abs X IND check value against the limit if TEMP 4095 then TEMP 4095 END 32 LEND 0 INTVSZ 2 SEG 0 1 loop initialize to segment 0 parameters loop to locate segement Rev 3 0 4 967 412 167 168 exit if SEG 8 1 failsafe exit since 2 7 32 4096 check if correct segment to exit exit if TEMP lt END adjust segment parameters LEND END END END 2 1 every segement but seg 1 doubles in size if SEG gt O then INTVSZ INTVSZ 2 SEG SEG 1 end loop compute displacement into segment LEND code lower 7 bits ALAW 16 SEG TEMP div INTVSZ check sign bit correction if X IND gt 0 then ALAW ALAW 128 invert alternate Hits X IND bineor ALAW 85 next IND TEMP TEMP end if subend A law Cb Ee nee ERE RE RRR G AE CRE RRR ETE RES CORRE TRE RO eS e sub MU LAW LENGTH X file pathname telecom gen mu law Rev 3 0 This routine will take the real values passed in by the array X and convert them to a non uniform encoding via the MU law The elements of the array are expected to be in the range 8159 8159 Any element outside this range will be treated as the closest boundary value LENGTH is the number of elements in the array which are to be converted This routine will produc
155. rial frames conforming to a given protocol N is an integer Depending upon the protocol Data Generator 200 will obtain framing data either by reading data from the appropriate user written Data File s and or by execut ing the appropriate DG C routine s Recall that the user written Data File s and the DG C routine s re side in memory structure 210 of FIG 4 Typically the protocols which will require user written Data Files are the following X 25 HDLC RS232 and the ISDN S Bus CCITT L430 Typically the protocols which will have one or more DG C routine are the following 1 channel 24 channel and 30 channel T1 protocols and the Siemens IOM and SLD protocols There is also a ninth option the preferred embodiment of the present invention provides a template whereby the user can write his her own protocol framing subroutine Given N the user r quested number of serial frames and the o user s choice of protocol for the frames data is generated by Data Generator 200 and an appropriate protocol implementation program of Data Generator 200 and Frame Generator 250 is called In the preferred embodiment of the present invention the implementa tion programs are written in the BT BASIC program ming language although essentially any programming language could be used The BT BASIC code imple mentation of Data Generator 200 and Frame Generator 250 for each protocol including a user definable tem plate is listed in Append
156. rnary format Bits are always converted MSB Most Significant Bit to LSB Least Significant Bit The LowZero parameter represents the current zero value with TRUE lower than zero and FALSE higher than zero voltage potential GLOBAL OUTPUTS WH _ no global outputs are exported GLOBAL INPUTS 2 re no global inputs are imported SUBROUTINE PARAMETERS Value Integer parameter Range 32768 32767 cpu of bite sss Siglo ot the boolean reprasantacton lt tbe intager parameter kanga J 16 TRUE LowZero Boolean parameters representing the coding of the next zero parameter TRUE lower than zero FALSE higher than zero NumZeros Integer parameter to count the number of zeros boolean value 0 in the Value parameter Buffl First string parameter to which the boolean representation is appended I ae Buff2 Second string parameter to which the boolean representation is appended if Value 32768 or Value 32767 then call FGen Error GetBitsSBUS Value 32768 or Value 32767 end if if Number of bits 1 or Number of bits 16 then call FGen Error GetBitsSBUS Number of bits lt 1 or Number of bits 16 end if vt Tuy if LowZero 0 or LowZero 1 then MN call FGen Error GetBitsSBUS LowZero 0 or LowZero gt l end if 4 967 412 153 154 The Bl or B2 field are always an octet 8 bits Hh ew ee or I
157. ror to Dfile2 Error to Dfile3 Error to Dfile4 Error to Dfile5 Error to Dfile6 Error to Dfile7 Error to Dfile8 Error to Dfile9 Error to Dfilel0 Error to Dfilell Error to Dfile1l2 Error to Dfilel3 Error to Dfilel4 Error to Dfilel5 Error to Dfilel6 Error to assign assign assign assign assign assign assign assign assign assign assign assign assign assign assign assign assign assign Fo b OOO 97 OR subend We claim 1 In a circuit board tester a data frame generator for generating data frames for use in testing telecommuni cations circuits and other circuit devices which require data which must conform to a user selected data frame protocol said generator comprising computing means incorporated in said circuit board tester for controlling the operation of said genera tor i l x data generation means for generating user specified input information data framing means for inserting said user specified input information into data frames which conform to a user selected protocol data sequence generation means for generating data sequences from said data frames which data sequences are executable by said computing means 2 In a circuit board tester a data frame generator for generating data frames for use in testing telecommuni cations circuits and other circuit devices which require data which must conform to a user selected data frame protocol said generator comprising
158. routines are written in an open systems manner so that the user can customize an original DG C to produce a particular kind of data The second major step of generating the serial frames from the digital data is also performed by the Serial Frame Generator In addition to the Data Generator and DG C routines the Serial Frame Generator in cludes a Frame Generator The Frame Generator con verts the data produced by the Data Generator into serial frames which obey a user selected telecommuni cations protocol Among the framing options available to the user are 1 channel 24 channel and 32 channel T1 frames X 25 HDLC frames ISDN frames and vari ous Siemens frames See the 1987 Siemens Telecommu nications Data Book In addition the Frame Generator is also written in an open systems manner so that the user can add framing options Output from the Frame Generator is stored in a so called Frame Data File The third and final major step of generating the cir cuit board test data from the serial frames is performed by a Pattern Capture Format PCF Generator PCF is explained in Chapter 7 of the HP 3065 X L user s man ual Vol HI Advanced Technologies Testing Reference and Syntax The PCF Generator has two input files the Frame Data File and a so called Format File As noted the Frame Data File is the output of the Frame Genera tor The Format File is a user written file containing executable VCL code together with instructions for
159. rr_num then if the Err num is not 0 then print the system error message print errm Err num end if print print PCFGEN aborted stop f subend 4 967 412 tn fi v H o E ct po 3 0 z w n 3 P Q OUTPUTS none GLOBAL VARIABLES USED none 1 OPERATION 1 This routine prints a warning message and then returns control to the calling routine Bt a a a a a e INPUTS I Warn_msg The string to be displayed as the warning l sub Warning Warn_msg print print WARNING print Warn_msg print i subend This subroutine will close all files used in the PCFGEN program and should be called before terminating execution If an error occurs here a message will be printed and the program will be stopped a INPUTS none ar OUTPUTS none GLOBAL VARIABLES USED Dfilel Dfile1l6 The at names of the 16 possible data files Ffile The at name of the Format File outfile The at name of the output file File not assigned The file not assigned error code sub Close files global File not assigned global Ffile 0utfile global Dfilel Dfile2 Dfile3 GDfile4 global Dfile5 GDfileo Dfile7 Dfiles global Dfile9 DfilelO Dfilell Dfilel2 global Dfilel3 Dfilel4 Dfilel5 Dfilel6 i 4 967 412 239 Ffile Error to Outfile Error to Dfilel Er
160. rror message from the Err msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS DEN irr EE E MERE no global outputs are exported HHO eee no global inputs are imported Err msg String variable containing error message This message is sent to the printer device dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node status Default output Error Opened Type if Type Device then assign Output error Error to Default output write shared 4 967 412 39 40 if not Error and Type Device then output Output_error Err_msg else printer is print The default error reporting device for FGen_Error is not available print the printer destination has been reset to the CRT print Err_msg end if stop subend TABLE OF CONTENTS APPENDIX D PCFEN Code gen PARSE_FFILE 15 PCF_REPL_FRAME SCAN_FFILE_LINE GET_CHAR PCFCOM_SCAN READ_LINE PCF_SCAN ABORT COMM_PROC Warning ASSIGN_DFILE 20 CLOSE_FILES 111111 11111 11 1111111 111 1 1111 111 1 111111111111111 11111111111111111111111 111 naro 1111 EES MERGE USER SUBROUTINES HERE 1111 1111 111 n TIT 1311111111111111111111311111111111111111111111111111111111111111111111111111111i TELECOM GEN FRAME 30CH Rev 3 0 FRAME GENERATOR for the CEPT 30 channel
161. rted GLOBAL INPUTS un no global inputs are imported SUBROUTINE PARAMETERS i Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended if Number of bits 1 or Number of bits 16 then call FGen Error GetBitsLSB Number of bits 1 or Number of bits 16 end if Aes if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsLSB Value 32768 or Value gt 32767 end if for I 0 to Number of bits 1 Buffer Buffer amp val bit Value I next I subend sub ReadArray FileName Length Array This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped 4 967 412 93 94 GLOBAL OUTPUTS Mis hantua no global outputs are exported GLOBAL INPUTS WH __ no global inputs are imported SUBROUTINE PARAMETERS FileName A string the containing file pathname of the file to be read into the Array parameter Length The number of integers to be read into the Array parameter Range 1 32766 Array Array id The in
162. s the next input boolean value GLOBAL OUTPUTS ul sssioesissesa no global outputs are exported _ no global inputs are imported Ibit Boolean parameter Range 0 1 Checksum Integer parameter Range 32768 32767 The generating polynomial x16 x12 x5 1 if Ibit 0 or Ibit gt 1 then call FGen Error CRC Ibit lt 0 or IBit gt 1 end if if Checksum 32768 or Checksum 32767 then call FGen Error CRC Checksum lt 32768 or Checksum gt 32767 end if bit Checksum 15 HighBit X12 HighBit exor bit Checksum 11 X5 HighBit exor bit Checksum 4 X0 HighBit exor Ibit 4 967 412 69 70 Checksum shift Checksum 1 call SetBit Checksum 12 e call SetBit Checksum 5 5 call SetBit Checksum 0 O0 subend Bub SetBit Value BitPosition Sbit C ente De se co ee a T a TT Se ry r amas This routine sets a bit position within an integer variable to the lt Sbit gt value 0 or 1 GLOBAL OUTPUTS uU no global outputs are exported un no global inputs are imported Value Integer parameter Range 32768 32767 BitPosition Position of the bit to be set Range 0 15 Sbit Set the bit in Value at Bitposition to the boolean value in lt Sbit gt ee M
163. ssage is sent to the printer device dim Default output 80 Default output dev crt amp crt Device 4 status value of an HFS device node status Default output Error Opened Type if Type Device then assign Output_error Error to Default output write shared if not Error and Type Device then output 8Output error Err msg 4 967 412 127 128 else printer is print The default error reporting device for FGen_Error is not available print the printer destination has been reset to the CRT print Err_msg end if stop subend 11111111111111 1111111111 1111111111111 11111 11111111 11111111111111111111111111 LU LILI 111 MERGE USER SUBROUTINES H i RE 11 14st 111 iat LEL 1111111111111 1111111111111111 11 1 111111111 11111111111111111111111111111111111 TELECOM GEN FRAME TEMPLATE Rev 3 0 o sm 9 P ay Frame Generator Template Copyright Hewlett Packard 1987 All Rights Reserved k k k lt k k k ke k k k k k k k kk k k k k k k k k k k k k k k kk kk kok k k k k k R k k kk kk kkk k kkk k dek kk kk kk kk kk kk kk kk kk k n ir e uno To add other DSP subroutines simply type in the following BTBasic commands at the command line edit 9999 This places the edit cursor at the last line merge file id Merge the file id source at the current edit line This program is meant to be modified by the user BEFORE it is executed The first half of this program consists o
164. st 0 4 0 0 5 0 e 4 0 0 4 a a e SS SES SSA SO SS SS 9 Sd 4 967 412 115 116 sub Generate sld FileName Length First CHA CHB Control Signal This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program execution will stop A SLD Frame is shown below Each data field such as CH A consists of eight bits MSB first LSB last Also each frame half is actually sent to the PCF generator as a complete frame ASCII 0 s and 1 s followed by a character This allows the user to change the direction line DIR on the Siemens 2060 in the format file pcf vectors GLOBAL OUTPUTS WN e no global outputs are exported GLOBAL INPUTS on 222 2 no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output file ps Length The number of frames to be a Range 1 MAX LEN First Boolean 0 1 that determines which half frame will contain the transmitted field data This frame generator will only generate the transmit half frame The receive half frame will always be receive don t cares Z CHA Array id parameter containing channel A field data Each element is sent in its boolean representation to the ou
165. subend OPERATION 1 The PCFGEN command scanner accepts a PCFGEN command line as input and attempts to find valid command and parameter syntax If the syntax is correct see routine Scan_ffile_line or manuals PCFcom_scan will place the command and parameters into the global variables Glb PCFGEN comm Glb PCFGEN paraml and Glb PCFGEN param2 t 1 INPUTS PCFcom_line The PCFGEN command line to be scanned OUTPUTS none GLOBAL VARIABLES USED Glb PCFGEN comm Glb PCFGEN paraml Glb PCFGEN param2 The PCFGEN command and parameters found by PCFcom scan Glb PCFGEN chars The PCFGEN command characters Glb line type The global variable that tells the parser what type of line has been E found e ee em oom e e are om em om die oome ome sam I Mem om i sub PCFcom_scan PCFcom_line 4 967 412 190 f 200 PBCFGSU Canas lO uctcmlno Gib Pes global Glb PCFGEN hares Gls_iine types True False len PCFcom_line Find the length of the input line len Glb_PCFGEN_chars Find the length of the PCFGEN command sequence Line_len Comm len search for the single character PCFGEN command Column 1 Comm len Start looking right after comm sequence loop Loop until end of line or first non blank character Column Column 1 if Column gt Line len then We have scanned the entire line call Abort PCFGEN command
166. ta is generated from dsp subroutines tone and mu_law print input Enter the tone frequency Hz to be generated Frequency 1 use rms value to produce full range 1 VRMS Phase SampFrequency 8000 call Tone VRMS Frequency Phase SampFrequency LEN CH call MU_law LEN CH 1 H HH 8159 sqr 2 for MU_LAW 0 be sure to merge TONE and MU LAW at end of test call Generate 1ch chl file LEN CH print print FRAME GENERATOR SUCCESSFULLY COMPLETED end main program p c eni LM EE itii PROGRAM SUBROUTINES pra 1111 o s e esas a aen pno eee eee 4 A a s o 5 A E CS e e e Ss e e Se 0 0 e SS 0 0 4 t This routine will open the output file generate the framed field data output the framed data to the output file and close the output file Any fatal error encountered will be reported and program 1 t i execution will stop This subroutine reproduces a single time slot of bit data for a pom ii data stream Each time siot consists of eight boolean values MSB 2LSB The other bits required for a compiete pcm frame are to be provided by tne uses nese Irame stuffing bits may be provided by VCL vectors in the PCF format file used by the PCF Generator or by the users VCL digital program eme ec ELLE 4 967 412 13 14 For example if Length 4 and the Channel array is filled with the follow
167. tation of an integer parameter to the current printer device The boolean values are printed from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the Number of bits parameter GLOBAL OUTPUTS it no global outputs are exported GLOBAL INPUTS MIL deeem mu no global inputs are imported SUBROUTINE PARAMETERS Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 if Number_of_bits lt 1 or Number of bits 16 then call FGen Error PrintBits Number of bits 1 or Number of bits 16 end if mE 88 or Value gt 32767 then if Value 32 mall beet rear rnt lts Values 32768 or Value sl a eno ii Buffer for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I print Value Buffer subend sub FGen Error Err msg This routine reports an error message from the Err msg string parameter and stops program execution This routine attempts to report the error on the printer device and if this is not possible the printer device is reset to the CRT and the error is reported GLOBAL OUTPUTS l ul Op r no global outputs are exported GLOBAL INPUTS WI no global inputs are imported SUBROUTINE PARAMETERS Err_
168. teger values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 e em tm bm ad eame eme ni NO_ERROR 0 EOF 101007 FILE_NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign File Error to FileName if Error lt gt NO_ERROR then call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error 7 ve 1T ofa if for Index to Length 1 enter File Error Array Index if Error lt gt NO_ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileName amp else N call FGen_Error ReadArray FILE ERROR amp FileName 5 amp errm Error end if end if next Index subend This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist the file is created If any other file error occurs the error is reported to the CRI and program execution stops GLOBAL OUTPUTS MN O SaaS ee no global outputs are exported GLOBAL INPUTS UO ane eee no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output text file
169. the error is reported to the CRT and program execution stops GLOBAL OUTPUTS Hit ____ no global outputs are exported GLOBAL INPUTS WH L22222 no global inputs are imported SUBROUTINE PARAMETERS FileName A string containing the file pathname of the output text fiie sm a i E i v eee FilePtr The Q file pointer If the file is cpened this pointer may be used by output statements to write data to the file ro aet a t n NO I P um us eS OS SS M oN OD OD NO ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 et assign FilePtr Error to FileName write new if Error NO ERROR then if Error FILE EXISTS then print S print The file FileName already exists print Do you want to write over this file yes or no input Answer if lwc Answer 1 1 y then assign FilePtr Error to FileName write if Error lt gt NO ERROR then call FGen Error OpenFile FILE ERROR amp FileNameS amp amp errm Error end if else don t want to write over file call FGen Error OpenFile USER STOPPED PROGRAM end if else file error of some sort call FGen Error OpenFile FILE ERROR amp FileName amp amp errm Error end if end if subend sub PrintBits Value Number of bits a
170. the full frame values for one frame 29 30 mit necem no global inputs are imported SUBROUTINE PARAMETERS ie FileName A string containing the file pathname of the 1 output file i 1 Length The number of frames to be generated Range 1 MAX LEN 1 CH24 Array id parameter containing 24 channels of pcm t l 1 e lt __ m T e ee dim Buffer 80 call OpenFile FileName FilePtr FTbit 1 FSbit 0 FirstBit 0 for Frame 0 to Length 1 if Frame mod 2 0 then FirstBit FTbit FIbit not FTbit else FirstBit FSbit flip bit every sixth frame if Frame mod 6 5 then FSbit not FSbit ce end if Buffer call GetBitsMSB FirstBit 1 Buffers for Channel 0 to 23 call GetBitsMSB CH24 Channel Frame 8 Buffer i Output Buffer so that overflow will not occur t if Channel mod 8 0 then output FilePtr Buffer Buffer CANE end if next Channel The last frame of data ends with two characters if Frame Length 1 then outout ErilePtr BufferS else output FilePtr Buffers end if next FRAME I close the output file 1 assign FilePtr Error to subend 4 967 412 31 32 This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least sig
171. to have complete control and flexibility over data field values and how they are generated Each frame generator program is to 1 1 be used for a different frame format Ye a a a a m e e m e e e e e a m a m m m e m m e e e aa e e e e e e e e e m USER MODIFIABLE PARAMETERS n I 0 Scratch variable MAX LEN 1000 1 Maximum number of frames Same value used in g data field array dimensioning LEN 0 Default number of frames to generate dim CH 29 1000 Chafihel field array dim CTRL 1000 1 Control field array dim SIGL 1000 Signal field array princ usang Fe print CEPT 30 Channel FRAME GENERATOR print loop input Enter number of frames to be NOT LEN exit if LEN 1 and LEN MAX LEN print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop Lea k lt k k k k k k k k k k k k k k k k k k k k k k k k k k k k RE kkhk KERR k k k khkk kkk kk kak kk R ek R k k kk k k k Retrieve Generate field data for frame s k k kk k lt x k k k k k k KEKE k k k k k k k k k k k k k k k k k k K KR K R Kk k Ok k k k k k k kk k kk k kk kok k k kk kk k k 11111111111111111111111111111 EXAMPLE LI a eT We ee os seg oe i One channel of data is generated from dsp subroutines tone and a_law 1 2 dim TempCH1 1000 Dimensioned to MAX LEN print input Enter the tone frequency Hz to be generated Frequency use rms value to produce full range 1 VRMS 4096 s
172. to the Array parameter Range 1 32766 Array Array id The integer values read from the file are returned in this parameter The array must be dimensioned prior to calling this subroutine The array must be a single 1 dimensioned array The array indices are assumed to start at zero 0 and stop at Length 1 or greater than Length 1 em sm ddt i iii iii i ei cc e i e i o i e nn NO_ERROR 0 EOF 101007 FILE NOT FOUND 100009 WRONG FILE TYPE 101015 FILE NOT ASSIGNED 136 FILE EXISTS 275 assign File Error to FileName if Error lt gt NO_ERROR then call FGen Error ReadArray FILE ERROR amp FileNameS amp amp errm Error end if for Index 0 to Length 1 enter File Error Array Index if Error lt gt NO_ERROR then if Error EOF then call FGen Error ReadArray MORE DATA EXPECTED FROM amp FileName amp else call FGen Error ReadArray FILE ERROR amp FileName amp amp errm Error end if i end if next Index subend 1 This routine opens an ASCII text file for output If the file already exists the user is prompted for overwrite If the file does not exist 4 967 412 53 54 the file is created If any other file error occurs the error is reported to the CRT and program execution stops GLOBAL OUTPUTS uno _ no global outputs are exported T no global inputs are imported SUBROUTINE PARAMETERS FileN
173. tput file as part of the SLD frame The array is dimensioned as a single dimension array prior to calling this subroutine CHB Array id parameter containing channel B field data Each element is sent in its boolean representation to the output file as part of the SLD frame The array is dimensioned as a single dimension array prior to calling this subroutine Control Array id parameter containing CONTROL field data Each element is sent in its boolean representation to the output file as part of the SLD frame The array is dimensioned as a single dimension array prior to calling this subroutine Signal Array id parameter containing SIGNAL field data Each element is sent in its boolean representation to the output file as part of the SLD frame The array is dimensioned as a single dimension array prior to calling this subroutine eme em oae em pam Bam NP 4 967 412 117 118 dim Buffer 80 call OpenFile FileName FilePtr 1 Place the field data in the first half frame 1 if First then for Frame 0 to Length 1 Buffer call GetBitsMSB CHA Frame 8 Buffer call GetBitsMSB CHB Frame 8 Buffers call GetBitsMSB Control Frame 8 Buffer call GetBitsMSB Signal Frame 8 Buffer output FilePtr Buffer TRANSMIT t The last frame of data ends with two characters i if Frame Ie 1 then output 8FilePtr 22222222222222222222222222222222 RECEIVE else
174. type PCF repl There were replacements so check to make sure there were exactly the right number if Repl char num 1 Repl len then call Abort Incorrect number of replacement characters on line 0 end if end if subend OPERATION When a PCFGEN command is found in the Format File header this routine is called to take action on that command The only two commands currently defined are the Replace R and Master replace M commands The two commands are the same except that the Master replace assigns a value to Glb master repl char Both commands associate a file name with a replacement character Data file assignments are also made in numerical order i e the first replacement file is assigned to Dfilel the next to Dfile2 etc The replacement character symbols are put in order into the string Glb valid repl chars Gib repi cou feed te heap trad 4 ew any vVires charactoto have been used The command syntaxes are command paraml param2 M repl char repl file name R repl char repl file name INPUTS none OUTPUTS none GLOBAL VARIABLES USED Glb PCFGEN comm Glb PCFGEN paraml Glb PCFGEN param2 The PCFGEN command and parameters to be processed Glb repli count The current number of active replacement characters This variable must be initialized to zero once at the beginning of PCFGEN Glb valid PCFGEN comm The string containing all of the valid i single character PCFGEN c
175. ub GetBitsMSB Value Number of bits Buffer This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from MSB most significant bit to LSB least significant bit Example decimal value 23 00010111 if eight 8 bits are requested in the lt Number of bits gt parameter Note If the lt Value gt parameter is greater than the 2 s complement range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter GLOBAL OUTPUTS Wc lt no global outputs are exported e no global inputs are imported e dd Wik dn i i ba de ttt 4 967 412 103 104 SUBROUTINE PARAMETERS I 1 I Value Integer parameter Range 32768 32767 1 D Number of bits Size of the boolean representation of the l integer parameter Range 1 16 a 1 Buffer String parameter to which the boolean representation is appended if Number of bits 1 or Numbef of bits 16 then call FGen Error GetBitsMSB Number of bits lt 1 or Number of bits gt 16 end if if Value 32768 or Value 32767 then call FGen Error GetBitsMSB Value 32768 or Value gt 32767 end if for I Number of bits 1 to 0 step 1 Buffer Buffer amp val bit Value I next I subend sub GetBitsLSB Va
176. ubroutine This allows the user to have complete control and flexibility over data field values and how they are generated Each frame generator program is to be used for a different frame format s a d Scratch variable f MAX LEN 1000 Maximum number of frames Same value used in 1 data field array dimensioning 4 967 412 25 26 LEN 0 Default number of frames to generate dim CH 23 1000 Channel field array print using e print 24 CHANNEL FRAME GENERATOR print print x loop input Enter number of frames to be generated LEN exit if LEN 1 and LEN HE print VALUE OUT OF RANGE RANGE 1 MAX LEN RETRY end loop IIOCUEUCOEEIODODOUORIUOCONICIODIOCIOOOROIPAGOUIOOOAAOIOECIGIGGI DIOEROUUICRGGENCIOUIOIGOR UOORUPOUIOOUOUN RA ADI Retrieve Generate field data for frame s I RRRERKRERERERRER EERE REREREEEER EERE RE REE RE ARE RAEE RE RAEE RE RE RE eie ee eoe eie FILTIIIFETELETILPIPREITERETETESI EXAMPLE SITETTIILIETIIIILTIEFRPEEBISHEIE Bess 0 dd HBA AM F LI 00080 0 0 e ass 0 000 0 0 6 00 000 Channel 1 data is generated from dsp subroutines tone and mu law dim TempCH1 1000 Temporary array for channelf1 data Dimensioned to MAX LEN elements print input Enter the tone frequency Hz to be generated Frequency use rms value to produce full range VRMS 8159 sqr 2 for MU LAW Phase 0 Samp
177. ut portion The goal in testing is to determine if the application of the input portion of a test vector produces an output matching the output portion of the test vector If there is a match the test is successful pass Unsuccessful tests failure indicate defective board design defective layout or defective chips Test vectors will be supplied by the designer of the circuit board usually with the aid of a computer aided design CAD system The test vec tors will be chosen so as to pinpoint problems on the board if they exist Actual circuit board testing is performed with the aid of a circuit board testing machine Circuit board testing machines are well known in the prior art For example a well known circuit board testing machine is the Hewl ett Packard Company model HP 3065 circuit board tester The HP 3065 for instance has 264 pins which can be simultaneously selectively connected to various pins of a given circuit board for application of test vec tors to the board and the monitoring of board output generated in response The HP 3065 is fully described in the October 1984 issue of the Hewlett Packard Journal With the aid of a circuit board tester whole sequences of test vectors are applied to the board under test In fact it is not uncommon for test vector listings to be thousands of test vectors long where each test vector is dozens of bits in width Typically such test vectors are applied sequentially one test vector
178. ut into the lt Buffers gt string parameter GLOBAL OUTPUTS WN no global outputs are exported GLOBAL INPUTS UHO no global inputs are imported SUBROUTINE PARAMETERS Value RARI Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 s om due pm Quo aom am om den pue bum Omm dd am tm e pme te 7 412 121 29 122 Buffer String parameter to which the boolean representation is appended veder ta if Number of bits 1 or Number of bits gt 16 then call FGen Error GetBitsLSB Number of bits 1 or Number of bits gt 16 end if if Value lt 32768 or Value gt 32767 then call FGen Error GetBitsLSB Value 32768 or Value gt 32767 end if for I 0 to Number of bits 1 5 Buffer Buffer amp val bit Value I next I subend pub ReadArray FileName Length Array This routine reads an ASCII text file of integer data one integer per line into an array Any errors found during file access are reported and the program execution is stopped If the file does not contain Length number of integers an error occurs and program execution is stopped GLOBAL OUTPUTS jf no global outputs are exported GLOBAL INPUTS UN no global inputs are imported SUBROUTINE PARAMETERS FileName A string the cont
179. utput file output outfile Error Ffile_line a if Error then call Abort Error writing to output file Error end if Line ptr Line ptr 1 exit if Glb repl error code 2 or Glb repl error code 3 end loop If all data from the data files has been used then exit exit if Glb repl error code lt gt 0 Otherwise there is data left and we are at format file EOF so repeat loop end loop When we get here we are out of data file data either the master data file has run out right at the end of a pass through the format file or the master data file has run out of data before the end of the format file or one of the other data files has run out of data if Glb repl error code 2 then A data file has run out of data call Abort Data file does not contain enough bits 0 end if if Glb repl error code 3 then j 1 A data file has too much data with respect to the master file This is a warning rather than an error a call Warning All data files do not contain the same number of bits end if subend 4 967 412 SUBROUTINE PCF REPL FRAME a i I II I l I I i I 1 1 I II j I I I i l I I II I I I i I I I I I I i I I I i I I I I I I I I I I I II II I I I i I II i OPERATION This routine will access each of the data replacement files and attempt to build a line of PCF to write to ione
180. uts are exported d GLOBAL INPUTS n meena no global inputs are imported SUBROUTINE PARAMETERS l Value Integer parameter Range 32768 32767 Number of bits Size of the boolean representation of the integer parameter Range 1 16 Buffer String parameter to which the boolean representation is appended am a s om o em t b m o om b 0mo oma oae o o e e i 6an o o s et e if Number_of_bits lt 1 or Number_of_bits gt 16 then call FGen_Error GetBitsMSB Number of bits 1 or Number of bits 16 end if LS if Value 32768 or Value 32767 then call FGen Error GetBitsMSB Value 32768 or Value gt 32767 end if for I Number of bits 1 to 0 step l gt Buffer Buffer amp val bit Value I next I subend 4 967 412 157 158 This routine retrieves the boolean representation of an integer parameter and appends it to a string parameter The boolean values are stripped from LSB least significant bit to MSB most significant bit Example decimal value 23 11101000 if eight 8 bits are requested in the Number of bits parameter Note If the lt Value gt parameter is greater than the 2 s complement 1 range for the Number of bits parameter requested the extra bits withing the Value parameter are ignored and not put into the lt Buffer gt string parameter pia E GLOBAL OUTPUTS t fols nm

Download Pdf Manuals

image

Related Search

Related Contents

  Newsletter #2    Avaya Business Communications Manager 200/400 (BCM 200/400) User's Manual  Manuale d`uso retroauricolari  Chief FHSVB flat panel ceiling mount  Garmin nuvi 57 Owner's Manual    Philips CD Radio Cassette Recorder AZ 1030 User's Manual  Manipulation de la valve économiseuse Easypulse5  

Copyright © All rights reserved.
Failed to retrieve file