Page 4 of 4 FirstFirst 1234
Results 31 to 38 of 38

Thread: FB v6 & Visual Basic

  1. #31
    Newbie
    Join Date
    Sep 2012
    Posts
    4
    Iamthehor and Sonic,

    I just received my FB and had been watching this thread. The problem with the "cyclic" values stems from the number of bytes you are pulling. Sonic's example has this: Dim _AllAnalogues(64) As Byte (I assumed your Dim is the same). When I use that and your sub it will eventually show the value for pin 15 as pin 14, 13, 12, 11, etc. In between it will show other crazy amounts. My guess is the dll doesn't clear the buffer (or the device doesn't) and requesting an odd number of bytes upsets it?

    Change the Dim to: Dim _AllAnalogues(63) As Byte and the issue goes away. Theoretically you should probably have Dim _AllAnalogues(127) As Byte which will pull all pins from all brains (16 x 4 x 2 bytes each input)

    I look forward to tinkering with this more. I see there is a digital input value type, not sure if it's actually hooked up or not. First try at reading it I get NULL. I did find out that you MUST call find all brains (or perhaps just get brain count) or else the dll doesn't work.

    Regards,
    EluZioN

  2. #32
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,168
    Blog Entries
    51
    Quote Originally Posted by EluZioN View Post
    Iamthehor and Sonic,

    I just received my FB and had been watching this thread. The problem with the "cyclic" values stems from the number of bytes you are pulling. Sonic's example has this: Dim _AllAnalogues(64) As Byte (I assumed your Dim is the same). When I use that and your sub it will eventually show the value for pin 15 as pin 14, 13, 12, 11, etc. In between it will show other crazy amounts. My guess is the dll doesn't clear the buffer (or the device doesn't) and requesting an odd number of bytes upsets it?

    Change the Dim to: Dim _AllAnalogues(63) As Byte and the issue goes away. Theoretically you should probably have Dim _AllAnalogues(127) As Byte which will pull all pins from all brains (16 x 4 x 2 bytes each input)

    I look forward to tinkering with this more. I see there is a digital input value type, not sure if it's actually hooked up or not. First try at reading it I get NULL. I did find out that you MUST call find all brains (or perhaps just get brain count) or else the dll doesn't work.

    Regards,
    EluZioN
    Amazing. I've been waiting for this solution for months, and a new member posts it in his first post lol. I'm gonna release a new version, I believe we've got a keeper.
    -fixed analog array declaration
    -changed conversion formula for new baseline conversion value (from 5 to 3.3)
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  3. #33
    Newbie
    Join Date
    Sep 2012
    Posts
    4
    Glad it works. Disregard the theoretical (127) reference, it's incorrect.
    Now if I could just read the values of the digital outputs before setting them life would be good

    Regards,
    EluZioN

  4. #34
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    Quote Originally Posted by EluZioN View Post
    Iamthehor and Sonic,

    I just received my FB and had been watching this thread. The problem with the "cyclic" values stems from the number of bytes you are pulling. Sonic's example has this: Dim _AllAnalogues(64) As Byte (I assumed your Dim is the same). When I use that and your sub it will eventually show the value for pin 15 as pin 14, 13, 12, 11, etc. In between it will show other crazy amounts. My guess is the dll doesn't clear the buffer (or the device doesn't) and requesting an odd number of bytes upsets it?

    Change the Dim to: Dim _AllAnalogues(63) As Byte and the issue goes away. Theoretically you should probably have Dim _AllAnalogues(127) As Byte which will pull all pins from all brains (16 x 4 x 2 bytes each input)

    I look forward to tinkering with this more. I see there is a digital input value type, not sure if it's actually hooked up or not. First try at reading it I get NULL. I did find out that you MUST call find all brains (or perhaps just get brain count) or else the dll doesn't work.

    Regards,
    EluZioN
    I'm tempted to go back to work at 11PM & try this out. THANK YOU VERY MUCH. My boss will probably not be happy with you tomorrow, however

  5. #35
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    I only had a few minutes to play around today, but this does work. the only thing I've noticed so far is that if I have 2 brains connected, only 1 will display the analog outputs, and it doesn't seem to be tied to instance. I didn't look at it very closely, but changing the instance in my display didn't shift, and initially having the form set to display the voltage/raw from instance 1 port 0 pulled the data from instance 2 port 0. I need to see what was going on there.

  6. #36
    Newbie
    Join Date
    Sep 2012
    Posts
    4
    Quote Originally Posted by Iamthehor View Post
    I only had a few minutes to play around today, but this does work. the only thing I've noticed so far is that if I have 2 brains connected, only 1 will display the analog outputs, and it doesn't seem to be tied to instance. I didn't look at it very closely, but changing the instance in my display didn't shift, and initially having the form set to display the voltage/raw from instance 1 port 0 pulled the data from instance 2 port 0. I need to see what was going on there.
    Hello Iamthehor,

    I made some progress on my days off (figured out how to read existing input status when the program starts) and will soon have a testable dll for a simpler interface with V6(s). It will contain all the needed simple functions as well as configurable triggers with an event that fires on trigger. My issue currrently is related to your issue above in which when an instance is added, another added, then removed I am not sure how to handle that in respects to the functions of the class as I didn't intend to use instances (only numbers). Bigger problem is I only have my one FB6 to test with. If you are interested in helping please drop me a line and i'll send you a copy and a demo program to try it with.

    Thanks,
    EluZioN

  7. #37
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    sent a PM

  8. #38
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    Code:
     Public Sub connect()
            FusionBrain_WinUSB.MainUSBClass.FindAllFusionBrains() ' as it says, finds all fusion brains connected
            TotalInstances = FusionBrain_WinUSB.MainUSBClass.allFusionBrains.Count ' gets count of all fusion brains connected
            FBReadTmr = New System.Windows.Forms.Timer ' initialize the timer which will read analog ports
            AddHandler FBReadTmr.Tick, AddressOf FBReadTmr_Tick ' create event handler for the above timer
            FBReadTmr.Interval = 250 ' set the interval for the timer to loop at 250ms
    
            If TotalInstances > 0 Then 'if a fusion brain is found, start the read timer
                FBReadTmr.Enabled = True
    
            Else
                MsgBox("No Fusion Brain found", vbOKOnly)
                Me.Close()
            End If
    
            Label2.Text = FusionBrain_WinUSB.MainUSBClass.allFusionBrains(1).fusionBrain_devicePathName
            Label1.Text = CStr(TotalInstances)
    
    
    
        End Sub
    The line
    Label2.Text = FusionBrain_WinUSB.MainUSBClass.allFusionBrains(1) .fusionBrain_devicePathName
    seems to stop the sub - but it doesn't give an error. The label1.text.... statement doesn't get executed when the previous is present. Comment it out, it works. the rest of the program runs (read analogIn0 & display the digital value in a text box, turn on/off output 0 based on a checkbox)

    I'm trying to identify 2 (or more) brains & make sure #1 is always connected as instance 1 & #2 is always instance 2. I'm using 62 outputs, it would be bad if the got reversed. I still don't know what _devicePathName returns, since it seems to do nothing. Any tips on a better way to do this would be appreciated.

Page 4 of 4 FirstFirst 1234

Similar Threads

  1. Visual Basic on a Mac
    By sdashiki in forum MacCar
    Replies: 6
    Last Post: 06-08-2005, 03:08 PM
  2. OBD-II and Visual Basic
    By nicgalla in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 10
    Last Post: 05-16-2005, 05:46 PM
  3. Visual Basic & LCD
    By farolfo in forum Software & Software Development
    Replies: 2
    Last Post: 04-28-2004, 12:03 PM
  4. Wmp for Visual Basic
    By Bj in forum Software & Software Development
    Replies: 0
    Last Post: 11-10-2003, 08:07 AM
  5. Visual Basic?
    By pinkysqueaks in forum Software & Software Development
    Replies: 2
    Last Post: 06-25-2001, 11:08 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
  •