Remote Control
R&S
®
FSPN
521
User Manual 1179.4363.02 ─ 01
'Set questionable enable bits for all events
mbSession.Write("STAT:QUES:PTR 32767")
'Set appropriate questionable Ptransition bits
Console.WriteLine("Wait on event - Blocking")
mbSession.EnableEvent(MessageBasedSessionEventType.ServiceRequest, _
EventMechanism.Queue)
'Enable the event for service request
'------------------------------------------------
' Your command plase use here
' mbSession.Write("Your command")
'------------------------------------------------
Dim Status = mbSession.WaitOnEvent( _
MessageBasedSessionEventType.ServiceRequest, SRQWaitTimeout)
If (Status.EventType() = _
MessageBasedSessionEventType.ServiceRequest) Then
Console.WriteLine("SRQ is recognized")
'If SRQ is recognized => subroutine for evaluation
Srq()
End If
Catch exp As Exception
Console.WriteLine(exp.Message)
End Try
Catch exp As InvalidCastException
Console.WriteLine("Resource selected must be a message-based session")
Catch exp As Exception
Console.WriteLine(exp.Message)
End Try
' Close session
mbSession.Dispose()
' Wait for end
Console.WriteLine("Press any key to end")
Console.ReadKey()
End Sub
11.11.1.2
Waiting for the Arrival of a Service Request
There are basically two methods of waiting for the arrival of a service request:
Blocking (user inputs not possible):
This method is appropriate if the waiting time until the event to be signaled by an SRQ
is short (shorter than the selected timeout), if no response to user inputs is required
during the waiting time, and if – as the main criterion – the event is absolutely certain to
occur.
Reason:
Programming Examples