9.9 Sample Programs
168
External Trigger Measurement 2
Import according to the external triggering of the instrument (F4 [MANU] key or TRIG signal input), and save
the measurements in a text file.
(The instrument imports the most recent measurement at the trigger input timing in 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 to save
MSComm1.Output = ":TRIG:SOUR IMM" & vbCrLf
' Select internal trigger
MSComm1.Output = ":INIT:CONT ON" & vbCrLf
' Continuous measurement ON
'Clear confirmation of Ext. 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 Ext. 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 is
reached
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
Summary of Contents for RM3542-50
Page 1: ......
Page 2: ......
Page 6: ...Table of Contents iv...
Page 26: ...1 3 Screen Organization 20...
Page 32: ...2 3 Turning the Power On and Off 26...
Page 48: ...3 8 Confirming Faulty Measurements 42...
Page 72: ...4 14 Compensating for Thermal EMF Offset Offset Voltage Compensation OVC 66...
Page 84: ...5 7 Initializing Reset 78...
Page 94: ...6 4 Auto Exporting Measurement Values at End of Measurement Data Output Function 88...
Page 206: ...11 4 Disposing of the Instrument 200...
Page 216: ...Appendix 5 Dimensional diagram A10 Appendix 5 Dimensional diagram Unit mm...
Page 230: ...Index Index 4...
Page 231: ...HIOKI E E CORPORATION...
Page 232: ......
Page 233: ......
Page 234: ......