Announcement

Collapse
No announcement yet.

Sdk?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sdk?

    I'm interested in one of these things, but haven't had time to read through the mega-thread.

    Is there a software development kit available? Just some simple functions that I could include to read/set the inputs and outputs? It seems clunky to let your software run in the background and send commands through that. :S
    www.arbybean.com

  • #2
    Originally posted by Arby View Post
    I'm interested in one of these things, but haven't had time to read through the mega-thread.

    Is there a software development kit available? Just some simple functions that I could include to read/set the inputs and outputs? It seems clunky to let your software run in the background and send commands through that. :S
    Well currently, the program interfaces with a dll provided by Microchip. That dll is free for anyone to use, and it is really really simple to implement. Basically, just call the open port, command, send the stream, receive the stream, and close the port, and then you have sent and received a coded 64byte packet stream. Decoding it is relatively simple. That is the only way right now.

    However we do have a volunteer doing some work on coding a general dll. So it would be your code --> his dll --> microchip's dll --> hardware, so instead of encoding/decoding packet streams, all you have to do is tell which port is what.
    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

    Comment


    • #3
      I thought you were putting together a DLL that would simplify all of that into one COM DLL?... So I didn't have to use that poorly thrown together one that I built for StreetDeck, which reminds me, I need to finish that :P
      "Mess with the best, die like the rest."
      Work Log --> Old Car (Totaled)
      Work Log v2 --> New Car (Totaled)
      Work Log v3 --> GMC Suburban K2500 (Engine died)
      Work Log v4.5 --> 05 Toyota Tundra DC SR5

      Comment


      • #4
        Originally posted by P3D4T0R View Post
        I thought you were putting together a DLL that would simplify all of that into one COM DLL?... So I didn't have to use that poorly thrown together one that I built for StreetDeck, which reminds me, I need to finish that :P
        I was doing it. And I failed at it. I am not very good with writing dlls. I never was able to get shared memory working. However we do have someone who volunteered to help out, and try to get the dll working. He was making great progress on it last I heard. So it is coming hopefully, just not by myself!
        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

        Comment


        • #5
          Awsome... I really want to get the StreetDeck mod working but the DLL's just dont play well at all with it... now
          "Mess with the best, die like the rest."
          Work Log --> Old Car (Totaled)
          Work Log v2 --> New Car (Totaled)
          Work Log v3 --> GMC Suburban K2500 (Engine died)
          Work Log v4.5 --> 05 Toyota Tundra DC SR5

          Comment


          • #6
            Any update on this? I'm particularly interested in knowing how to program directly to the XP/Vista DLL that was recently developed.

            I'm assuming I can just reference the DLL in a VS project, but what are the method signatures, etc? Anything else I need to know?

            Thanks!

            Comment


            • #7
              this is all that is needed to call the device (C#):

              Code:
              public static class FusionUSB
                      {
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern bool FUSB_Initialize(ref UInt32 pFusionUSB, String deviceID, UInt32 instanceNumber);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern bool FUSB_Receive(UInt32 pFusionUSB, byte[] buffer);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern bool FUSB_Send(UInt32 pFusionUSB, byte[] buffer);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern UInt32 FUSB_Free(ref UInt32 pFusionUSB);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern bool FUSB_printf(UInt32 pFusionUSB);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern UInt32 FUSB_GetWinUSBerror(UInt32 pFusionUSB);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern UInt32 FUSB_GetFUSBstatus(UInt32 pFusionUSB);
              
                          [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                          public static extern String FUSB_GetDeviceInstanceID(UInt32 pFusionUSB);
              
                      }
              The easiest way is to initialize first by passing in the device ID and getting a pointer. Then just use send (byte[64]) and then receive which returns a byte[64]. When you are done call Free with passing in the pointer.
              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

              Comment


              • #8
                Excellent!

                I guess my only other question at this point is where I can find your data format for the byte arrays that are sent and received. Sorry in advance if I missed them...

                Comment


                • #9
                  dont forget road runner ;D

                  Comment


                  • #10
                    Anyone??? I have sifted through the source but it would take me forever to trace through everything and take guesses as to what format the data is sent and received in.

                    The software I'm developing requires a custom interface to the Fusion Brains that I have purchased, so I am really in need of this information (the sooner the better).

                    Thank you!

                    Comment


                    • #11
                      Low Level Interface Protocol

                      Ok, the credit goes to Brain Wendt who was kind enough last July to ask me all sorts of questions and compile this excellent document on the low level protocol. I think he is planning something big with his own software so he has been in the dark recently, but thank him for this
                      Attached Files
                      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

                      Comment


                      • #12
                        Thank you -- that is EXACTLY what I was looking for

                        Comment


                        • #13
                          I'd like to access the fusion brain directly from a program I'm developing in Visual Basic 2008 Express. I've found that VB doesn't like the FusionUSB.dll file. If I try to add it as a reference, I get an error that it can't be added saying to make sure that it is "a valid assembly or COM component". Do you have any ideas what I have for options to make this work. Thanks.

                          Comment


                          • #14
                            Dont add it as a reference. Just call it.

                            Here is the sample code for all calls to the dll incase you dont have it:

                            Code:
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern bool FUSB_Initialize(ref UInt32 pFusionUSB, String deviceID, UInt32 instanceNumber);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern bool FUSB_Receive(UInt32 pFusionUSB, byte[] buffer);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern bool FUSB_Send(UInt32 pFusionUSB, byte[] buffer);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern UInt32 FUSB_Free(ref UInt32 pFusionUSB);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern bool FUSB_printf(UInt32 pFusionUSB);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern UInt32 FUSB_GetWinUSBerror(UInt32 pFusionUSB);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern UInt32 FUSB_GetFUSBstatus(UInt32 pFusionUSB);
                            
                                        [System.Runtime.InteropServices.DllImport("FusionUSB.dll")]
                                        public static extern String FUSB_GetDeviceInstanceID(UInt32 pFusionUSB);
                            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

                            Comment


                            • #15
                              Thanks for the speedy reply. I converted the code you posted to VB. For future reference for anyone else, here is what that looks like:

                              Code:
                              Public Class UCSettingsIO
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_Initialize(ByRef pFusionUSB As UInt32, ByVal deviceID As String, ByVal instanceNumber As UInt32) As Boolean
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_Receive(ByVal pFusionUSB As UInt32, ByVal buffer As Byte()) As Boolean
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_Send(ByVal pFusionUSB As UInt32, ByVal buffer As Byte()) As Boolean
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_Free(ByRef pFusionUSB As UInt32) As UInt32
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_printf(ByVal pFusionUSB As UInt32) As Boolean
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_GetWinUSBerror(ByVal pFusionUSB As UInt32) As UInt32
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_GetFUSBstatus(ByVal pFusionUSB As UInt32) As UInt32
                                  End Function
                              
                                  <System.Runtime.InteropServices.DllImport("FusionUSB.dll")> _
                                  Public Shared Function FUSB_GetDeviceInstanceID(ByVal pFusionUSB As UInt32) As String
                                  End Function
                              
                              
                                  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                                      Dim thefbinstid As String = FUSB_GetDeviceInstanceID(0)
                                      MsgBox(thefbinstid)
                                  End Sub
                              End Class
                              The functions look self explanatory as to what they do. The word document you put in reply # 11 explains the data stream to and from the FB. I am confused about the FUSB_GetDeviceInstanceID funtion though. When I run the above code, I get a message box saying "NULL", even with the FB is on. I presume this should be giving me the string I'll need to initialize the device with the FUSB_Initialize function.

                              Comment

                              Working...
                              X