Hi all.
I have just aquired a V8090 card.
I downloaded all the software and VisualBasic2010 Express Edition
I tried the demo. It worked after changing the com port address.
The samples were converted to VisualBasic2010 Express Edition automatically when opening them
I have now from sample 02 made a new program.
The Relays are paired 12,34,56; 78 not used
Two buttons for each pair: ON and OFF
I have compiled it and tested it, it is working
[color=#00FF00]Public Class MainForm
Private Sub btnRelayOn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRelayOn1.Click
K8090Board1.Port = "COM6"
If K8090Board1.Connect() Then
K8090Board1.SwitchRelayOn(&H3)
K8090Board1.Disconnect()
End If
End Sub
Private Sub bntRelayOff1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntRelayOff1.Click
K8090Board1.Port = "COM6"
If K8090Board1.Connect() Then
K8090Board1.SwitchRelayOff(&H3)
K8090Board1.Disconnect()
End If
End Sub
Private Sub btnRelayOn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRelayOn2.Click
K8090Board1.Port = "COM6"
If K8090Board1.Connect() Then
K8090Board1.SwitchRelayOn(&HC)
K8090Board1.Disconnect()
End If
End Sub
Private Sub bntRelayOff2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRelayOff2.Click
K8090Board1.Port = "COM6"
If K8090Board1.Connect() Then
K8090Board1.SwitchRelayOff(&HC)
K8090Board1.Disconnect()
End If
End Sub
Private Sub btnRelayOn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRelayOn3.Click
K8090Board1.Port = "COM6"
If K8090Board1.Connect() Then
K8090Board1.SwitchRelayOn(&H30)
K8090Board1.Disconnect()
End If
End Sub
Private Sub bntRelayOff3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRelayOff3.Click
K8090Board1.Port = "COM6"
If K8090Board1.Connect() Then
K8090Board1.SwitchRelayOff(&H30)
K8090Board1.Disconnect()
End If
End Sub
End Class
I would like the following function for all 3 pairs: Instant ON, Instant Off relay 1, Delayed Off relay 2, delay 5 seconds.
Do anyone know if this is possible?
Regards HNTEST
Hi all
I have tried to make the delay on operate function (timer) but couldn’t get it right.
Could some one show me a VisualBasic example?
Regards Hans