Agilent Technologies InfiniiVision 6000 Series Instrukcja Obsługi Strona 898

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 934
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 897
898 Agilent InfiniiVision 6000 Series Oscilloscopes Programmer's Guide
12 Programming Examples
' Check for instrument errors (another command and result).
CheckForInstrumentErrors(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)
' Write command termination character.
nViStatus = visa32.viPrintf(m_nSession, "" & Chr(10) & "")
CheckVisaStatus(nViStatus)
' Check for instrument errors (another command and result).
CheckForInstrumentErrors(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 instrument errors (another command and result).
CheckForInstrumentErrors(strQuery)
' Return string results.
Return strResults
End Function
Public Function DoQueryValue(ByVal strQuery As String) As Double
' Send the query.
VisaSendCommandOrQuery(strQuery)
' Get the result string.
Przeglądanie stron 897
1 2 ... 893 894 895 896 897 898 899 900 901 902 903 ... 933 934

Komentarze do niniejszej Instrukcji

Brak uwag