Agilent Technologies B1500A Service Manual Page 311

  • Download
  • Add to my manuals
  • Print
  • Page
    / 598
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 310
Agilent B1500A/B1505A Programming Guide, Edition 11 3-133
Programming Examples
Reading Binary Output Data
Dim range As Double ’43
If mode = 1 Then ’ current range
If rng < 21 Then range = 10 ^ (rng - 20)
If rng = 21 Then range = 2
If rng = 22 Then range = 20
If rng = 23 Then range = 40
Else ’ voltage range
If rng = 8 Then range = 0.5
If rng = 9 Then range = 5
If rng = 10 Then range = 0.2
If rng = 11 Then range = 2
If rng = 12 Then range = 20
If rng = 13 Then range = 40
If rng = 14 Then range = 100
If rng = 15 Then range = 200
If rng = 16 Then range = 500
If rng = 17 Then range = 1500
If rng = 18 Then range = 3000
End If ’61
’value = value & Chr(13) & Chr(10) & "status = " & status ’63
’value = value & Chr(13) & Chr(10) & "type = " & type
’value = value & Chr(13) & Chr(10) & "mode = " & mode
’value = value & Chr(13) & Chr(10) & "channel = " & chan
’value = value & Chr(13) & Chr(10) & "sign = " & sign
’value = value & Chr(13) & Chr(10) & "range = " & range
’value = value & Chr(13) & Chr(10) & "count = " & count & Chr(13) & Chr(10)
Dim meas As Double ’71
If type = 0 Then meas = count * range / 20000 ’source data
If type = 1 Then meas = count * range / 50000 ’measurement data
data(j, i) = Chr(13) & Chr(10) & meas * 1000 & ", " & status ’75
session.WriteString("DZ" & vbLf) ’77
save_data(fname, title, value, data, nop1, nop2, session, t)
Exit Sub
Check_err: ’81
session.WriteString("EMG? " & err & vbLf) : msg = session.ReadString(256)
MsgBox("Instrument error: " & err & Chr(10) & msg, vbOKOnly, "")
Exit Sub
End Sub
Line Description
43 to 61 Checks the measurement range or output range setting.
63 to 69 If you want to display and save the binary data elements, delete ’ at the top of the lines.
71 to 75 Calculates the measurement data or source output data. And, stores the data into the
data array.
77 to 79 Applies 0 V from all channels. And transfers the data stored in the data variable to the
save_data subprogram (see Table 3-1). And the subprogram will save the data into a
CSV file specified by the fname variable and displays the data on a message box.
81 to 84 Displays a message box to show an error message if the error is detected.
Page view 310
1 2 ... 306 307 308 309 310 311 312 313 314 315 316 ... 597 598

Comments to this Manuals

No comments