671200 bsp.book

Model 4994A Option 120 User’s Guide
Pa g e 1
USER’S GUIDE
MODEL 4994A OPTION 120
Linux Board Support Package
for the Pentek Bandit® Model 7120
2−Channel Analog RF I/Q Demodulator
Version 1.0 Beta
Installation and Getting Started Guide
Pentek, Inc.
One Park Way
Upper Saddle River, NJ 07458
(201) 818−5900
http://www.pentek.com/
Copyright © 2014
Manual Part Number: 816.71200
Rev: 1.0 − October 9, 2014
Page 2
Mo d e l 49 9 4 A O p t i o n 12 0 U s e r ’ s G u i d e
Manual Revision History
Date
Revision
10/9/14
1.0
Comments
Initial publication
Software License Agreement
Pentek grants to you a non−exclusive, non−transferable license to use the object code, source code, example programs and
related documentation in this package ("Licensed Materials") on a single−user computer for development of executable
runtime code for Pentek products. All Licensed Materials received under a single ReadyFlow "Subscription" may not be
used on more than one computer at the same time or otherwise network the Licensed Materials. Title of the Licensed
Materials is not transferred to you by this license. Any sub−license, assignment, or other transfer of the Licensed Materials
or the rights or obligations of this agreement without prior consent of Pentek is prohibited. Executable runtime code
generated through the proper use of the Licensed Materials for execution on Pentek products is not subject to, or restricted
by this agreement.
Software Limitations
Pentek does not warrant that this software will be free from error or meet your specific requirements. You assume
complete responsibility for decisions made or actions taken based on information obtained using the programs. Any
statements made concerning the utility of the programs are not to be construed as expressed or implied warranties. Pentek
makes no warranty, either expressed or implied, including but not limited to, any implied warranties of merchantability
and fitness for a particular purpose, regarding the programs and makes the programs available solely on an "AS IS" basis.
Pentek shall not be responsible for incidental or consequential damages.
Copyright
Copyright © 2014, Pentek, Inc. All Rights Reserved. Contents of this publication may not be reproduced in any form
without written permission.
Trademarks
Pentek, Bandit, GateFlow, and ReadyFlow are trademarks or registered trademarks of Pentek, Inc.
ARM is a registered trademark of ARM Holdings. Eclipse is a trademark of Eclipse Foundation. Fedora is a trademark of
Red Hat, Inc. Linux is a registered trademark of Linus B. Torvaids. Oracle is a registered trademark of Oracle Corporation.
POSIX is a registered trademark of the IEEE. Raspberry Pi is a registered trademark of Raspberry Pi Foundation.
Printed in the United States of America.
Model 4994A Option 120 User’s Guide
Pa g e 3
Table of Contents
Page
Chapter 1: Overview of ReadyFlow BSP
1.1
1.2
1.3
ReadyFlow Board Support Package for Linux .................................................................................5
Release Notes for Model 4994A−811 .................................................................................................6
Bug Fixes for Model 4994A−811 .........................................................................................................6
Chapter 2: Installing the ReadyFlow BSP
2.1
2.2
2.3
2.4
2.5
2.6
Installing ReadyFlow in Systems Running Linux ...........................................................................7
Installing the USB Device Driver........................................................................................................8
2.2.1
Installation Procedure ........................................................................................................8
2.2.2
Addressing Driver Incompatibility ..................................................................................9
2.2.3
Addressing an Issue with Compiling Example Code ...................................................9
ReadyFlow Library Directory Structure..........................................................................................10
ReadyFlow Example Programs ........................................................................................................11
Running the Example Programs ......................................................................................................12
Building the ReadyFlow Board Support Libraries ........................................................................14
2.6.1
Prebuilt Libraries and Components ...............................................................................14
2.6.2
Building the Library Using Make ...................................................................................14
2.6.3
Executing the Makefile ....................................................................................................14
Chapter 3: Using the ReadyFlow BSP
3.1
3.2
Introduction to ReadyFlow ...............................................................................................................15
Using ReadyFlow ...............................................................................................................................16
Chapter 4: Using the Attenuator Tables Initialization File
4.2
4.3
4.4
4.5
4.6
INI File Format and Location............................................................................................................19
Frequency Banks.................................................................................................................................21
Example of a Bank Definition ...........................................................................................................23
Module Initialization Values.............................................................................................................24
Example of the Module Initialization Section ................................................................................25
Rev.: 1.0
Page 4
Mo d e l 49 9 4 A O p t i o n 12 0 U s e r ’ s G u i d e
Table of Contents
Page
This page is intentionally blank
Rev.: 1.0
Model 4994A Option 120 User’s Guide
Page 5
Chapter 1: Overview of ReadyFlow BSP
1.1
ReadyFlow Board Support Package for Linux
The Model 4994A Option 120 ReadyFlow® Board Support Package (BSP) for Linux®
contains Linux software support for Pentek’s Bandit® Family Model 7120 2−channel
analog RF I/Q demodulator XMC module. This includes a Linux device driver for
Model 7120 and the ReadyFlow Board Support Library data structures and routines for
accessing the Model 7120 programmable resources.
This Linux BSP user’s guide is applicable to all options of the Model 7120 and contains
the following information:
 Chapter 2 − Instructions for installing the Model 7120 Linux device driver and
ReadyFlow Board Support Library
 Chapter 3 − A brief tutorial and examples on the use of Model 7120 ReadyFlow.
The Model 7120 ReadyFlow Board Support Library data structures and routines are
described in Pentek’s Model 7120 ReadyFlow Programmer’s Reference Guide, part
# 801.71200, which is available on the CD provided by Pentek, in file 80171200.pdf.
Rev. 1.0
Page 6
1.2
Model 4994A Option 120 User’s Guide
Release Notes for Model 4994A−811
Version 1.0 Beta − Pre−release
 The pre−release development environment for this software was Fedora® 14 Linux
2.6.35.
 This release was built using the Future Technology Devices International, Ltd.
(FTDI) device driver.
1.3
Bug Fixes for Model 4994A−811
Version 1.0 Beta − Pre−release; no known bugs
Rev. 1.0
Model 4994A Option 120 User’s Guide
Page 7
Chapter 2: Installing the ReadyFlow BSP
2.1
Installing ReadyFlow in Systems Running Linux
1) Create a directory to contain the ReadyFlow installation, and change to that directory:
mkdir ReadyFlow
cd ReadyFlow
2) Install the ReadyFlow package from the distribution CD:
tar -xvf cdrom_drive/4994A/71200/7120010B.tar
3) Define the ReadyFlow directory environment variable.
ReadyFlow uses the environment variable READYFLOW_7120_LINUX to determine the
location on the disk where the package has been installed. Add this environment
variable to the .login or .cshrc file located in your $HOME directory.
setenv READYFLOW_7120_LINUX $HOME/ReadyFlow/7120/linux/1.0
After adding the environment variable, be sure to log out and log back in to enable
any added variables.
4) Add the ReadyFlow library directory to the LD_LIBRARY_PATH environment variable:
a) For x86 processor boards:
%READYFLOW_7120_LINUX/x86/lib
b) For x86_64 processor boards:
%READYFLOW_7120_LINUX/x86_64/lib
Rev. 1.0
Page 8
2.2
Model 4994A Option 120 User’s Guide
Installing the USB Device Driver
The Model 7120 RF I/Q demodulator is programmed via the Universal Serial Bus
(USB), using a Future Technology Devices International, Ltd. (FTDI) FT2232H Hi−
Speed Dual USB UART/FIFO. The USB device driver used with this ReadyFlow
package was obtained from the Future Technology Device International, Ltd. website.
ReadyFlow for Model 7120 uses the FTDI D2XX driver to access this device. The
current FTDI driver version is v2.08.30. The driver files are found in /release/build/
ARCH − where ARCH is i386 or x86_64 when the corresponding Linux OS tar file
(libftd2xx1.1.12_x86.tar.gz or libftd2xx1.1.12_x86_64.tar.gz) has been extracted.
2.2.1
Installation Procedure
To install the driver from the system prompt, follow this procedure:
1) First untar the libftd2xx1.1.12_x86_64.tar.gz file bundled with the CD
into a directory of your choosing. Press Enter after you input each line, as
shown below:
gunzip libftd2xx1.1.12_x86_64.tar.gz <Enter>
tar –xvf libftd2xx1.1.12_x86_64.tar <Enter>
2) After the files have been extracted, change to the required architecture
subdirectory (i386 for 32−bit systems, x86_64 for 64−bit systems, and
arm926 for ARM® v5 systems such as Raspberry Pi®).
3) Copy and link all driver files using the Linux sudo command for root
permissions:
sudo cp /releases/build/x86_64/lib* /usr/local/lib <Enter>
4) Make the following symbolic links and permission modifications in /usr/
local/lib:
cd /usr/local/lib <Enter>
sudo ln –s libftd2xx.so.1.1.12 libftd2xx.so <Enter>
sudo chmod 0755 libftd2xx.so.1.1.12 <Enter>
5) From here, you can navigate into the ../examples directory and rebuild
and run the provided examples.
NOTE:
Rev. 1.0
You may have to append /usr/local/lib to your
LD_LIBRARY_PATH when executing the examples.
Model 4994A Option 120 User’s Guide
2.2
Page 9
Installing the USB Device Driver (continued)
2.2.2
Addressing Driver Incompatibility
In Linux, the VCP driver and D2XX driver are incompatible with each other.
When an FTDI device is plugged in, the VCP driver must be unloaded before
a D2XX application can be run. Use the remove module (rmmod) command to
do this as shown below:
sudo rmmod ftdi_sio <Enter>
sudo rmmod usbserial <Enter>
When the FTDI device is power cycled or reset the VCP driver will be
reloaded. The rmmod process must be repeated each time this occurs. It is
possible to write a simple script that unloads the VCP driver before running
the D2XX application.
2.2.3
Addressing an Issue with Compiling Example Code
This version of the D2xx driver was compiled using a newer version of GLIBC
2.14. On some systems, this may create issues with compiling the example
code. This problem may be exhibited on x86_64 bit systems. If you experience
a problem, please do the following:
1) Change directory (cd) to /usr/local/lib and remove all D2xx
components by typing the following:
rm -rf libftd*
<Enter>
2) Change directory to /ReadyFlow/7120/linux/1.0/x86_64/lib.
3) All driver files are copied and linked using the Linux sudo command for
root permissions.
sudo mv /ReadyFlow/7120/linux/1.0/x86_64/lib* /usr/local/lib <Enter>
4) Make the following symbolic links and permission modifications in /usr/
local/lib:
cd /usr/local/lib <Enter>
sudo ln –s libftd2xx.so.1.2.5 libftd2xx.so <Enter>
sudo chmod 0755 libftd2xx.so.1.2.5 <Enter>
Rev. 1.0
Page 10
2.3
Model 4994A Option 120 User’s Guide
ReadyFlow Library Directory Structure
The following directory structure is created under the ReadyFlow/7120/linux/X.Y direc−
tory (where X.Y is the ReadyFlow BSP version number).
Rev. 1.0
 source
− Source code for the libraries.
 include
− Include files for all the libraries.
 manuals
− PDF files describing data structures, macros, and 'C' callable
functions contained in the libraries.
(The latest version of the manuals can be obtained from the
Pentek website at www.pentek.com.)
 x86/examples
− Base directory for sample programs for x86 processor boards. A
readme file describes the examples and how to run them.
 x86/lib
− Pre−compiled 32−bit ReadyFlow libraries.
 x86_64/examples
− Base directory for sample programs for x86_64 processor boards.
A readme file describes the examples and how to run them.
 x86_64/lib
− Pre−compiled 64−bit ReadyFlow libraries
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
2.4
Pa ge 1 1
ReadyFlow Example Programs
Two example programs (7120initand 7120ctrl) are provided for demonstrating the
capabilities provided in the Model 7120 module.
•
The 7120init example program demonstrates connecting to and communicating with
Model 7120. It also provides a command−line interface allowing it to be used to
configure the 7120 and creates an initialization file that can be used by this and other
7120 programs.
•
The 7120ctrl example program demonstrates changing of tuning (local oscillator)
frequency and input sensitivity for either 7120 RF channel under program control.
Modified values or program parameters changed via command line arguments can
be saved to an initialization file.
Source code for the example programs plus additional support files are located in the
examples directory for each processor type (x86/examples and x86_64/examples ). A
readme.txt file describes the example program and explains how to build it.
The makefile provided has been tested with GNU and Oracle® Solaris make utilities. It
has been written to the POSIX® standard. Therefore, it should work with other make
utilities as well. Example programs are built using the GNU C compiler.
The makefile uses the following environment variables to determine the location of the
include files:
READYFLOW_7120_LINUX
7120 ReadyFlow base directory
(i.e. /home/ReadyFlow/7120/linux/1.0)
LD_LIBRARY_PATH
ld library search path
(i.e. /home/ReadyFlow/7120/linux/1.0/ARCH/lib)
where ARCH = x86 or x86_64
To build the example programs, the command line syntax is:
make 7120init
make 7120ctrl
NOTE:
Limitations on DMA buffer sizes vary between processor architectures
supported by Linux. In each example program, the buffer size parameter can
be adjusted as needed. This package uses a buffer size that can be allocated
reliably on most Linux architectures. On some platforms, the buffer size can
be increased to provide longer data transfers and less interrupts.
Rev. 1.0
Page 12
2.5
Model 4994A Option 120 User’s Guide
Running the Example Programs
To examine program operation, run the example executable using either gdb or another
debugging tool of your choosing. You can either rebuild or continue to run the exam−
ple, as desired. If you choose to rebuild, you should rebuild the libraries first. Failure
to do so will result in multiple warning messages when building an example, due to
lack of library object files containing debug information.
Example program setup and usage information is provided below for running the
example from the system command prompt, but is the same if run under a GUI−based
IDE such as the Eclipse™ IDE.
7120init −
Apply power to the 7120 via a cable to the POWER input on Model 7120.
Connect the 7120 to the host PC via the Micro USB connector on the 7120. 

On the host PC, execute the 7120init example program. The program
will set both RF channels in the module to a VCO frequency of 1000 MHz
and input sensitivity to −60dBm. Messages will be output to indicate
PLL lock and program parameters. An input signal may be applied to
either input and the I or Q output for either channel may be viewed on a
spectrum analyzer or oscilloscope. 

This program supports command−line arguments.
Syntax:
./7120init.out -ch1ena [state] -ch1freq [freq] -ch1sense [level]
-ch2ena [state] -ch2freq [freq] -ch2sense [level]
-refsrc [source] -reffreq [refclk]
Where:
state
= enable, disable
freq
= 35 to 4400 MHz, in Hz, 10 KHz steps
level
= 0 to −60
source = internal, external
refclk = 5 or 10 MHz, in Hz
Example: (using program defaults)
7120init -ch1ena enable -ch1freq 1000.0e6 -ch1sense -60
-ch2ena enable -ch2freq 1000.0e6 -ch2sense -60
-refsrc internal -reffreq 10.0e6
The 7120init example attempts to open an attenuator table file,
7120atten.ini at startup. If not found, default tables are loaded and
the program offers to save the INI file at exit. See Chapter 4 for INI file
details.
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
2.5
Pa ge 1 3
ReadyFlow Example Programs (continued)
7120ctrl −
Apply power to the 7120 via a cable to the POWER input on Model 7120.
Connect the 7120 to the host PC via the Micro USB connector on the 7120. 

On the host PC, execute the 7120ctrl example program. Using defaults,
the program will enable and configure both RF channels in the module
to a VCO frequency of 1000 MHz and input sensitivity to −60dBm. If an
initialization file is found, values from it will be used. Messages will be
output to indicate PLL lock and initial conditions.
Once the module is initialized, the program presents a menu allowing
the user to change sensitivity and VCO frequency for either channel. An
input signal is applied to the active channel input and the I or Q output
for that channel may be viewed on a spectrum analyzer or oscilloscope. 

This program supports command−line arguments.
Syntax:
7120ctrl -chan [chan]
-ch1ena [state] -ch1freq [freq] -ch1sense [level]
-ch2ena [state] -ch2freq [freq] -ch2sense [level]
-refsrc [source] -refdir [dir] -reffreq [refclk]
-fstep [step]
Where:
chan
= desired active channel, 1 or 2
state
= enable or disable
freq
= 35 to 4400 MHz, in Hz, 10 KHz steps
level
= 0 to −60
source = internal, external
dir
= input or output
refclk = 5 or 10 MHz, in Hz
step
= 10 KHz, 100 KHz, 1 MHz, 10 MHz, 100 MHz, 1 GHz
Example: (using program defaults)
./7120ctrl.out -chan 1
-ch1ena enable -ch1freq 1000.0e6 -ch1sense -60
-ch2ena enable -ch2freq 1000.0e6 -ch2sense -60
-refsrc internal -refdir output -reffreq 10.0e6
-fstep 1.0e6
The 7120ctrl example attempts to open an attenuator table file,
7120atten.ini at startup. If not found, default tables are loaded and
the program offers to save the INI file at exit. See Chapter 4 for INI file
details.
Rev. 1.0
Page 14
2.6
Model 4994A Option 120 User’s Guide
Building the ReadyFlow Board Support Libraries
The source and header files of the ReadyFlow Board Support Library are located in the
source and include directories. The x86/lib or x86_64/lib directory contains pre−com−
piled libraries, a makefile to build the libraries, and a readme.txt file explaining the
build procedures.
2.6.1
2.6.2
Prebuilt Libraries and Components
makefile
Multi−architecture Linux library makefile
lnxftd2xx.lib
Pre−built ReadyFlow library
Building the Library Using Make
The makefile provided has been tested with GNU and Linux make utilities. It
has been written to the POSIX standard and therefore it should work with
other make utilities as well.
The makefile uses the following environment variables to determine the loca−
tion of the include files:
2.6.3
READYFLOW_7120_LINUX
7120 ReadyFlow base directory
(i.e. /home/ReadyFlow/7120/linux/1.0)
LD_LIBRARY_PATH
ld library search path
(i.e. /home/ReadyFlow/7120/linux/1.0/ARCH/lib)
where ARCH = x86 or x86_64, depending on your
system architecture
Executing the Makefile
To build the libraries, type:
make
or
make lnxftd2xx
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
Pa ge 1 5
Chapter 3: Using the ReadyFlow BSP
3.1
Introduction to ReadyFlow
Pentek's ReadyFlow Libraries are software packages designed to provide software
development tools for specific Pentek products on specific operating systems or plat−
forms. For example, Pentek's ReadyFlow Model 4994A Option 120 is a Linux Ready−
Flow BSP for Pentek’s Bandit® Family Model 7120 RF I/Q demodulator module.
All ReadyFlow packages install on the target system using a standard file directory
structure. In the root directory of this structure can be found the primary include and
source directories that contain all the header files and source code files that are used to
create the libraries.
The Pentek module's functionality is broken down into components: for example,
general board functions, frequency synthesizer functions, etc. The header file provides
structures used to manage module operation.
Parameter tables contain values that are applied to the registers. The parameter tables
are found in the header file. For the 7120 module, that filename is 7120.h and it is
located in the ReadyFlow 7120 include directory. Other files in the include directory
are adf4351.h, which contains defines for the ADF4351 synthesizer, and ftd2xx.h, which
contains the USB device driver
The ReadyFlow 7120 source directory contains the 7120 source file that, like the 7120
header file, addresses support of the Pentek module in functional blocks. The 7120
source directory contains the source file 7120.c , which contains routines for configur−
ing and using Model 7120. Other files in the source directory include 7120atten.c,
which contains default attenuator tables to be applied to the P7120_RF_CHAN_TABLES
attenuator tables, and adf4351.c, which contains routines to configure the ADF4351
synthesizer.
The process for building the library file is specific to the operating system or platform.
A separate directory is provided containing the specific files needed for compiling the
library. See Section 2.3 in this Installation Guide or the readmeNNN.txt file in the Ready−
Flow root directory for directory names, etc. The "NNN" in the readmeNNN.txt will be the
OS designator. For example, for Linux, this file is named readmeLnx.txt.
Rev. 1.0
Page 16
3.2
Model 4994A Option 120 User’s Guide
Using ReadyFlow
The ReadyFlow library functions are designed to be used in a specific order. The
normal sequence of operation for Model 7120 can be summarized as follows:
1) Find, open, initialize, and verify the USB device.
2) Reset the hardware devices in the module to a known start−up state via the USB
channel.
3) Initialize the parameter table.
4) Set specific parameters to values required for program operation.
5) Apply the parameter tables to the registers.
Functions for the first two operations and the last operation are available in the Ready−
Flow library. The fourth operation is done manually. Normally, only a few parameters
will need to be manually changed, since default values are usually chosen to provide
normal operation. Function names include the module ID and a function identifier.
For example, for Model 7120, a few of these are:
•
P7120_ResetModuleDeviceRegs() − resets the hardware devices in the module to a
known start−up state value via the USB channel
•
P7120_InitModuleParams() − initializes the module resource table, applying default
values to all user variables
•
P7120_InitModuleDeviceRegs() − initializes the hardware devices in the module by
applying parameters in the 7120 parameter table to the hardware devices via the USB
channel
These functions are typically used to initialize a module prior to starting an application
program. The ReadyFlow package contains an example program that shows such
initialization.
A modified code snippet from the 7120 example program 7120init.c is shown on the
next page.
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
3.2
Pa ge 1 7
Using ReadyFlow (continued)
The first function called in the code snippet below is P7120_USBDeviceFind(). This func−
tion finds the first FTDI USB device and populates the 7120 resource table. The next
function called is P7120_USBDeviceShowInfo(), which displays the contents of the 7120
resource table. The third function, P7120_USBDeviceOpen(), opens the desired FTDI USB
device and sets the default bit modes for each channel, and the fourth function,
P7120_USBValidateModule, verifies the USB device is an 7120 module.
--------------------------------------------------------------------
/* find first USB device */
status = P7120_USBDeviceFind(&p7120Device, &numDevs);
if (status != FT_OK)
return (exitHandler(2, &p7120Device));
/* optionally display device information */
if (displayChanInfo != 0)
P7120_USBDeviceShowInfo(&p7120Device);
/* open device and initialize both channels */
status = P7120_USBDeviceOpen(&p7120Device);
if (status != 0)
return (exitHandler(3, &p7120Device));
/* verify the device found is an 7120 module */
status = P7120_USBValidateModule(&p7120Device);
if (status != 0)
return (exitHandler(4, &p7120Device));
------------------------------------------------------------------------
Since an application typically requires that all registers be set to some known startup
state, a high−level function is provided for this purpose: P7120ResetModuleDeviceRegs().
This function resets the hardware devices in the module to a known start−up state via
the USB channel.
After the sequence of function calls for the USB, the functions P7120_InitModuleParams
and P7120_InitModuleDeviceRegs are called to initialize the module resource table
(applying default values to all user variables) and then to initialize the hardware
devices in the module by applying parameters in the 7120 parameter table to the hard−
ware devices via the USB channel.
Rev. 1.0
Page 18
Model 4994A Option 120 User’s Guide
This page is intentionally blank
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
Pa ge 1 9
Chapter 4: Using the Attenuator Tables Initialization File
4.1
Introduction
ReadyFlow supports the use of program initialization (INI) files that can be used to
configure a 7120 module at the start of a program, set program operating limits, and
configure attenuator tables.
INI files are not provided in a ReadyFlow package but are generated by executing the
example programs (see Section 2.5). ReadyFlow library functions are provided to read
and write the INI files and initialize tables used in the files.
The INI filename, 7120atten.ini, reflects the primary purpose for the INI files: to
provide a number of tables used to correct gain variations over the wide frequency
range of the Model 7120.
4.2
INI File Format and Location
As generated by a ReadyFlow example program, the file format of an INI file starts
with the definition of frequency bank 1, which contains identifiers for channel, bank,
etc. This is followed by definitions of the remaining banks as follows:
•
RF Channel 1 Bank 1 Table
•
RF Channel 1 Bank 2 Table
•
RF Channel 1 Bank 3 Table
•
RF Channel 1 Bank 4 Table
•
RF Channel 2 Bank 1 Table
•
RF Channel 2 Bank 2 Table
•
RF Channel 2 Bank 3 Table
•
RF Channel 2 Bank 4 Table
A module initialization section follows the definition of the last bank table.
Data in an INI file consists of ASCII text lines. These lines are comment lines, blank
lines, identifier lines, and value lines. All lines must start on column 1.
Identifier lines are those lines containing a keyword, which generally is followed by a
value.
Rev. 1.0
Page 20
4.2
Model 4994A Option 120 User’s Guide
INI File Format and Location (continued)
Valid keywords are as follows:
chan
channel identifier, used for bank definition and module initialization
values
bank
bank identifier
freq_min
minimum frequency for a bank
freq_max
maximum frequency for a bank
chan_gain maximum gain for a bank
dsa
digital step attenuator identifier for a bank
tbl_start
digital step attenuator table start identifier
tbl_end
digital step attenuator table end identifier
refSrc
reference source, module initialization
refDir
reference port direction, module initialization
refFreq
reference frequency, module initialization
ch1_vco_ena channel 1 VCO enable, module initialization
ch1_vco_freq channel 1 VCO frequency, module initialization
ch1_sense
channel 1 input sensitivity, module initialization
ch2_vco_ena channel 2 VCO enable, module initialization
ch2_vco_freq channel 2 VCO frequency, module initialization
ch2_sense
channel 2 input sensitivity, module initialization
Identifier lines take the following format:
[keyword]=[value]
For example:
chan=1
In an identifier line, the keyword starts in column 1 and is immediately followed by the
equal sign if a value is associated with the keyword. The value immediately follows
the equal sign. No white space characters are allowed before or after the equal sign.
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
4.2
Pa ge 2 1
INI File Format and Location (continued)
Value lines are lines containing only an ASCII representation of a numerical value.
Value lines are only used for defining attenuator tables.
Comment lines are any lines containing text that do not contain a keyword or a value.
Comment lines may be placed anywhere in an INI file except when defining an attenu−
ator table.
Blank lines are line containing only a return character. Blank lines may be placed any−
where in an INI file except when defining an attenuator table.
NOTE:
4.3
For an INI file to be read by an example program, it must be located in the
directory where the program was launched.
Frequency Banks
For each frequency bank, a number of identifiers must precede the definition of the
digital step attenuator tables for the bank. The order, and an explanation of each line,
follows:
•
Channel Identifier − This line identifies the RF channel for the lines that follow.
Format: chan=n
Where: n must be 1 or 2
•
Bank Identifier − This line specifies that all following data is to be applied to this
bank for a channel (chan) already specified.
Format: bank=n
Where: n must be 1, 2, 3, or 4
•
Bank Start Frequency − This line specifies the start frequency of a bank. Before this
value is specified, chan and bank values must be specified.
Format: freq_min=v
Where: v is the desired frequency, in Hz.
It may be entered as a single value (for example, 1000000000.000000 for 1000 MHz), or
in scientific notation (for example 1.0e9 for 1000 MHz).
•
Bank End Frequency − This line specifies the end frequency of a bank. Before this
value is specified, chan and bank values must be specified.
Format: freq_max=v
Where: v is the desired frequency, in Hz.
It may be entered as a single value (for example, 1000000000.000000 for 1000 MHz), or
in scientific notation (for example 1.0e9 for 1000 MHz).
Rev. 1.0
Page 22
4.3
Model 4994A Option 120 User’s Guide
Frequency Banks (continued)
•
Bank Channel Gain − Specifies the maximum gain for the bank. Before this value is
specified, chan and bank values must be specified.
Format: chan_gain=v
Where: v is the expected maximum gain in dB.
It may be entered as a single value: for example 70.0, or in scientific notation.
•
Digital Step Attenuator Identifier − This line specifies that all following data is to be
applied to the attenuator table specified by chan and bank (the channel and bank
previously specified.
Format: dsa=n
Where: n must be 1 or 2
•
Attenuator Table Start Identifier − This line specifies the start of attenuator table
data. Before this value is specified, chan, bank, and dsa values must be specified.
Format: tbl_start=n
Where: n can be any value from 0 to 127. It specifies the first location in the table to
be loaded with the data that follows.
The P7120_ReadIniFile() library function initializes the attenuator tables before
attempting to read an INI file. The tbl_start identifier allows you to over write
sections of a table.
No blank lines are allowed after a tbl_start line, until a tbl_end line.
•
Attenuator Table End Identifier − This line specifies the end of an attenuator table.
It does not contain a value or require an equal sign.
Format: tbl_end
•
Attenuator Step Value − These lines specify the step attenuator value as an integer as
it is to be applied to the attenuator. For example, a value of 15.5 dB would be stored
as 31 in the table. See the Model 7120 Operating Manual (part # 800.71200) for details.
It is stored in the attenuator table in the order read from the INI file, starting with the
location defined by tbl_start.
Format: v
Where: v must be a value from 0 to 63.
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
4.4
Pa ge 2 3
Example of a Bank Definition
The following is an example of a bank definition as it might appear in an INI file. For
the sake of brevity, in this example both DSA tables start at index 32 and are only for 15
elements.
chan=1
bank=1
freq_min=35000000.000000
freq_max=1000000000.000000
chan_gain=70.000000
dsa=1
tbl_start=32
16
17
17
18
18
19
19
20
20
21
21
22
22
23
23
tbl_end
dsa=2
tbl_start=32
17
17
18
18
19
19
20
20
21
21
22
22
23
23
24
tbl_end
Rev. 1.0
Page 24
4.5
Model 4994A Option 120 User’s Guide
Module Initialization Values
Identifier lines that specify module initialization values may be placed almost any−
where within an INI file. However, INI files generated using ReadyFlow will place all
module initialization lines near the end of the INI file. They may not be placed within a
section defining an attenuator table.
Module initialization lines are as follows:
•
Reference Source − This line specifies the source of the reference clock for a Model
7120.
Format: ref_src=n
Where: n must be 1, to select the internal reference, or 2, to select the external
reference.
•
Reference Direction − This line specifies the direction of the front panel reference
connector: either as a reference input or as an output of the internal reference.
Format: ref_dir=n
Where: n must be 1, for input, or 2, for output.
•
Reference Frequency − This line specifies the reference frequency: either 5 or 10
MHz.
Format: ref_freq=f
Where: f is floating point value: either 5.0 or 10.0, representing the frequency of the
reference clock frequency.
•
Channel 1 VCO Enable − This line specifies if the VCO for channel 1 is enabled or
disabled. chan must have already been specified.
Format: ch1_vco_ena=n
Where: n is set to 0 to disable the VCO or set to 1 to enable the VCO.
•
Channel 1 VCO Frequency − This line specifies the VCO frequency for RF channel 1.
chan must have already been specified.
Format: ch1_vco_freq=f
Where: f is a floating point value, within the VCO range.
•
Channel 1 Input Sensitivity − This line specifies the input sensitivity for the channel.
chan must have already been specified.
Format: ch1_sense=f
Where: f is a floating point value, from 0 to -70 dBm.
Rev. 1.0
M o d e l 49 9 4 A O p t i o n 1 2 0 U s e r ’ s G u i d e
4.5
Pa ge 2 5
Module Initialization Values (continued)
•
Channel 2 VCO Enable − This line specifies if the VCO for channel 2 is enabled or
disabled. chan must have already been specified.
Format: ch2_vco_ena=n
Where: n is set to 0 to disable the VCO and set to 1 to enable the VCO.
•
Channel 2 VCO Frequency − This line specifies the VCO frequency for RF channel 2.
chan must have already been specified.
Format: ch2_vco_freq=f
Where: f is a floating point value, within the VCO range.
•
Channel 2 Input Sensitivity − This line specifies the input sensitivity for the channel.
chan must have already been specified.
Format: ch2_sense=f
Where: f is a floating point value, from 0 to -70 dBm.
4.6
Example of the Module Initialization Section
The following is an example of module initialization as it might appear in an INI file.
The reference frequency is 10MHz. VCO frequency for both channels is 1000MHz.
Sensitivity is −20 dBm for both channels.
ref_src=1
ref_dir=1
ref_freq=10000000.000000
chan=1
ch1_vco_ena=1
ch1_vco_freq=1000000000.000000
ch1_sense=-40.000000
chan=2
ch2_vco_ena=1
ch2_vco_freq=1000000000.000000
ch2_sense=-40.000000
Rev. 1.0
Page 26
Model 4994A Option 120 User’s Guide
This page is intentionally blank
Rev. 1.0