Rigol DS1000D Manual de usuario Pagina 112

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 137
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 111
RIGOL
Programming Guide for DS1000E, DS1000D Series
3-8
4. Add a subfunction as follows to send commands and get returned values.
'send a setting command
Sub SendToUSB(cmd As String)
Dim retcode As Boolean
Dim send_buf(256) As Byte
Dim temp As Long
Dim cmdstr As String
cmdstr = cmd
temp = Len(cmdstr)
For i = 0 To temp - 1
tempStr = Mid(cmdstr, i + 1, 1)
send_buf(i) = Asc(tempStr)
Next i
'send a command to the oscilloscope
'the definition of interface has been mentioned in Rigolusb.h
retcode = WriteUSB(0, 1, 1, Len(cmdstr), VarPtr(send_buf(0)))
End Sub
'/acquire Returned Format from the oscilloscope
Public Function Read_USB() As String
Dim retcode As Boolean
Dim rcv_buffer(256) As Byte
Dim tmpstr As String
Dim i, size As Long
Dim rSize As Long
rSize = 100
tmpstr = ""
send a command to ask for value, after the success, a value could be
obtained from the oscilloscope.
retcode = WriteUSB(0, 2, 2, 256, 0)
'read Returned Format from the oscilloscope
retcode = ReadUSB(0, VarPtr(rSize), VarPtr(rcv_buffer(0)))
Vista de pagina 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 136 137

Comentarios a estos manuales

Sin comentarios