VisualBasic.NET Sample programs (TCP/IP)


The following programs are provided without charge, for use entirely at your own risk.
HIOKI disclaims any and all responsibility for any consequences arising out of use of this software.


Visual Basic and Visual Studio are registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and other countries.
Microsoft, Windows and MS-DOS are registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and other countries.

Setup Procedure


• In order to connect to an existing network, settings may need to be allocated by the network system administrator (IS department) beforehand.
• Refer to the Networking Setup Procedure about setting the IP address of the instrument.
• For example, if the subnet mask of the PC is "255.255.255.0", set the subnet mask of the instrument to the same value. Then by making only the rightmost octet (value to the right of the last period) of the instrument's IP address different from that of the PC, they will be able to connect to each other.
• The settings in this section serve only as examples. Making improper TCP/IP settings can interfere with network communications.


Instrument Setting Example



PC Setting Example



Sample Program 1


This program establishes a connection with the instrument and starts communication.
Enter a command and press the Send button to send it to the instrument.
Responses to queries are displayed in the text box.



Sample program 1


Sample Program 2


This program causes the instrument to take 101 measurements on channel CH1-1, and reads the measured values.
The number of data objects stored in instrument memory is first obtained by the "MEMORY:MAXPOINT?" query.
When this query returns 0, the program is ready to receive measurement data.
Pressing the Execute button then causes the instrument to start measuring and sending the measured values.



Sample program 2


Sample Program 3


This program writes a sine wave on channel CH1-1.
Pressing the Execute button sends the sinusoidal data to the instrument after ensuring that the memory is ready to receive it.





Sample program 3


Sample Program 4


This program displays current measurement data in a text box.
Pressing the Execute button displays the data once per second.
Pressing the Stop button stops measurement.



Sample program 4


Sample Program 5


This program saves data from instrument memory into a file on the PC, then reads the file and sends it back to the instrument.
Pressing the Execute button saves the data from channel CH1-1 into a file named "C:\sample.dat".
Pressing the Open button then causes the PC to read the data stored in this file and send it back to the instrument.



Sample program 5


Sample Program 6


This program employs the ":STATUS" command to check instrument status.
Pressing the Execute button starts instrument status checking.
Pressing the Stop button stops status checking.



Sample program 6