CMU Program Examples 
1100.4903.12 7.1  E-4 
7 Remote Control – Program Examples 
The program examples in this chapter are intended to give a short introduction to GPIB bus 
programming of the CMU illustrating some of the concepts discussed in Chapter 5. For examples 
involving optional function groups (network tests) refer to the relevant manuals, e.g. CMU-K21/-K22/-
K23.   
 
 
 
Secondary Address Handling 
The following example explains how to handle primary and secondary addressing and how to perform a 
simple measurement with the CMU. In the example, remote control via the National Instruments GPIB 
bus driver (NI-488.2) and the programming language C is used. Once the addresses are assigned, the 
same commands can be used in different function groups. 
 
// Include header files 
#include <string.h> 
 
/*  NI488.2 header file */ 
#include <decl.h>  
 
// GPIB board index 
#define BdIndx                   0 
 
// Primary address 
#define pad                      20 
 
// Secondary address for Base Definition (National Instruments specific) 
#define sad_BASE                 96 
 
// Secondary  Address for function groups definition  
// (conforming to IEEE488.2) 
#define _RF_NSig                  1 
#define _GSM900MS_Sig             2 
#define _GSM900MS_NSig            3 
#define _GSM1800MS_Sig            4 
 
#define sad_RF_NSig             sad_BASE + _RF_NSig 
#define sad_GSM900MS_Sig        sad_BASE + _GSM900MS_Sig 
#define sad_GSM900MS_NSig       sad_BASE + _GSM900MS_NSig 
#define sad_GSM1800MS_Sig       sad_BASE + _GSM1800MS_Sig 
 
// Timeout 
#define tmo                     (int) 10 
 
// EOT 
#define eot                     (int) 1 
 
// EOS 
#define eos                     (int) 0 
 
// Command definition for secondary address mapping