
115
Sample Programs
Using the DM7276 to perform scan measurement
Connect the SW1001 and DM7276 to their respective COM ports and perform scan measurement
from CH1 to CH22 for
SLOT 1
.
The USB interface can be used to communicate with the device in the same manner as the RS-
232C interface. Check the COM number for the USB connection in the device properties and use
that number for communications. Communications speed has no meaning in the context of a USB
connection.
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 writer1 As IO.StreamWriter
Dim unit_no As Integer
Dim ch_no As Integer
Dim ch_str As String
Dim recv_str As String
'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 DM7276 to COM4.
sp2 = New System.IO.Ports.SerialPort("COM4", 9600, Parity.None, 8, StopBits.One)
sp2.NewLine = vbCrLf : sp2.ReadTimeout = 1000
sp1.Open()
sp2.Open()
sp1.DiscardInBuffer()
sp2.DiscardInBuffer()
'Open a file for saving.
writer1 = New IO.StreamWriter(Application.Start "\data.csv")
'Configure SLOT1 as a 2-wire connection.
sp1.WriteLine(":SYST:MOD:WIRE:MODE 1,WIRE2")
sp1.WriteLine("
*
OPC?")
sp1.ReadLine()
For unit_no = 1 To 1
For ch_no = 1 To 22
'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 DM7276 and receive the measured value.
sp2.WriteLine(":READ?")
recv_str = sp2.ReadLine()
'Write measurement data to a file.
writer1.WriteLine( "," + recv_str)
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: ......