![Rohde & Schwarz R&S FSP Series Operating Manual Download Page 738](http://html.mh-extra.com/html/rohde-and-schwarz/rands-fsp-series/rands-fsp-series_operating-manual_1477864738.webp)
R&S FSP
Remote Control – Programming Examples
Basic Programming Steps for the VISA Interface
7.4
Operating Manual 1164.4556.12 - 06
Non-blocking (user inputs possible)
This method is recommended if the waiting time until the event to be signalled by an
SRQ is long (longer than the selected time-out), and user inputs should be possible
during the waiting time, or if the event is not certain to occur. This method is, there-
fore, the preferable choice for waiting for the end of measurements, i.e. the output of
results, especially in the case of triggered measurements.
The method necessitates a waiting loop that checks the status of the SRQ line at
regular intervals and returns control to the operating system during the time the
expected event has not yet occurred. In this way, the system can respond to user
inputs (mouse clicks, key entries) during the waiting time.
A query of the VI_ATTR_GPIB_SRQ_STATE attribute can only be sent from the
controller, not from the instrument. Therefore, the handle of the controller board is
used for this calling of the viGetAttribute attribute.
It is advisable to employ the Hold() auxiliary function, which returns control to the
operating system for a selectable waiting time (see section
ing the Keyboard and Mouse” on page 7.4
), so enabling user inputs during the wait-
ing time.
result% = 0
For i = 1 To 10
'Abort after max. 10 loop iterations
Call viGetAttribute(board, VI_ATTR_GPIB_SRQ_STATE, result%)
'Check service request line
If (result% <> 0) Then
CALL Srq
'If SRQ is recognized => subroutine for evaluation
Else
CALL Hold(20)
'Call hold function with 20 ms waiting time.
'User inputs are possible.
Endif
Next i
If result% = 0 Then
PRINT "Timeout Error; Program aborted"
'Output error message
STOP
'Stop software
Endif
7.2.1.3
Waiting Without Blocking the Keyboard and Mouse
A frequent problem with remote control programs using Visual Basic is to insert wait-
ing times without blocking the keyboard and the mouse.
If the program is to respond to user inputs also during a waiting time, control over
the program events during this time must be returned to the operating system. In
Visual Basic, this is done by calling the
DoEvents
function. This function causes key-
board- or mouse-triggered events to be executed by the associated elements. For
example, it allows the operation of buttons and input fields while the user waits for
an instrument setting to be completed.
Summary of Contents for R&S FSP Series
Page 1: ...R S FSP Spectrum Analyzer Operating Manual 1164 4556 12 06 Test Measurement Operating Manual ...
Page 24: ...R S FSP Putting into Operation 1 2 Operating Manual 1164 4556 12 06 ...
Page 72: ...R S FSP Manual Operation 3 2 Operating Manual 1164 4556 12 06 ...
Page 793: ...R S FSP Index Operating Manual 1164 4556 12 06 4 11 ...
Page 794: ...R S FSP 4 12 Operating Manual 1164 4556 12 06 ...
Page 795: ...Operating Manual 1164 4556 12 06 4 13 R S FSP ...
Page 796: ...R S FSP 4 14 Operating Manual 1164 4556 12 06 ...