![Rohde & Schwarz 1065.6000.20 Operating Manual Download Page 390](http://html1.mh-extra.com/html/rohde-and-schwarz/1065-6000-20/1065-6000-20_operating-manual_1477758390.webp)
FSE
Programming Examples
1065.6016.12
7.11
E-16
Programming example:
In the following C program, a single sweep is started on the instrument with the IP address
89.10.38.97 and a marker is set to the maximum level. Before the maximum level can be
determined, the sweep must be terminated. Synchronization to the end of the sweep is made by
triggering a service request at the end of the sweep with command
"*OPC"
(operation complete).
The control program waits for the SRQ with the function
RSDLLWaitSrq()
. Then the maximum
level is determined (
"CALC:MARK:MAX"
) and the level is read out (
"Y?"
). Prior to readout a check
is made with serial poll whether data are available (MAV bit set in status register(only for instruments
with Windows NT controller).
Note:
Address ’@local’ and DLL rsib.dll must be used for instruments with MS-DOS controller.
#define MAX_RESP_LEN
100
short
ibsta, iberr;
unsigned long
ibcntl;
short ud;
short
srq;
char
Maxlevel[MAX_RESP_LEN];
char spr;
// Determining the handle for the instrument
ud = RSDLLibfind( "89.10.38.97", &ibsta, &iberr, &ibcntl );
// If instrument exists
if ( ud >= 0 ) {
// Setting timeout for RSDLLWaitSrq() to 10 seconds
RSDLLibtmo( ud, 10, &ibsta, &iberr, &ibcntl );
// Activate SRQ generation through event status register (ESR)
// and enable ESB bit of SRE register
RSDLLibwrt( ud, "*ESE 1;*SRE 32", &ibsta, &iberr, &ibcntl );
// Set single sweep, trigger sweep
// and generate SRQ at the end of the sweep with "*OPC"
RSDLLibwrt( ud, "INIT:CONT off;INIT;*OPC", &ibsta, &iberr, &ibcntl );
// Wait for SRQ (end of sweep)
RSDLLWaitSrq( ud, &srq, &ibsta, &iberr, &ibcntl );
// Clear RQS/MSS bit
RSDLLibrsp( ud, &spr, &ibsta, &iberr, &ibcntl );
// If sweep is terminated
if (srq) {
// Set marker to first maximum and query level
RSDLLibwrt( ud, "CALC:MARK:MAX;Y?", &ibsta, &iberr, &ibcntl );
// Check if data are available (MAV bit in status register set)
RSDLLibrsp( ud, &spr, &ibsta, &iberr, &ibcntl );
if (spr & 0x10) {
// then read out data
RSDLLilrd( ud, MaxPegel, MAX_RESP_LEN, &ibsta, &iberr, &ibcntl );
}
}
// end connection to instrument
RSDLLibonl (ud, 0, &ibsta, &iberr, &ibcntl ) ;}
else {
; // Error - instrument not found
}
Summary of Contents for 1065.6000.20
Page 3: ......
Page 5: ......
Page 17: ......
Page 57: ...Contents Description of Commands FSE 1065 6016 12 I 6 4 E 16...
Page 379: ...Contents Programming Examples FSE 1065 6016 12 I 7 2 E 1...
Page 391: ......
Page 393: ...Contents Maintenance and Instrument Interfaces FSE 1065 6016 12 I 8 2 E 15...
Page 419: ......
Page 421: ...Contents Error Messages FSE 1065 6016 12 I 9 2 E 1...
Page 429: ......