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

Thread: Outputs pulsing for some reason...

  1. #1
    Newbie
    Join Date
    Aug 2008
    Posts
    15

    Question 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. #2
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    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

  3. #3
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    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

  4. #4
    Newbie
    Join Date
    Aug 2008
    Posts
    15
    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?

  5. #5
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    <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

  6. #6
    Newbie
    Join Date
    Aug 2008
    Posts
    15
    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 Attached Files

  7. #7
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    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

  8. #8
    Newbie
    Join Date
    Aug 2008
    Posts
    15
    I have a version 3

  9. #9
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    Do you have two instances of MDX open? (Check task manager)

  10. #10
    Newbie
    Join Date
    Aug 2008
    Posts
    15
    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?

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 38
    Last Post: 03-12-2007, 01:41 PM
  2. No VGA Signal, for no reason?
    By jjh221 in forum General Hardware Discussion
    Replies: 6
    Last Post: 02-10-2005, 09:29 PM
  3. PCI Audio card with balanced outputs ?
    By Maximus in forum Car Audio
    Replies: 0
    Last Post: 02-08-2005, 08:31 AM
  4. Is it possible to map different sound sources to front & rear outputs?
    By Dominik in forum Software & Software Development
    Replies: 8
    Last Post: 09-27-2004, 10:20 AM
  5. Replies: 2
    Last Post: 10-10-2003, 03:31 PM

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
  •