Programming Guide for DS1000E, DS1000D Series
3-9
For i = 0 To (rSize - 1)
tmpstr = Chr(rcv_buffer(i))
Next i
Read_USB = tmpstr
End Function
5.
Dblclick CH1 and add the following codes:
Dim i As Long
Dim sendbuf As String
Dim readbuf As String
rSize = 100
sendbuf = ":CHAN1:DISP?"
'initialize the USB device
i = GetTMCDeviceNum
'send a query command and read the results
Call SendToUSB(sendbuf)
readbuf = Read_USB()
'confirm the light state of corresponding channel according to the Returned
Format
If readbuf = "ON" Then
' send a setting command
sendbuf = ":CHAN1:DISP 0"
Call SendToUSB(sendbuf)
Label1(0).ForeColor = &H808080 'gray
Else
sendbuf = ":CHAN1:DISP 1"
Call SendToUSB(sendbuf)