18.12.2012 Views

R&S FSQ Signal Analyzer - Rohde & Schwarz

R&S FSQ Signal Analyzer - Rohde & Schwarz

R&S FSQ Signal Analyzer - Rohde & Schwarz

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

R&S <strong>FSQ</strong> Instrument Functions<br />

RSIB Interface Functions<br />

When import libraries are used, the DLL is automatically loaded immediately before<br />

the application is started. At the end of the program, the DLL is unloaded again<br />

unless it is still used by other applications.<br />

Access to librsib.so functions (UNIX platforms)<br />

The functions of librsib.so are declared in the header file RSIB.H. Uppercase/<br />

lowercase characters for file names are typically observed under UNIX. The library<br />

functions are linked to a C/C++ program by entering the -lrsib linker option.<br />

The shared library librsib.so is automatically loaded on starting the application.<br />

The accessibility (for example via standard path) of the library must be ensured.<br />

Refer to section “UNIX Environment” on page 4.255.<br />

Query of strings<br />

If instrument responses are to be further processed as strings, a zero termination<br />

must be appended.<br />

Example<br />

#define MAX_RESP_LEN 100<br />

char buffer[100];<br />

...<br />

RSDLLibrd( ud, buffer, &ibsta, &iberr, &ibcntl );<br />

buffer[ibcntl] = 0;<br />

Programming example<br />

In the following C program example, a single sweep is started on the device with the<br />

IP address 89.10.38.97 and subsequently a marker is set to maximum level. Prior to<br />

the search for maximum, a synchronization to the end of the sweep is performed.<br />

For this purpose the command "*OPC" (Operation complete) is used to create a<br />

service request at the end of the sweep, for which the control program waits with the<br />

function RSDLLWaitSrq(). Then the maximum is determined ("CALC:MARK:<br />

MAX") and the level read out ("Y?").<br />

short ibsta, iberr;<br />

unsigned long ibcntl;<br />

short ud;<br />

short srq;<br />

char MaxPegel[MAX_RESP_LEN];<br />

char spr;<br />

// Determine handle for instrument<br />

ud = RSDLLibfind( "89.10.38.97", &ibsta, &iberr, &ibcntl );<br />

// if instrument exists<br />

if ( ud >= 0 )<br />

{<br />

// Set timeout for RSDLLWaitSrq() to 10 seconds<br />

RSDLLibtmo( ud, 10, &ibsta, &iberr, &ibcntl );<br />

4.270 Operating Manual 1313.9681.12 - 01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!