7.8 Sample Programs
148
(2) Measure Resistance by PC Key
Measures and imports by key input on the PC, and saves measurements in a text file.
Private Sub MeasureReadSubRS()
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 OFF" & vbCrLf
'Continuous measurement OFF
For i = 1 To 10
'Wait for PC key input
'Create a key input check routine to set InputKey() = True when a key is pressed
Do While 1
If InputKey() = True Then Exit Do
DoEvents
Loop
'After confirming key input, measure once, and read the measured value
MSComm1.Output = ":READ?" & vbCrLf
'Send ":READ?" to measure and import the
measurement
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
Summary of Contents for 3561
Page 1: ...BATTERY HiTESTER INSTRUCTION MANUAL 3561 3561 01 ...
Page 2: ......
Page 3: ......
Page 7: ......
Page 8: ......
Page 9: ......
Page 10: ......
Page 11: ......
Page 12: ......
Page 13: ......
Page 14: ......
Page 15: ......
Page 16: ......
Page 17: ......
Page 18: ......
Page 19: ......
Page 20: ......
Page 21: ......
Page 22: ......
Page 23: ......
Page 24: ......
Page 25: ......
Page 26: ......
Page 27: ......
Page 28: ......
Page 29: ......
Page 30: ......
Page 31: ......
Page 32: ......
Page 33: ......
Page 34: ......
Page 35: ......
Page 36: ......
Page 37: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 63: ......
Page 64: ......
Page 65: ......
Page 66: ......
Page 67: ......
Page 68: ......
Page 69: ......
Page 70: ......
Page 71: ......
Page 72: ......
Page 73: ......
Page 74: ...4 12 Reset Function 68 ...
Page 75: ......
Page 76: ......
Page 77: ......
Page 79: ......
Page 80: ......
Page 81: ......
Page 83: ......
Page 84: ......
Page 85: ......
Page 86: ......
Page 87: ......
Page 88: ......
Page 89: ......
Page 90: ......
Page 91: ......
Page 93: ......
Page 94: ......
Page 95: ......
Page 96: ......
Page 97: ......
Page 98: ......
Page 99: ......
Page 101: ......
Page 102: ......
Page 103: ......
Page 104: ......
Page 105: ......
Page 107: ......
Page 108: ......
Page 109: ......
Page 110: ......
Page 111: ......
Page 113: ......
Page 115: ......
Page 116: ......
Page 117: ......
Page 119: ......
Page 121: ......
Page 123: ......
Page 125: ......
Page 127: ......
Page 129: ......
Page 131: ......
Page 133: ......
Page 135: ......
Page 137: ......
Page 139: ......
Page 141: ......
Page 142: ......
Page 143: ......
Page 145: ......
Page 147: ......
Page 149: ......
Page 151: ......
Page 152: ......
Page 153: ......
Page 155: ......
Page 157: ......
Page 159: ......
Page 161: ......
Page 163: ......
Page 165: ......
Page 167: ......
Page 168: ......
Page 169: ......
Page 170: ......
Page 171: ......
Page 172: ......
Page 173: ......
Page 174: ......
Page 175: ......
Page 176: ......
Page 177: ......
Page 178: ......
Page 179: ......
Page 180: ......
Page 181: ......
Page 182: ...Appendix 9 Dimensional Diagram 176 ...
Page 183: ......
Page 186: ...iv Index ...
Page 187: ......
Page 188: ......