Agilent Technologies InfiniiVision 3000 DSO-X 3054A Servisní příručka Strana 933

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 970
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 932
Programming Examples 37
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide 933
' Open a VISA resource session.
OpenSession()
' Clear the interface.
Dim nViStatus As Integer
nViStatus = visa32.viClear(m_nSession)
End Sub
Public Sub DoCommand(ByVal strCommand As String)
' Send the command.
VisaSendCommandOrQuery(strCommand)
' Check for inst errors.
CheckInstrumentErrors(strCommand)
End Sub
Public Function DoCommandIEEEBlock(ByVal strCommand As String, _
ByVal DataArray As Byte()) As Integer
' Send the command to the device.
Dim strCommandAndLength As String
Dim nViStatus As Integer
Dim nLength As Integer
Dim nBytesWritten As Integer
nLength = DataArray.Length
strCommandAndLength = [String].Format("{0} #8{1:D8}", _
strCommand, nLength)
' Write first part of command to formatted I/O write buffer.
nViStatus = visa32.viPrintf(m_nSession, strCommandAndLength)
CheckVisaStatus(nViStatus)
' Write the data to the formatted I/O write buffer.
nViStatus = visa32.viBufWrite(m_nSession, DataArray, nLength, _
nBytesWritten)
CheckVisaStatus(nViStatus)
' Check for inst errors.
CheckInstrumentErrors(strCommand)
Return nBytesWritten
End Function
Public Function DoQueryString(ByVal strQuery As String) _
As StringBuilder
' Send the query.
VisaSendCommandOrQuery(strQuery)
' Get the result string.
Dim strResults As New StringBuilder(1000)
strResults = VisaGetResultString()
' Check for inst errors.
CheckInstrumentErrors(strQuery)
Zobrazit stránku 932
1 2 ... 928 929 930 931 932 933 934 935 936 937 938 ... 969 970

Komentáře k této Příručce

Žádné komentáře