EasyManua.ls Logo

Anritsu MS2026C - Page 374

Anritsu MS2026C
410 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Visual Basic Example
A-8 PN: 10580-00306 Rev. E MS20xxC PM
stat = viOpen(dfltRM, "TCPIP0::" & ipAddress & "::" & Port &
"::SOCKET", VI_NULL, VI_NULL, sesn)
Rem Set some visa attributes
Rem recommandation timeout >= 90 sec
stat = viSetAttribute(sesn, VI_ATTR_TMO_VALUE, 90000)
stat = viSetAttribute(sesn, VI_ATTR_SEND_END_EN, VI_TRUE)
Rem VI_ATTR_SUPPRESS_END_EN has to set to False during Ethernet
Socket communication
stat = viSetAttribute(sesn, VI_ATTR_SUPPRESS_END_EN, VI_FALSE)
stat = viClear(sesn)
Rem NOTE:
Rem All commands (SCPI) must be send with linefeed
Rem during Ethernet Socket communication
Rem i.e. "vbLf" is in Visual Basic environment constant
'read back the strat frequency
sInputString = "*IDN?" & vbLf
stat = viWrite(sesn, sInputString, Len(sInputString), retCount)
Buffer = ""
stat = viRead(sesn, Buffer, MAX_CNT, retCount)
'System preset
sInputString = ":SYSTEM:PRESET" & vbLf
stat = viWrite(sesn, sInputString, Len(sInputString), retCount)
'Wait for previous operation to be completed
sInputString = "*OPC?" & vbLf
stat = viWrite(sesn, sInputString, Len(sInputString), retCount)
Buffer = ""
stat = viRead(sesn, Buffer, MAX_CNT, retCount)
'Set start frequency
sInputString = ":SENSe:FREQuency:STARt 1 GHz" & vbLf

Table of Contents

Related product manuals