117
Sample Programs
Measure the internal resistance using the BT3562 and measure the OCV using the DM7276.
Connect the SW1001 and BT3562, DM7276 to their respective COM ports and perform scan
measurement of internal resistance and OCV from CH1 to CH11 for
SLOT 1
.
Imports System.IO.Ports
'Scan measurement sample
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sp1 As SerialPort
Dim sp2 As SerialPort
Dim sp3 As SerialPort
Dim writer1 As IO.StreamWriter
Dim unit_no As Integer
Dim ch_no As Integer
Dim ch_str As String
Dim ir_str(50) As String
Dim ocv_str(50) As String
Dim i As Integer
'Connect the SW1001 to COM3.
sp1 = New System.IO.Ports.SerialPort("COM3", 9600, Parity.None, 8, StopBits.One)
sp1.NewLine = vbCrLf : sp1.ReadTimeout = 1000
'Connect the BT3562 to COM4.
sp2 = New System.IO.Ports.SerialPort("COM4", 9600, Parity.None, 8, StopBits.One)
sp2.NewLine = vbCrLf : sp2.ReadTimeout = 1000
'Connect the DM7276 to COM5.
sp3 = New System.IO.Ports.SerialPort("COM5", 9600, Parity.None, 8, StopBits.One)
sp3.NewLine = vbCrLf : sp2.ReadTimeout = 1000
sp1.Open()
sp2.Open()
sp3.Open()
sp1.DiscardInBuffer()
sp2.DiscardInBuffer()
sp3.DiscardInBuffer()
'Open a file for saving.
writer1 = New IO.StreamWriter(Application.Start "\data.csv")
'Configure SLOT1 as a 4-wire connection.
sp1.WriteLine(":SYST:MOD:WIRE:MODE 1,WIRE4")
sp1.WriteLine("
*
OPC?")
sp1.ReadLine()
'Turn off the continuous measurement of BT3562.
sp2.WriteLine(":INIT:CONT OFF")
i = 0
For unit_no = 1 To 1
For ch_no = 1 To 11
'Create a string to specify the channel.
ch_str = Format(unit_no, "00") + Format(ch_no, "00")
'Close the specified channel and wait for the operation to complete.
sp1.WriteLine(":CLOS " + ch_str)
sp1.WriteLine("
*
OPC?")
sp1.ReadLine()
'Send the one-time measurement command to the BT3562 and receive the measured value.
sp2.WriteLine(":READ?")
ir_str(i) = sp2.ReadLine()
i = i + 1
Next
Next
8
Communication Function
Содержание SW1001
Страница 2: ......
Страница 42: ...38 Precautions for Measurement...
Страница 48: ...44 Resetting Scan Operation...
Страница 50: ...46 Checking the Device Status...
Страница 52: ...48 Initialization Settings...
Страница 118: ...114 Sample Programs 3 Select File Save All 4 Check the save location and click Save as...
Страница 156: ...152 Outline Drawings 12 4 Outline Drawings SW1001 Unit mm Tolerance 0 2...
Страница 157: ...153 Outline Drawings SW1002 Unit mm Tolerance 0 2 12 Appendix...
Страница 158: ...154 Outline Drawings...
Страница 161: ...16 01 EN...
Страница 162: ......
Страница 163: ......
Страница 164: ......