1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Visual Basic 10 For I/O Board

Discussion in 'Programming & Webmastering' started by syker, Jun 23, 2010.

  1. syker New Member

    Joined:
    Sep 25, 2007
    Messages:
    83 (0.02/day)
    Thanks Received:
    2
    How do i get the input 1 and input 2 buttons to CONTROL the LED lights?
     
  2. Easy Rhino

    Easy Rhino Linux Advocate

    Joined:
    Nov 13, 2006
    Messages:
    14,377 (3.65/day)
    Thanks Received:
    4,339
    your would be better served if you asked your question in the context of what you are trying to do. also, provide some sort of code you have already written so that people know where to start to help if they can.
     
    10 Year Member at TPU
  3. syker New Member

    Joined:
    Sep 25, 2007
    Messages:
    83 (0.02/day)
    Thanks Received:
    2
    i want to be able to control individual lights on a timer, with button-control. that is probably as specific as i can get so far. we are working on a class project, but we are completely stuck, otherwise.

    here is the code so far:

    Public Class VB_Digital_IO
    Private Declare Function OpenDevice Lib "k8055d.dll" (ByVal CardAddress As Integer) As Integer
    Private Declare Sub CloseDevice Lib "k8055d.dll" ()
    Private Declare Function ReadAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer) As Integer
    ' Note the following was changed to return ByRef instead of ByVal to allow proper usage
    Private Declare Sub ReadAllAnalog Lib "k8055d.dll" (ByRef Data1 As Integer, ByRef Data2 As Integer)
    Private Declare Sub OutputAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer, ByVal Data As Integer)
    Private Declare Sub OutputAllAnalog Lib "k8055d.dll" (ByVal Data1 As Integer, ByVal Data2 As Integer)
    Private Declare Sub ClearAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer)
    Private Declare Sub SetAllAnalog Lib "k8055d.dll" ()
    Private Declare Sub ClearAllAnalog Lib "k8055d.dll" ()
    Private Declare Sub SetAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer)
    Private Declare Sub WriteAllDigital Lib "k8055d.dll" (ByVal Data As Integer)
    Private Declare Sub ClearDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
    Private Declare Sub ClearAllDigital Lib "k8055d.dll" ()
    Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
    Private Declare Sub SetAllDigital Lib "k8055d.dll" ()
    Private Declare Function ReadDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer) As Boolean
    Private Declare Function ReadAllDigital Lib "k8055d.dll" () As Integer
    Private Declare Function ReadCounter Lib "k8055d.dll" (ByVal CounterNr As Long) As Integer
    Private Declare Sub ResetCounter Lib "k8055d.dll" (ByVal CounterNr As Integer)
    Private Declare Sub SetCounterDebounceTime Lib "k8055d.dll" (ByVal CounterNr As Integer, ByVal DebounceTime As Integer)

    Private Sub VB_Digital_IO_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim CardAddress As Integer
    Dim h As Integer
    CardAddress = 0
    h = OpenDevice(CardAddress)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    SetAllDigital()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    ClearAllDigital()
    End Sub
    End Class
     
  4. syker New Member

    Joined:
    Sep 25, 2007
    Messages:
    83 (0.02/day)
    Thanks Received:
    2
    anyone up for the task?
     
  5. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    20,400 (6.30/day)
    Thanks Received:
    9,543
    Location:
    IA, USA
    What LED lights? How are they connected to the computer? Also, what is this k8055d.dll you reference a lot in your code?
     
    Crunching for Team TPU
  6. syker New Member

    Joined:
    Sep 25, 2007
    Messages:
    83 (0.02/day)
    Thanks Received:
    2
    K8055 I/O board, USB-connected
     
  7. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,817 (3.59/day)
    Thanks Received:
    5,629
    Location:
    Cheeseland (Wisconsin, USA)
    Are these discrete LEDs or something like a 7-segment display?

    Can't you hook the individual LEDs up to the digital channels on the controller and use the WriteAllDigital(number) method to turn on the channels that you want lit?
     
    10 Year Member at TPU
  8. syker New Member

    Joined:
    Sep 25, 2007
    Messages:
    83 (0.02/day)
    Thanks Received:
    2
    seven-segment display. theyre all connected to a board.
     
  9. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,817 (3.59/day)
    Thanks Received:
    5,629
    Location:
    Cheeseland (Wisconsin, USA)
    Sorry .. alittle busy today :)

    So you are trying to control one 7-seg display from the K8055 board?
    Something like a count-down timer?
     
    10 Year Member at TPU
  10. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    20,400 (6.30/day)
    Thanks Received:
    9,543
    Location:
    IA, USA
    Crunching for Team TPU

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)