![Rohde & Schwarz FPL1000 Series Скачать руководство пользователя страница 846](http://html.mh-extra.com/html/rohde-and-schwarz/fpl1000-series/fpl1000-series_user-manual_1477826846.webp)
Remote Commands
R&S
®
FPL1000
846
User Manual 1178.3370.02 ─ 03
'For example on TCP use TCPIP0::192.168.1.2::inst0::INSTR
mbSession = CType(ResourceManager.GetLocalManager().Open("FSW"), _
MessageBasedSession)
mbSession.TerminationCharacterEnabled = True
Try
mbSession.Write("*CLS") 'Reset status reporting system
mbSession.Write("*SRE 168") 'Enable service request for
'STAT:OPER, STAT:QUES and ESR register
mbSession.Write("*ESE 60") 'Set event enable bit for
'command, execution, device-dependent and query error
mbSession.Write("STAT:OPER:ENAB 32767")
'Set OPERation enable bit for all events
mbSession.Write("STAT:OPER:PTR 32767")
'Set appropriate OPERation Ptransition bits
mbSession.Write("STAT:QUES:ENAB 32767")
'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")
Using the Status Register