Velleman K8000 - [K8000 From Excel]
K8000 From Excel
Sometimes, people ask me if it possible to control the K8000 from
Microsoft Excel. The answer is: YES. I made a little
example to demonstrate this.
The image above shows a screenshot of the Excel file that I have
created. It has 3 tables on it: one with the value of the AD channels.
One with the state of the 16 I/O channels. And at least one to switch I/O
channels 9 to 16 on and off.
- The AD (Analog Digital) table shows you the information from the
analog I/O channels. I have written a used defined excel function for this:
=ReadAD(channelnr). Where channelnr is a number between
1 and 4 , since the K8000 has 4 analog inputs. Note: the values doesn't
change in real time. You need to refresh the screen, in order to get the
new values from the card.
- The I/O input table shows you the state of all the 16 I/O channels (1 or
0, this means 'on' or 'off'). I have written a user defined excel function
for this too: =readio(channelnr). Where channelnr is the
number of the channel you wish to retrieve. Just like the AD channels table,
the values doesn't change in real time.
- The I/O output table allows you to set the state of the I/O channels 9
to 16. You can type "1" or "0" in the cells. The corresponding channel will
change immediately, and the requested state will be made visible. The
user defined excel function: =setio(channelnr,state). Where
channelnr is the number of the I/O channel you wish to change, and state is
the condition you want to use.
This excel functions are made with VBA (Visual Basic For Applications).
You need to accept the macro's in the file before you can open the file.
The sample also requires the driverlinx PortIO Driver. This driver can be
downloaded from the WinPLC site
This driver maintains the connection between software and hardware.
Get the Excel file (97, 2000, 2003)