Page 4 of 8 FirstFirst 12345678 LastLast
Results 31 to 40 of 76

Thread: Sdk?

  1. #31
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    Oh, so the initialize and free is for the drivers to do what they are supposed to. I thought this was a fusion brain specific thing. I get it now.

  2. #32
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    Yes exactly. All devices require a file handler pointer. It the liason between device and computer. The fusion driver is actually a what I think is a breakthrough generic driver. Reason being it is not locked to a specific device. It make calls that are easily accessable through any language not just C and C++ like the modern win_usb.dll. So you can get the hardware ID of your printer, initialize it, and see the raw stream that comes off of it. Part of the reason it took so damn long.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  3. #33
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    Thanks guys, I am now able to control outputs on the FB via Visual Basic. I think my major issue was using the string "0" instead of a UInt32 for the pFusionUSB arguements in the fuctions. I copied Arrow's code and it it now works. Also, I'm not setting byte 61 as 255 on the output data stream, and all is working fine. The word document seems to indicate that byte 61 on the incoming data stream will be 255. Is there some reason I need to send byte 61 as 255?

    For reference, here's my VB code:
    Code:
    Dim VIDPID As String = "USB\VID_04D8&PID_000C\4&338F3FFA&0&1"
        Dim Uint0 As UInt32 = Convert.ToUInt32(0)   'Uint representing zero
        Private KeepAliveBit As Integer
        Private OutputArray(64) As Byte
        Private DigOut(12) As Integer
    
    
        Private Sub InitFB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InitFB.Click
            'Lets check to see of the DLL file exists in this folder.
            If Not System.IO.File.Exists("FusionUSB.dll") Then
                'DLL file doesn't exist, show error.
                MsgBox("Error: The Fusion Brain driver ""FusionUSB.dll"" does not exist in this directory.")
            Else
                'DLL exists, lets check the status to see if it is already connected
                If FUSB_GetFUSBstatus(Uint0) = 0 Then
                    'Status is 0, meaning it is already connected. Can't connect it again.
                Else
                    'Status isn't 0, lets try to connect to the Fusion Brain
                    If FUSB_Initialize(Uint0, VIDPID, Uint0) Then
                        'Init was successful
                        For i = 0 To 63
                            OutputArray(i) = CByte(0)
                        Next
                        For i = 0 To 11
                            DigOut(i) = 0
                        Next
    
                        KeepAliveBit = 1
    
                        'Start the timer for sending data to the FB
                        MainForm.ProcessFBDataOnTimerTick = True
                    Else
                        MsgBox("Failed to initialize that Fusion Brain. Make sure it is connected and that you are specifying the correct USB VID/PID number.")
                    End If
                End If
            End If
        End Sub
    
        Public Sub SendDataToFusionBrain()
            'This sub is called from a Timer_Tick event, which runs at 10Hz.
            For i = 0 To 11
                OutputArray(i) = Convert.ToByte(0 & KeepAliveBit & DigOut(i))
            Next
            FUSB_Send(Uint0, OutputArray)
    
            'Toggle the keepalive bit for nexttime.
            If KeepAliveBit = 0 Then
                KeepAliveBit = 1
            Else
                KeepAliveBit = 0
            End If
        End Sub
    
    
        Private Sub Turn0on_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Turn0on.Click
            DigOut(0) = 1
        End Sub
    
        Private Sub Turn0off_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Turn0off.Click
            DigOut(0) = 0
        End Sub
    
        Public Sub CloseHandlesOnExit()
            'This gets called from the MyBase.FormClosed event as the app closes
            'Disable timer, Set all outputs to off, send data to the FB one last time, then disconnect from the FB
            MainForm.ProcessFBDataOnTimerTick = False
            For i = 0 To 11
                DigOut(i) = 0
            Next
            SendDataToFusionBrain()
            FUSB_Free(Uint0)
        End Sub

  4. #34
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    Byte 61 is referenced in the input section, but it does look like it needs to be set high to activate communication with the brain. It's still working for you because you probably don't have the latest firmware on the board. There was a note in the doc that said that the byte 61 only applied to firmware from sometime in november.

  5. #35
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    So, toaster, it seems like you don't need to work on a com object anymore since this works. Except, I'm not sure if Uints are available in VB6... bad news for RR.

  6. #36
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    Quote Originally Posted by Arrow View Post
    Byte 61 is referenced in the input section, but it does look like it needs to be set high to activate communication with the brain. It's still working for you because you probably don't have the latest firmware on the board. There was a note in the doc that said that the byte 61 only applied to firmware from sometime in november.
    Right you are. I missed the comment about November firmware in the document. I added the necessary line to my code for future fusion brain compatibility.

    2k1toaster, the latest release of the fusion control centre says it only supports XP and Vista. Is it the FusionUSB.dll that doesn't support 2000, or something in the code of your application that doesn't like 2000?

    Thanks again for your help on this.

  7. #37
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    I dont have 2000 as it was in my opinion the crap OS between 98SE and XP. And the winusb dll is a Vista specific driver. It can be coinstalled to XP but only with SP2. You can try on 2000, but winusb and .NET 2.0 are the limiting factors.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  8. #38
    Constant Bitrate
    Join Date
    Jul 2005
    Posts
    221
    so im not up to spec with all this coding jargon in here, but will i b able to run my fusion software thru RR soon?

  9. #39
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    Quote Originally Posted by 2k1Toaster View Post
    I dont have 2000 as it was in my opinion the crap OS between 98SE and XP.
    Oh man I beg to differ! Windows ME was the crap OS between 98SE and XP. Windows 2000 was the most stable OS I've ever run on my machines.. Eventually XP became better due to the fact that SP2 natively supported so many more things. I made the switch to XP when SP2 came out.

  10. #40
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    Ok, yeah ME was the worste.

    But 2000 was good at being a server and that is it.

    The only other positive I have for 2000, is no activation crap.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

Page 4 of 8 FirstFirst 12345678 LastLast

Similar Threads

  1. iGuidance SDK
    By Quattro in forum GPS
    Replies: 57
    Last Post: 06-23-2006, 07:37 AM
  2. SDK commands over the serial port ????
    By tolisn in forum Road Runner
    Replies: 4
    Last Post: 12-14-2005, 12:03 PM
  3. Developing Touchscreen SDK -- need feedback!
    By kevlar in forum Software & Software Development
    Replies: 3
    Last Post: 07-14-2005, 05:55 PM
  4. Replies: 9
    Last Post: 03-31-2005, 02:40 AM
  5. Destinator 3 SDK features working
    By loscooby in forum GPS
    Replies: 4
    Last Post: 09-21-2004, 12:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •