Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: New Debugging Skin, and Logging Example!

  1. #1
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221

    New Debugging Skin, and Logging Example!

    Hey guys.

    I couldn't stand studying for finals anymore, so I took a break and wrote a debugging skin in MDX for everyone. It does the following:

    Momentary on/off for outputs
    Analog input display
    Analog input logging

    http://fusioncontrolcentre.com/Tempo...m/TestSkin.rar



    The skin logs all analog inputs, in XML format, under the logs directory. Then, to test the logging, I hooked up a temperature sensor, in a glass of warm-hot water. The temperature plot is below.



    Partway through, I tossed in some ice cubes, which explains the drop.



    And here's what the XML file looks like in excel... super easy to collect data and edit!

  2. #2
    Variable Bitrate dhantiflag's Avatar
    Join Date
    Nov 2006
    Location
    Mentor, OHIO
    Posts
    384
    very nice, im sure this will help alot... i know it woulda me two weeks ago :-)!

  3. #3
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151
    have you tried the outputs with this greenman?
    when I tried them I thought they weren't working, but then I kept clicking 1 and finally I saw an output light up. so then I tried to hold the button to make sure it came on before I released, doing this helped me see why it wasn't looking like it worked, there is a near 1 sec. pause before it turns on, then again when you release the button there's the same pause before it shuts off. it seems like this should be closer to instantaneous, especially for momentary buttons. At first I thought it might be my computer so I tried it on my laptop and got the same pause.

  4. #4
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    Quote Originally Posted by jimp View Post
    have you tried the outputs with this greenman?
    when I tried them I thought they weren't working, but then I kept clicking 1 and finally I saw an output light up. so then I tried to hold the button to make sure it came on before I released, doing this helped me see why it wasn't looking like it worked, there is a near 1 sec. pause before it turns on, then again when you release the button there's the same pause before it shuts off. it seems like this should be closer to instantaneous, especially for momentary buttons. At first I thought it might be my computer so I tried it on my laptop and got the same pause.
    Yup, it's all in the timers. Right now, they're set for 1 second. Adjust as you see fit.

  5. #5
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151
    I don't quite understand the timer stuff, is it just the output timer I adjust for this, and what effect on everything do the timers have?

  6. #6
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151
    ok i adjusted the output timer to "100" and that makes it pretty much instantaneous. one other thing I noticed with your skin is that the output buttons have the vote set to absolute, with it like this there is no "state" change of the buttons and therefore no sense in having both images. If I change this to "vote = attached" then I get a state change when I click. any particular reason why you had it set like this?

  7. #7
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    the timers are parts of the FCC software that actually execute the statements in logic, update graphics, and gather data from inputs, or send to outputs. the number you choose determines how frequently that part of the code executes. there's a counter in each timer section of the source that increments each time it cycles through. the value you put in the skin is when the counter says ok, I've incremented enough, time to actually do something now, and then it runs the code related to that section, comprised of both the hard code, and the code that has been read in from the skin. So if you pick a low number, you will get more samples of data, put data out more frequently, update graphics, or run logic faster, but your CPU usage will rise as well. Bigger number = slower.
    outputs may be all you need, but the actual buttons are worked with in the graphic section, so you may need to adjust that too. Normally, in my experience if the timers aren't multiples of eachother or out of phase, data (button clicking) can get lost. But I'm not yet an expert on how that applies in this software yet (and there's nothing for phase adjustment).

  8. #8
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151
    cool, that explains why my attached image wasn't keeping up with my output, I adjusted the gui to 100 and now the button changes state as quickly as the output changes.

  9. #9
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,034
    Quote Originally Posted by h3rk View Post
    the timers are parts of the FCC software that actually execute the statements in logic, update graphics, and gather data from inputs, or send to outputs. the number you choose determines how frequently that part of the code executes. there's a counter in each timer section of the source that increments each time it cycles through. the value you put in the skin is when the counter says ok, I've incremented enough, time to actually do something now, and then it runs the code related to that section, comprised of both the hard code, and the code that has been read in from the skin. So if you pick a low number, you will get more samples of data, put data out more frequently, update graphics, or run logic faster, but your CPU usage will rise as well. Bigger number = slower.
    outputs may be all you need, but the actual buttons are worked with in the graphic section, so you may need to adjust that too. Normally, in my experience if the timers aren't multiples of eachother or out of phase, data (button clicking) can get lost. But I'm not yet an expert on how that applies in this software yet (and there's nothing for phase adjustment).
    Exactly!

    As to the phase, the history on the analogue inputs could be used so if you only check logic 1 time out of 10 it firesm then in the logic you can do calculations based on any previous value as well to make up for the delay in processing. I would have to think about doing this automatically if the difference got too large I suppose. But that is something for a feature to come 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

  10. #10
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    Quote Originally Posted by jimp View Post
    any particular reason why you had it set like this?

    nope, just ended up that way

Page 1 of 2 12 LastLast

Similar Threads

  1. New Debugging Skin, and Logging Example!
    By greenman100 in forum FB Skins
    Replies: 0
    Last Post: 04-24-2008, 12:23 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
  •