Logo Banner

ELECTRONICS - [Voltcraft VC-940 class]

Voltcraft VC-940 class


I recently bought a Voltcraft VC-940 multimeter. This is a very complete 40000 count multimeter that even comes with a power adapter to perform power measurements (Watt). The meter has a very good price/quality ratio.

The multimeter also has an optical RS-232 interface to download the measured values to your computer. Voltcraft provides some software to watch the data on your computer, but the RS-232 interface is even more interesting for people that want to write their own software.

Voltcraft provides some information about the data protocol that is used for the data transfers, but the information is rather poor. So I started researching the information available, and I created my own Visual Basic .NET class.

With this class it becomes very easy to write your own applications for the VC-940 multimeter. You just need to add the class to your Visual Basic project. Then you need to define an instance of this class (an object). The measuring data will now be accessible through this object.

Data from the VC-940

The VC-940 multimeter will transmit a data packet each second. This data packet contains the value the multimeter is currently indicating. Nothing more, nothing less...

The VC-940 class

As I wrote earlier the VC940 class can be added to any existing Visual Basic .NET project. You can just download the class from the download section of this page. Then open your (new) project in Visual Studio, and press SHIFT+ALT+A to add an existing item. A file dialog will pop up: select the downloaded VC940.vb file.

Now you can create an object from the VC940 class. You just need to add this basic code to a Form's code:

    Private WithEvents multimeter As New VC940()
    Private Sub multimeter_measurementReceived(ByVal measuringType As String,
                                                ByVal unit As String,
                                                ByVal value As String,
                                                ByVal overrange As boolean) Handles multimeter.measurementReceived											   
        Me.Text = String.Format("Measuring {0} {1}", value, unit)
    End Sub
    Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        multimeter.ownerForm = Me			
        multimeter.comPort = 1
        If multimeter.connect() Then
           MsgBox("connection failed")
        End If
    End Sub

Explanation of the code

First we define an instance variable which is named multimeter. This variable is an object and an instance of the class VC940. The withevents keyword indicates the class is capable to raise events.

The connection is initialized during the FrmMain_Load event. First we need to define the number of the COM-port: the hardware port the multimeter is connected to. Then the connection will be made by calling the multimeter.connect() method. This method returns a boolean result to indicate if the connection succeeded.

Once connected the multimeter object starts receiving data from the RS-232 link. The VC-940 transmits a data packet each second, so the multimeter_measurementReceived event is launched each second. The event gets 4 different parameters: the measuringType, the unit (e.g. mV), the measured value and a boolean to indicate if the multimeter is in overrange.

You've probably noticed the strange code multimeter.ownerForm = Me. This code will make sure the multimeter object knows it's parent class. While this line isn't really really necessary in your program, I recommend to use it. It makes sure you can call your Form's controls directly from the multimeter_measurementReceived event handler. Otherwise the event handler would run in another thread, disallowing you to access the Form's controls directly.

Practical Application: LAB-IT

I used my VC940 class to build LAB-IT, a semi-automatic testing tool for lab experiments. LAB-IT controls my programmable power supply (BK1786B), and reads the retrieved values back from the multimeter. This allows you to test your electronic circuits with a series of voltages.

Only one multimeter is supported, but LAB-IT allows you to repeat the measurements. After each series you can change the location/function of the multimeter. This allows you to run dozens of tests with only one multimeter device.

I realize this method might not be 100 % accurate: with my setup the digital power supply has to reproduce the voltages each time. Some reasons why this setup can be inaccurate:

The LAB-IT software is unavailable for download, as it was written for a very specific combination of hardware (BK1786B supply + VC940 multimeter). You can contact me by the contact form if you are interested in the software.

The following Excel-chart was generated with data from LAB-IT. It shows the characteristics of a 4.9 V zenerdiode. For this graph 400 different measurements were taken. LAB-IT generated the needed data in 10 - 15 minutes. One remark: the value of my resistor was actually too high. Because of this the measured current is only 2 mA.


You can download the VC940 class by clicking the button below. Please note the version of my class is still experimental. I also added a sample project to demonstrate how you can use the VC940 class.


Please keep in mind this VC940 class is still under construction. Some bugs might still be present. You may always send feedback by using the contact form of this site.

Copyright ©1998-2022 Vanderhaegen Bart - last modified: August 24, 2013