Specifications
4-4
Transferring USER Patterns over HP-IB
Pattern Upload/Download Example
630 OUTPUT Ed USING “#,K”;“SENSE1:PATT:UPAT0:DATA ”&Header$
640 Rowno=0
650 Rowbyteno=0
660 FOR Byteno=0 TO Upatbytelen-1
670 OUTPUT Ed USING “#,B”;Upat(Rowno,Rowbyteno)
680 IF (Rowbyteno>=SQRT(Upatbytelen)) THEN
690 Rowno=Rowno+1
700 Rowbyteno=0
710 DISP “Downloaded”;INT(100*(Rowno/SQRT(Upatbytelen)));“% of pattern”
720 ELSE
730 Rowbyteno=Rowbyteno+1
740 END IF
750 NEXT Byteno
760 DISP “Pattern Downloaded to Error Detector”
770 RETURN
780 END
Some General Hints
1. See pages 5-3 to 5-10 of this Programming Manual (71600-90016). These explain the
commands and data formatting used for transferring patterns to and from the Pattern
Generator and Error Detector.
2. PatternDATAisstoredinbinaryNOT ASCII in the Pattern Generator and Error
Detector.
3. The uploaded (and downloaded) pattern includes a Header string as follows:
#ABBBDDDD..., where:
# is the ASCII character which defines the start of the Header.
A is an integer (in the range 1 to 9) whose value is the number of B characters.
BBB is the value of the pattern length in bits.
DDD... is the BINARY data of the pattern.
So an uploaded (downloaded) pattern 32768 bits long would look like:
#532768DDDDDD...
4. When uploading patterns from UPAT0 (the edit buffer in the PG or ED), the data
should be read into an Array. See lines 440 to 470 in the IBASIC example, specifically
line 440.
NOTE A two-dimensional array is used in this example, this makes displaying
the data easier. Also in some programming languages/computers it
may be necessary to use more than one dimension due to pattern size
(up to 8 Mbits or 1Mbytes) due to memory limitations.
5. PACK 8 format saves memory and is quicker to load/save.