I’m an over-the-hill former programmer who last worked in Basic and Fortran decades ago (well before GUI). I’ve assembled a K8055 card and successfully connected it to my Windows Vista laptop. Now I want to install software so I can activate the outputs according to a time schedule.
I’ve downloaded Microsoft Visual Studio 2008 and gone through the first few tutorials. I’ve also downloaded the complete set of software and examples from the Velleman.eu site. I sense that I’m only a few cuts and pastes away from having something I can work with, but I need some advice. …. When I open the Velleman Examples folder and its VB_2008 folder I find multiple files. What combination of actions using Visual Studio and files from this folder do I need to take to produce a program that will allow me to set timers for the K8055 output switches?
BTW, I’ve searched for ready-to-use software for the K8055, but the only thing I found was flagged as a source of malware by my anti-virus program. If you know of a safe source of such software, that would be even better.
I think the easiest way to start is to open the existing K8055Demo project and modify it a little.
[quote]What combination of actions using Visual Studio and files from this folder do I need to take to produce a program that will allow me to set timers for the K8055 output switches?[/quote]Please take them all. You may also make a copy of the whole folder before starting to make tests and modifications to the code.
In the examples folder \Examples\K8055DemoVB_2008\K8055Demo double click the K8055Demo.sln to open the project in the Visual Basic editor.
If the designer and the code are not shown, click text Form1.vb in the Solution Explorer.
There will appear two icons “View Code” and “View Designer” at the top of the Solution Explorer.
Click the icons to view code and designer.
When the designer is displayed click the “Timer2” symbol at the bottom.
Now you see in the Properties window the timer properties.
The most important property is the timer Interval (100ms). You may now edit this property if you like.
Next double click the “Timer2” symbol to view the code:
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
ClearDigitalChannel(n)
n = n + 1
If n = 9 Then n = 1
SetDigitalChannel(n)
End Sub
This code makes the “running light” on the output LEDs of the K8055 card.
By modifying the code like this you get different effect:
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
n = n + 1
If n = 3 Then n = 1
If n = 1 Then
SetDigitalChannel(1)
ClearDigitalChannel(2)
Timer2.Interval = 500
End If
If n = 2 Then
SetDigitalChannel(2)
ClearDigitalChannel(1)
Timer2.Interval = 100
End If
End Sub
The Timer2 is enabled by pressing “Output Test” button.
The code “behind” this button is:
Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.Checked Then
Timer2.Enabled = True
Else
Timer2.Enabled = False
ClearAllDigital()
… etc.