PLZ12005WH/PLZ20005WH Electronic Load

Commnunication Interface Mannual


 

Tutorial

Visual Basic 2013

How to use Visual Basic 2013 and the VISA library to communicate with the PLZ12005WH/PLZ20005WH through its RS232C, USB, and LAN interfaces is explained below.

Setting the "Project"

First, set the communication driver (VISA library) for the Project.

From Solution Explorer, select a project, right-click to show the shortcut menu, select Properties, References, and then Add, and then select the VISA COM you want to use.

Example: Using the VISA COM5.5 Type Library

Communication through RS232C, USB, or LAN

After setting the communication driver, you can communicate with the PLZ12005WH/PLZ20005WH through RS232C, USB, or LAN.

The following describes the communication procedure using VISA.

Open the VISA

To communicate with an RS232C, USB, or LAN device using VISA, you have to first open VISA. When you open VISA, specify the I/O resource.

Example: To open VISA by using USB

Dim rm As IResourceManager3 = New ResourceManager()
Dim msg As IMessage
msg = rm.Open("USB0::0x0B3E::0x1042::AB012345::INSTR", AccessMode.NO_LOCK, 0, "")

"USB0::0x0B3E::0x1042::AB012345::INSTR" is the I/O resource.

The I/O resource is specified by the following constructions. The part indicated with [ ] can be omitted. Enter the appropriate values in the parts specified in oblique characters.

Serial
(RS232C)
ASRL[board][::INSTR]
Example : The measuring instrument connected to the serial port COM1.
   ASRL1::INSTR
USB USB[board]::VendorID::ProductID::SerialNumber[::InterfaceNumber][::INSTR]
Example: The USBTMC measuring instrument having vendor ID (VID) 2878, Product ID (PID) 4133 and serial number "00000001."
   USB0::0x0B3E::0x1024::00000001::INSTR
LAN*1 VXI-11 TCPIP[board]::hostname[::inst0][::INSTR]
Example :The measuring instrument whose IP address (hostname) is 169.254.7.8.
   TCPIP::169.254.7.8::INSTR
You can also set the LAN device name using the host name.
HiSLIP TCPIP[board]::hostname::hislip0[::INSTR]
Example :The measuring instrument whose IP address (hostname) is 169.254.7.8.
   TCPIP::169.254.7.8::hislip0::INSTR
You can also set the LAN device name using the host name.
SCPI-RAW TCPIP[board]::hostname::portno::SOCKET
Example :The measuring instrument whose IP address (hostname) is 169.254.7.8. (The "portno" setting of the PLZ12005WH/PLZ20005WH is normally 5025.)
   TCPIP::169.254.7.8::5025::SOCKET
You can also set the LAN device name using the host name.

*1: The hostname must be a valid mDNS hostname (a Bonjour hostname that ends in ".local") or a DNS hostname that is managed by an external DNS server (a full-qualified domain name—FQDN). If you are using an mDNS hostname, Apple Bonjour (alternatively, iTunes or Safari) must be installed on your PC.

For VISA, the alias can be used for the I/O resource.

When using the alias for the I/O resource, even if the alias name is hard-coded directly in the application, the alias name can be easily converted to the appropriate I/O resource name.

Example : When using the alias (MYDEV1) for the I/O resource.

msg = rm.Open("MYDEV1", AccessMode.NO_LOCK, 0, "")

When the alias is used, the actual I/O resource is specified by an external configuration table. When using USB (example for KI-VISA):

If you are using a version of VISA other than KI-VISA, see the manual of your VISA version.

Controlling the devices

Next, use "Read" and "Write" commands to control devices. You must include line-feed codes in the command character strings.

Example:

msg.WriteString("CURRent 0.3" & vbLf) 'Set the current to 0.3 A

msg.WriteString("CURRent:PULSe:FREQuency 10" & vbLf) ’Set the pulse frequency to 10 Hz

msg.WriteString("INPut ON" & vbLf) 'Load on

Closing the VISA

Close the VISA at the end.

You only need to include one "open" VISA command and one "close" VISA command in the program.

msg.Close

Sample program

    
Imports Ivi.Visa.Interop

Public Class Form1
  Dim rm As IResourceManager3 = New ResourceManager()
  Dim msg As IMessage

  'Open the VISA resource.
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    msg = rm.Open("ASRL1::INSTR", AccessMode.NO_LOCK, 0, "")                           'When using serial port COM1
    'msg = rm.Open("USB0::0x0B3E::0x1042::AB012345::INSTR", AccessMode.NO_LOCK, 0, "") 'When using USB
    'msg = rm.Open("TCPIP0::192.168.1.23::inst0::INSTR", AccessMode.NO_LOCK, 0, "")    'When using LAN (VXI-11)
    'msg = rm.Open("MYDEV1", AccessMode.NO_LOCK, 0, "")                                'When using a VISA alias
    msg.TerminationCharacterEnabled = True

   'When using a serial port, set the parameters with the following code.
    Dim seri As ISerial = msg
    seri.BaudRate = 19200                               'Set the baudrate to 19200.
    seri.DataBits = 8                                   'Set the data bits to 8.
    seri.StopBits = SerialStopBits.ASRL_STOP_ONE        'Set the stop bits to 1.
    seri.Parity = SerialParity.ASRL_PAR_NONE            'Set no parity.
    seri.FlowControl = SerialFlowControl.ASRL_FLOW_NONE 'Set no flow control.
  End Sub

  'Query the ID.
  Private Sub CommandIdn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommandIdn.Click
    msg.WriteString("*IDN?" & vbLf)
    TextBox1.Text = msg.ReadString(256)
    msg.WriteString("*RST" & vbLf)
  End Sub

   'Set the current and pulse function.
  Private Sub CommandCurr_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommandCurr.Click
    msg.WriteString("*RST" & vbLf)                       'Reset the SOURCE and MEASURE values.
    msg.WriteString("FUNCtion CC" & vbLf)                'Set the operation mode to CC mode.
    msg.WriteString("CURRent 0.3" & vbLf)                'Set the current to 0.3 A.
    msg.WriteString("CURRent:SLEWrate 0.1" & vbLf)       'Set the slew rate to C0.1 A/μs.
    msg.WriteString("CURRent:PULSe:LEVel 0.15" & vbLf)   'Set the pulse level to 0.15 A.
    msg.WriteString("CURRent:PULSe:FREQuency 10" & vbLf) 'Set the frequency to 10 Hz.
    msg.WriteString("CURRent:PULSe:DCYCle 10" & vbLf)    'Set the duty cycle to 10%.
    msg.WriteString("POWer:PROTection  30" & vbLf)       'Set OPP to 30 W.
    msg.WriteString("POWer:PROTection:STATe ON" & vbLf)  'Set the OPP action to load off.
    msg.WriteString("INITiate:PULSe" & vbLf)             'Set the pulse function to on.
    msg.WriteString("INPut ON" & vbLf)                   'Then the load on.
  End Sub
  
  'Editing the program
  Private Sub CommandProg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommandProg.Click
    msg.WriteString("PROG """"" & vbLf)                   'Clear the program selection.
    msg.WriteString("PROG:CRE ""/Program1""" & vbLf)      'Create a program named Program1.
    msg.WriteString("PROG ""/Program1""" & vbLf)          'Select Program1.
    msg.WriteString("PROG:LOOP 2" & vbLf)                 'Set the number of loops of Program1 to 2.
    msg.WriteString("PROG:STEPS:COUN 4" & vbLf)           'Set the number of steps of Program1 to 4.
    msg.WriteString("PROG:STEP1:LEV 8" & vbLf)            'Set the current of step 1 of Program1 to 8 A.
    msg.WriteString("PROG:STEP2:LEV 4" & vbLf)            'Set the current of step 2 of Program1 to 4 A.
    msg.WriteString("PROG:STEP3:LEV 0" & vbLf)            'Set the current of step 3 of Program1 to 0 A. 
    msg.WriteString("PROG:STEP4:LEV 3" & vbLf)            'Set the current of step 4 of Program1 to 3 A.
    msg.WriteString("PROG:STEP1:DWEL 10" & vbLf)          'Set the execution time of step 1 of Program1 to 10 seconds.
    msg.WriteString("PROG:STEP2:DWEL 12" & vbLf)          'Set the execution time of step 2 of Program1 to 12 seconds.
    msg.WriteString("PROG:STEP3:DWEL 7" & vbLf)           'Set the execution time of step 3 of Program1 to 7 seconds.
    msg.WriteString("PROG:STEP4:DWEL 15" & vbLf)          'Set the execution time of step 4 of Program1 to 15 seconds.
    msg.WriteString("PROG:STEP1:INP ON" & vbLf)           'Set step 1 of Program1 to load on.
    msg.WriteString("PROG:STEP2:INP ON" & vbLf)           'Set step 2 of Program1 to load on.
    msg.WriteString("PROG:STEP3:INP OFF" & vbLf)          'Set step 3 of Program1 to load off.
    msg.WriteString("PROG:STEP4:INP ON" & vbLf)           'Set step 4 of Program1 to load on.
    msg.WriteString("PROG:STEP1:TRAN RAMP" & vbLf)        'Set the transition method of step 1 of Program1 to Ramp.
    msg.WriteString("PROG:STEP2:TRAN IMM" & vbLf)         'Set the transition method of step 2 of Program1 to Immediate.
    msg.WriteString("PROG:STEP4:TRAN IMM" & vbLf)         'Set the transition method of step 4 of Program1 to Immediate.
    msg.WriteString("PROG:STEP1:TRIG:GEN NONE" & vbLf)    'Set the signal output of step 1 of Program1 to none.
    msg.WriteString("PROG:STEP2:TRIG:GEN NONE" & vbLf)    'Set the signal output of step 2 of Program1 to none.
    msg.WriteString("PROG:STEP3:TRIG:GEN NONE" & vbLf)    'Set the signal output of step 3 of Program1 to none.
    msg.WriteString("PROG:STEP4:TRIG:GEN TRIGOUT" & vbLf) 'Set the signal output of step 4 of Program1 to TRIGOUT.
    msg.WriteString("PROG:SAVE" & vbLf)                   'Save Program1.
    msg.WriteString("INIT:TRAN:PROG" & vbLf)              'Execute Program1.
  End Sub

  'Query the measured current.
  Private Sub CommandMeas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommandMeas.Click
    msg.WriteString("MEAS:CURR?" & vbLf)   'Send measurement command.
    TextBox2.Text = msg.ReadString(256)    'Read the measurement data.
  End Sub

  'Close the VISA resource.
  Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
    msg.Close()
  End Sub

    

Related information

A KIKUSUI version of the I/O library (KI-VISA) is available. You can download KI-VISA from the Kikusui Electronics Corporation website (http://www.kikusui.co.jp/en/download/).

>top

Setup

Overview of Command

Command (function search)

Command (ABC search)

Command (Sub-system search)

Register

Appendix

Tutorial

Electronic Load  PLZ12005WH/PLZ20005WHElectronic Load PLZ12005WH/PLZ20005WH
Communication Interface Manual