Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: FB v6 & Visual Basic

  1. #21
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Also the -20 temperature means that it is reading back 0v. Generally because it is not connected. Remember that FuseGL knows which port you plugged your brain into. If you plug it into one port configure then unplug and put it in a different port, it is now a new FB. Put it back in the original port and it will remember it was there before.

    The reset pins should be there. If you just have component holes, you can short the holes. Otherwise short the topmost pin of the 1x6 to the left of the reset along with the 3rd pin from the top to reset. Or that top most pin on the 1x6 to any ground point (like the metal of the USB port, or the analogue input grounds).
    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

  2. #22
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    I believe that I had updated the firmware before ever starting this thread, but I did so again
    *IDN?
    *IDN?
    Fusion Brain Version 6
    Fusion Control Centre
    www.FusionControlCentre.com
    SN: 1351884883+
    Firmware Revision: 2.0A
    Firmware Date: 21-05-2011

    I've used the 2 hex files from the thread linked, both give the same results.
    for the VB issue, I don't think the 'remembering' the instance is the issue, i connect at runtime (I will eventually want to set the device s/n to an instance so that I can plug them in independently, but I want to get the analogs working first- walk before running...)

  3. #23
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    BTW -FuseGL reads the analog correctly, hyperterminal reads it correctly, just the VB code I have posted above isn't getting it & I have no idea why.Name:  1.jpg
Views: 133
Size:  25.7 KB

  4. #24
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    This is the exact code used in FuseGL:

    Code:
                    int readInLength = 2 * 64;
                    byte[] readInArray = new byte[readInLength];
                    bool readSuccess = this.ReadDataFromFusionBrain(ref readInArray, 0x02);
                    if (readSuccess)
                    {
                        for(int i=0;i<readInLength;i+=8)
                        {
                             for(int j=0;j<4;j++)
                             {
                                 int aValue_INT = ((readInArray[(i * 1) + (j * 2) + 0] & 0x03) << 8) + readInArray[(i * 1) + (j * 2) + 1];
                                 double aValue_DBL = (this.fusionBrain_version.VREF * ((double)aValue_INT) / (double)this.fusionBrain_version.ANALOGUE_INPUT_MAXVAL);
                                 int dataIndex = (readInArray[(i * 1) + (j * 2) + 0] & 0x0C) >> 2;
                                 int portIndex = (readInArray[(i * 1) + (j * 2) + 0] & 0xF0) >> 4;
    
                                 List<AnalogueInputPortRaw> _portList = null;
    
                                 if (!AllAnalogueInputs.TryGetValue(portIndex, out _portList))
                                 {
                                     _portList = new List<AnalogueInputPortRaw>();
                                     AllAnalogueInputs.Add(portIndex, _portList);
                                 }
    
                                 _portList.Add(new AnalogueInputPortRaw(brainParent: this, port: portIndex, value_INT: aValue_INT));
    
                                 if (_portList.Count > AnalogueInputPortRaw.MAX_HISTORICAL_DATA_POINTS)
                                 {
                                     _portList.RemoveAt(0);
                                 }
                             }
                        }
    I am at work now, but I will compare later.
    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

  5. #25
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    i think i see the difference, its in the initial for loop. Let me do some testing here.

    Edit- Fail. Still dont get it. What is this for loop doing exactly

    Code:
    for(int j=0;j<4;j++)
    It wasnt there at all in the last code snippet you provided me (which is basically what initially posted in this thread converted to vb.net). I dont understand how thats not limiting your analog inputs to the first 5 inputs (0-4 ie value of j as the loop passes).

    And i updated the firmware successfully, confirmed this via serial command, and i still cant get FuseGL to give me analog values. I'm testing this with 3 PCs, 2 different fusion brain v6's. I literally just followed these steps on brand new win7 64bit PC which the FB was never installed on:

    -Download FBv6 Drivers
    -Use device manager to install drivers for fusion brain instance and serial link
    -updated firmware
    -confirmed firmware update via *IDN in hyperterminal
    -Download FuseGL
    -Start FuseGL with FB connected
    -FuseGL auto updated and restarted
    -Hit F10, clicked the click area
    -Space Bar
    -Click Add. set he size of the label
    -Click Sensors, Thermosensor, F
    -Instance 0 (1FB installed on one USB port, confirmed in FB Details file)
    -Analog 0 (where temp sensor installed)
    -named it K
    -Exit config mode

    Label is stuck at -4.923f

    Fuse GL instantly tells me when my fb is connected/disconnected, digital outputs work, but no analog sensors.
    Last edited by Sonicxtacy02; 07-09-2012 at 07:48 PM.
    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

  6. #26
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    Sonic,
    In the "FuseGL Alpha release/FB Details" folder, delete the FB Instances .txt file. I haven't had this issue lately (and I know that I tried it on a dff USB port today), but it has happened (never really tried to recreate it, deleting that file is a good idea when you're testing anyway)

  7. #27
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    I know i'm all over the place in this thread and i appologize but i think i'm getting somewhere in transcribing this code. I dont think we have the latest libraries that need be referenced. I say that because there are variables in your code that dont work when compiling against the .dlls I have. For example, your code has:

    Code:
    double aValue_DBL = (this.fusionBrain_version.VREF * ((double)aValue_INT) / (double)this.fusionBrain_version.ANALOGUE_INPUT_MAXVAL);
    in the .dll build i have, ANALOGUE_INPUT_MAXVAL doesnt exist, the closest match is MAX_ANALOG_INPUTS.

    so i guess the question is where can we get the latest builds, so at least we can be using the same components.
    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

  8. #28
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    The j loop isn't needed but when you have a 128byte endpoint you can read 4 ADC reads at the same time.
    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

  9. #29
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    Quote Originally Posted by 2k1Toaster View Post
    The j loop isn't needed but when you have a 128byte endpoint you can read 4 ADC reads at the same time.
    mind = blown is about all i understand from that. I gotta ask, we have a .dll we reference in order to connect to the FBs, wouldn't it make sense to just create a method to provide the information from that same library to the parent app? Instead of us having to figure this out and the accomodate for changes to firmware/drivers behind the scenes.

    Basically create a GetAnalogRawValue(index, port) function which returns the int value.
    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

  10. #30
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    148
    Sonic, that method existed in the old .dll

    On a related function-request note-
    Is there a way to set a serial number to a specific instance? I have 2 v6, I want them to always be in the same 'order' when connected. I know you can pull the s/n from telnet, can it be done from the .dll as well? (I haven't found a way to do so via VB yet, but that doesn't mean it can't be done.)

Page 3 of 4 FirstFirst 1234 LastLast

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
  •