Remote Control
R&S
®
ESRP
591
User Manual 1175.7445.02 ─ 08
'Printers require printer language 'GDI'
'----- Selection of orientation (portrait/landscape) and colour/BW ---------
CALL InstrWrite(analyzer,"HCOP:PAGE:ORI PORT")
'Portrait orientation
CALL InstrWrite(analyzer,"HCOP:DEV:COL OFF")
'Black-and-white printout
'----- Configuring and starting the printout -------------------------------
CALL InstrWrite(analyzer,"HCOP:ITEM:ALL")
'All screen contents
'CALL InstrWrite(analyzer,"HCOP:ITEM:TRAC:STAT ON")
'Alternative: only traces
CALL InstrWrite(analyzer,"*CLS") 'Reset status registers
CALL viEnableEvent(vi, VI_EVENT_SERVICE_REQ, VI_QUEUE, 0)
'Enable the event for service request
CALL InstrWrite(analyzer,"HCOP;*OPC")
'Start printout
SRQWaitTimeout = 5000 'Allow 5s for completion
'Now wait for the service request
statusSRQ = viWaitOnEvent(vi, VI_EVENT_SERVICE_REQ, SRQWaitTimeout, _
eventType, eventVi)
CALL viClose(eventVi) 'Close the context before continuing
CALL viDisableEvent(vi, VI_EVENT_SERVICE_REQ, VI_QUEUE)
'Disable subsequent events
IF NOT(statusSRQ = 0) THEN CALL Srq 'If SRQ not detected =>
'Subroutine for evaluation
'---- Printout in WMF format (BMP format) to file --------------------------
CALL InstrWrite(analyzer,"HCOP:DEST 'MMEM'")
'Configuration: "Printout to file"
CALL InstrWrite(analyzer,"HCOP:DEV:LANG WMF")
'WMF file format
'CALL InstrWrite(analyzer,"HCOP:DEV:LANG BMP")
'BMP file format
CALL InstrWrite(analyzer,"MMEM:NAME 'C:\R_S\Instr\user\PRINT1.WMF'")
'Define file name
CALL InstrWrite(analyzer,"*CLS") 'Reset Status registers
CALL viEnableEvent(vi, VI_EVENT_SERVICE_REQ, VI_QUEUE, 0)
'Enable the event for service request
CALL InstrWrite(analyzer,"HCOP:IMMediate;*OPC")
'Start printout
SRQWaitTimeout = 5000 'Allow 5s for completion
' Now wait for the service request
statusSRQ = viWaitOnEvent(vi, VI_EVENT_SERVICE_REQ, SRQWaitTimeout, _
eventType, eventVi)
CALL viClose(eventVi) 'Close the context before continuing
CALL viDisableEvent(vi, VI_EVENT_SERVICE_REQ, VI_QUEUE)
'Disable subsequent events
IF NOT(statusSRQ = 0) THEN CALL Srq 'If SRQ not detected =>
'Subroutine for evaluation
Controlling the R&S
ESRP Remotely