2-17 Fast-Frequency-Switching Commands
Programming with GPIB Commands
2-44
PN: 10370-10374 Rev. F
MG369xC GPIB PM
The following is an example of fast-frequency-switching mode programming. This is a IBM-PC based
program using the National Instruments NI-488.2 C language interface library (mcib. lib) and header
(decl. h).
#include <stdio. h>
#include “decl. h”
#define BOARD_ID 0
void main()
{
Addr4882_t source_addr = 5,
device_addr[2] = {5, NOADDR};
double freq_list[2] = {600e6, 8e9},
*double_ptr;
int start_index,
num_freqs = 2,
*integer_ptr;
char command_str[50];
/** Clear the bus and take control.
**/
SendIFC(BOARD_ID);
if (ibsta & ERR)
{
exit (-1);
}
/** Set the remote enable line.
**/
EnableRemote(BOARD_ID, device_addr);
if (ibsta & ERR)
{
exit (-1);
}
/** Set the start index to an arbitrary starting point.
**/
start_index = 12;
/** Begin constructing the command.
**/
command_str[0] = ‘Z’;
/** Start with the ZTL command. **/
command_str[1] = ‘T’;
command_str[2] = ‘L’;
integer_ptr = &start_index;
/** Point to the start index. **/
command_str[3] = (char)(*(integ 3));
/** Get the value of the fourth byte. **/
/** Data is LSB first on Intel based PCs. **/
command_str[4] = (char)(*(integ 2));
/** Get the value of the third byte. **/
command_str[5] = (char)(*(integ 1));
/** Get the value of the second byte. **/
command_str[6] = (char)(*integer_ptr);
/** Get the value of the first byte. **/
NOTE:
This program is continued on the next page.
Figure 2-12.
Fast-Frequency-Switching Programming Example (1 of 3)
Содержание MG369 C Series
Страница 2: ......
Страница 6: ...Contents 4 PN 10370 10374 Rev F MG369xC GPIB PM ...
Страница 262: ...A 34 PN 10370 10374 Rev F MG369xC GPIB PM ...
Страница 264: ...Index 2 PN 10370 10374 Rev F MG369xC GPIB PM ...
Страница 265: ......