Announcement

Collapse
No announcement yet.

Outputs pulsing for some reason...

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

  • Outputs pulsing for some reason...

    I am having problems implementing a simple button system. There is one button for turning an output on, and another for turning it off. The way I have implemented this is having the "on" button set a variable to 1 and an "off" button setting the variable to 0.

    There are then two corresponding logic statements. If the variable is equal to 1, set the output to on at high priority. If the the variable is equal to 0, then set the output to off at low priority. Buttons can only be clicked once a second.

    For some reason when the "on" button is clicked the relay I have hooked up to the output clicks on and off rapidly. When the "off" button is pushed, the relay de-energises and remains off. Is this simply a (logic/voting) timing problem?

    I have attached relevant parts of my FusionConfiguration.xml file

    Code:
     
    <!-- Begin Display Buttons -->
          <button id="Subsonic On" enabled="yes" function="change variable" functionTargetID="var_Subsonic" vote="absolute" vote_opinion="+1" vote_priority="High">
            <images imagePrimary="content\images\button_images\Shaker_ON_Test.png" imageSecondary="content\images\button_images\Shaker_ON_Test.png" imageDisabled="content\images\button_images\Shaker_ON_Test.png" imagePushed="content\images\button_images\Shaker_ON_Test.png"></images>
            <display size="100,75" location="417,340" page="0" z_order="0"></display>
            <vote_options minimum_delta_vote_time_down="100" ></vote_options>
          </button>
          <button id="Subsonic Off" enabled="yes" function="change variable" functionTargetID="var_Subsonic" vote="absolute" vote_opinion="+0" vote_priority="Low">
            <images imagePrimary="content\images\button_images\Shaker_OFF_Test.png" imageSecondary="content\images\button_images\Shaker_OFF_Test.png" imageDisabled="content\images\button_images\Shaker_OFF_Test.png" imagePushed="content\images\button_images\Shaker_OFF_Test.png"></images>
            <display size="100,75" location="417,421" page="0" z_order="0"></display>
            <vote_options minimum_delta_vote_time_down="100" ></vote_options>
          </button>
      <!-- End Display Buttons -->
    
    <!-- Begin Timer Setup -->
          <timer id="input" interval="200"></timer>
          <timer id="output" interval="200"></timer>
          <timer id="gui" interval="30"></timer>
          <timer id="logic" interval="200"></timer>
      <!-- End Timer Setup -->
    
      <!-- Begin Variable Declarations -->
        <all_variables>
           <variable name="var_Subsonic">0</variable>
          </all_variables>
      <!-- End Variable Declarations -->
    
      <!-- Begin Logic Declarations -->
          <if fire_on="logic" minimum_delta_vote_time="1000" id="Subsonic_Off">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="var_Subsonic"></variable>
              </parameter1>
              <parameter2>
                <number>0</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Subsonic" vote_opinion="Off" vote_priority="Low"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="1000" id="Subsonic_On">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="var_Subsonic"></variable>
              </parameter1>
              <parameter2>
                <number>1</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Subsonic" vote_opinion="On" vote_priority="High"></do>
            </then>
          </if>
        </all_statements>
      <!-- End Logic Declarations -->
      </logic>
    </FusionControlCentreConfiguration>

  • #2
    your first button is setting it to 1, the second button setting it to 0

    get rid of the second button and re-run the test

    Comment


    • #3
      Dont need to use a variable at all to have 1 button turn an output on and the other turn it off.

      In the button's vote, have it directly manipulate the output but set the vote opinion to "on" or "off" instead of "toggle". Then assign 1 to turn it on, and the other to turn it off.

      Problem solved, no logic blocks needed.
      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


      • #4
        Thanks for the responses guys. The reason why I was doing it through variables was to debug the oscillating outputs through the variables window. Setting the variable to 0 and 1 via the on-screen buttons works fine. Just that the output oscillates on / off.

        Toaster, I am not sure what you mean by "directly manipulate the output but set the vote opinion to "on" or "off" instead of "toggle"". I believe this is what I am doing in the code (albeit going via a variable). I will go back to the setup I had before (without the variables) and see if there are any modifications I can make along those lines.... Is there anything wrong with the code I pasted?

        Comment


        • #5
          <button id="Subsonic Off" enabled="yes" function="change variable" functionTargetID="var_Subsonic" vote="absolute" vote_opinion="+0" vote_priority="Low">

          to

          <button id="Subsonic Off" enabled="yes" function="toggle output" functionTargetID="Subsonic" vote="Off" vote_opinion="Off" vote_priority="Low">

          and similar to the other button, just change off to on. That's all that's needed.
          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


          • #6
            I've just tried eliminating the variable for setting the "Subsonic" output and setting it directly via the buttons. Still no luck. The output just keeps turning on / off / on / off according to the value of the output timer when the button is pushed. I have even tried changing the priorities - "on" to "high" and "off" to "low" to see if this makes a difference. It didn't.

            Funnier still, when I set the defaultstate for that output to "on" and remove the buttons controlling the output, it still toggles on / off / on / off once MDX has loaded.

            Using the "TestSkin" provided on the forum, the output works fine for the momentary push button for that output.

            I've attached my entire xml config file. Can you have a look through to it to see what could be causing this strange issue?
            Attached Files

            Comment


            • #7
              Do you have a version 3 or version 4 FB?
              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
                I have a version 3

                Comment


                • #9
                  Do you have two instances of MDX open? (Check task manager)

                  Comment


                  • #10
                    No, there is only one version of MDX open. Still can't figure this one out...

                    Maybe start from scratch with a skin with one button?

                    Comment


                    • #11
                      have you tried MX270's software?

                      Comment


                      • #12
                        Originally posted by QuickSSilver View Post
                        No, there is only one version of MDX open. Still can't figure this one out...

                        Maybe start from scratch with a skin with one button?
                        Well I cant open your config file because I need a function you made for the battery converter as well as the images.

                        Can you please zip up your entire MDX directory, exe and all, and post it here so I can test.

                        Also what version is your MDX?
                        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


                        • #13
                          Originally posted by greenman100 View Post
                          have you tried MX270's software?
                          No, where do I find this? I've tried searching but can't find it.

                          Comment


                          • #14
                            VB 2k8 code by MX270a:
                            http://www.mp3car.com/vbulletin/fb-s...ion-brain.html

                            I've been using it & it works well for v3 or v4 (but not with a v3 & v4 running at the same time - see my thread on .dll instances)

                            Comment


                            • #15
                              OK, I've found the problem!

                              It seems as though if I only have two digital outputs and their on/off buttons defined in my config file the outputs pulse on/off when they should be triggered on.

                              When I add all of the other (unused at the moment) digital outputs to the config file and set their default state to "off" the buttons work fine and the outputs stay "triggered". Strange!

                              Comment

                              Working...
                              X