8.8 Sample Programs
169
8
C
ha
pte
r 8
R
S-2
32
C
/G
P-IB
/L
AN
In
te
rfa
ce
s
(4) External Trigger Measurement 2
Measure and import according to external triggering of the instrument (
TRIG
key or EXT I/O TRIG terminal
input), and save measurements in a text file.
(The instrument imports the most recent measurement by trigger input timing with the continuous measure
-
ment state)
Private Sub MeasureTrig2SubRS()
Dim recvstr As String
'Receiving char string
Dim i As Integer
MSComm1.Settings = "9600,n,8,1"
'Comm port setting
MSComm1.PortOpen = True
'Open a port
Open App.Path & "\data.csv" For Output As #1
'Open a text file for saving
MSComm1.Output = ":TRIG:SOUR IMM" & vbCrLf
'Select internal triggering
MSComm1.Output = ":INIT:CONT ON" & vbCrLf
'Continuous measurement ON
'Clear confirmation of External I/O TRIG input
MSComm1.Output = ":IO:IN?" & vbCrLf
recvstr = ""
While Right(recvstr, 1) <> Chr(10)
recvstr = r MSComm1.Input
DoEvents
Wend
For i = 1 To 10
'Wait for External I/O TRIG input
Do While 1
MSComm1.Output = ":IO:IN?" & vbCrLf
recvstr = ""
While Right(recvstr, 1) <> Chr(10)
recvstr = r MSComm1.Input
DoEvents
Wend
If Left(recvstr, 1) = "1" Then Exit Do
DoEvents
Loop
MSComm1.Output = ":FETCH?" & vbCrLf
'Send ":FETCH?" to import the most recent mea
-
surement
recvstr = ""
'From here on, continue receiving until an LF code
occurs
While Right(recvstr, 1) <> Chr(10)
recvstr = r MSComm1.Input
DoEvents
Wend
recvstr = Left(recvstr, Len(recvstr) - 2)
'Delete the terminator (CR+LF)
Print #1, Str(i) & "," & recvstr
'Write to the file
Next
Close #1
MSComm1.PortOpen = False
End Sub
HIOKI BT3562A981-09
Содержание BT3562
Страница 2: ...HIOKI BT3562A981 09...
Страница 24: ...1 5 Measurement Flowchart 18 HIOKI BT3562A981 09...
Страница 84: ...4 13 Reset Function 78 HIOKI BT3562A981 09...
Страница 93: ...5 4 Internal Circuitry 87 5 Chapter 5 External Control EXT I O 5 4 Internal Circuitry HIOKI BT3562A981 09...
Страница 102: ...6 3 Printing 96 HIOKI BT3562A981 09...
Страница 186: ...8 8 Sample Programs 180 HIOKI BT3562A981 09...
Страница 198: ...10 3 Error Display 192 HIOKI BT3562A981 09...
Страница 200: ...194 HIOKI BT3562A981 09...
Страница 220: ...Appendix 11 Dimensional Diagram A20 HIOKI BT3562A981 09...
Страница 224: ...Index HIOKI BT3562A981 09...
Страница 225: ...HIOKI BT3562A981 09...
Страница 226: ...HIOKI BT3562A981 09...
Страница 227: ...HIOKI BT3562A981 09...
Страница 228: ...HIOKI BT3562A981 09...