Announcement

Collapse
No announcement yet.

New Debugging Skin, and Logging Example!

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

  • 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
    very nice, im sure this will help alot... i know it woulda me two weeks ago :-)!

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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?

          Comment


          • #6
            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?

            Comment


            • #7
              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).
              It's been a while...

              Comment


              • #8
                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.

                Comment


                • #9
                  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

                  Comment


                  • #10
                    Originally posted by jimp View Post
                    any particular reason why you had it set like this?

                    nope, just ended up that way

                    Comment


                    • #11
                      Sorry to resurrect an old thread, but it deals with logging.

                      How can I get the logs to restart and create a new file each day?
                      How can I name them with the date as part of the name, e.g. Log-20080731.xml?
                      What does "StoreBeforeDumping" mean?

                      Comment

                      Working...
                      X