
9.9 Sample Programs
153
9
External Trigger Measurement 2
Measure and import according to external triggering of the RM3542 (
F4
[MANU] key or TRIG signal input),
and save measurements in a text file.
(The RM3542 imports the most recent measurement by trigger input timing with the continuous measurement
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
Содержание RM3542
Страница 2: ......
Страница 6: ...Contents iv ...
Страница 16: ...Operating Precautions 10 ...
Страница 26: ...1 3 Screen Organization 20 ...
Страница 32: ...2 3 Turning the Power On and Off 26 ...
Страница 46: ...3 8 Confirming Faulty Measurements 40 ...
Страница 64: ...4 12 Compensating for Thermal EMF Offset Offset Voltage Compensation OVC 58 ...
Страница 84: ...6 4 Auto Exporting Measured Values at End of Measurement Data Output Function 78 ...
Страница 90: ...7 3 Printing 84 ...
Страница 172: ...9 10 Device Compliance Statement 166 ...
Страница 190: ...11 4 Disposing of the Instrument 184 ...
Страница 200: ...Appendix 5 Dimensional Diagram A10 Appendix 5 Dimensional Diagram ...
Страница 214: ...Index Index 4 ...
Страница 215: ......
Страница 216: ......
Страница 217: ......
Страница 218: ......