ELECTRONICS - [BK1786B software]- [BKcomm class]
Communicating with the BK1786B instrument is relatively easy. Each command is executed by sending a data frame to the instrument: this is a packet with 26 bytes of data. Each frame contains a command (the command we want to execute on the BK device) and some additional data (one or more bytes).
I now created a software class for Visual Basic. This class contains all functions that are required to communicate with the BK device. Thanks to this class it is no longer required to work with bits and bytes. The class provides you with functions to set/read the values on the BK device.
You only need to add the class to your own Visual Basic project to get started.
Using the BKcomm class is very easy. You only need to create an object that is an instance of this class. Then you can communicate with your BK Device through this object. The example below shows the code required to activate the output and set a voltage of 2000 mV (2 Volt) and a maximal output current of 150 mA.
Dim bkDevice As New BKcomm() bkDevice.allowSleepFunction = True If bkDevice.connect(8, 9600, 0) Then bkDevice.setRemoteControlMode(BKcomm.remoteControlMode.REMOTE_OPERATION) bkDevice.setOutputVoltage(2000) bkDevice.setOutputCurrent(150) bkDevice.enableOutput(True) End If
This is what happens:
Downloading the class
Here you can download a a preliminary version of my bkComm class. The class still needs some tuning, but it is fully operational.
Copyright ©1998-2022 Vanderhaegen Bart - last modified: August 24, 2013