Results 1 to 4 of 4

Thread: Logic Issue

  1. #1
    Maximum Bitrate bratnetwork's Avatar
    Join Date
    Oct 2007
    Location
    Haledon, NJ
    Posts
    503

    Logic Issue

    I have 3 buttons that I want to control the power of my amplifiers. I have 2 amplifiers and each turn on lean runs through a relay. "Main Amp" button triggers output 0 and "Sub Amp" button triggers output 1. Now I want a "All Amps" button to trigger both outputs.

    I made a button like this:
    Code:
    <button id="ALL_AMPS" enabled="yes" function="change variable" functionTargetID="amps" vote_opinion="d+1" vote_priority="medium">
            <images imagePrimary="content\images\button_images\button_center_down.png" imageSecondary="content\images\button_images\button_center.png" imageDisabled="content\images\button_images\button_center.png" imagePushed="content\images\button_images\button_center_down.png"></images>
            <display size="254,74" location="257,367" page="0" z_order="0.9"></display>
            <vote_options minimum_delta_vote_time_down="20" ></vote_options>
    		<text font="verdana" font_size="18"></text>
            <text colourPrimaryARGB="255,255,255,255" textPrimary="All Amplifiers"></text>
            <text colourSecondaryARGB="255,255,255,255" textSecondary="All Amplifiers"></text>
          </button>
    Then a Variable:
    Code:
    <variable name="amps">0</variable>
    Then my logic statement:
    Code:
    <if fire_on="logic" minimum_delta_vote_time="100" id="amps_off">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="amps"></variable>
              </parameter1>
              <parameter2>
                <number>1</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 0" vote_opinion="on" vote_priority="medium"></do>
              <do function="Trigger Output" functionTargetID="Digital Output 1" vote_opinion="on" vote_priority="medium"></do>
    		  <do function="Change Variable" functionTargetID="amps" vote_opinion="2" vote_priority="medium"></do>
    		</then>
          </if>
    	  <if fire_on="logic" minimum_delta_vote_time="100" id="amps_on">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="amps"></variable>
              </parameter1>
              <parameter2>
                <number>3</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 0" vote_opinion="off" vote_priority="medium"></do>
              <do function="Trigger Output" functionTargetID="Digital Output 1" vote_opinion="off" vote_priority="medium"></do>
    		  <do function="Change Variable" functionTargetID="amps" vote_opinion="0" vote_priority="medium"></do>
    		</then>
          </if>
    Now in theory when I click the button the variable should change to 1 and trigger both outputs 0 and 1, then change the variable to 2. Then when I click the button again it should change the variable to 3 and trigger the outputs 0 and 1 again and reset the variable back to 0.

    Now in reality when I click the button it changes the variable to 1 but nothing happens to the outputs. When i click the button again it changes to 2 for a split second then goes back to 1. I can hit the button 100 times and it does the same. If I take out the logic statement the variable goes up by 1 every time I hit the button as it should.

    I made the logic in the configurator. The variable "amps" is not used in any other part of my logic other than a text label just so I can monitor it since it wasn't working. Am I doing something wrong in the logic? I remember in pre-mdx software you could link buttons together. Is this still an option also?

  2. #2
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Can you try changing vote_priority="medium" to vote_priority="high" for the amps=2?
    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

  3. #3
    Maximum Bitrate bratnetwork's Avatar
    Join Date
    Oct 2007
    Location
    Haledon, NJ
    Posts
    503
    I went through my config file and deleted some stuff I don't need that is unrelated to the "amps" logic and I didn't test it before i did that today but now the numbers go up by 1 each time you hit the button w/o it jumping back, but it still does not trigger the logic for that variable.

    I tried changing the priority as you suggested and no difference.

  4. #4
    Maximum Bitrate bratnetwork's Avatar
    Join Date
    Oct 2007
    Location
    Haledon, NJ
    Posts
    503
    So weird... At one point the variable was changing as it should, but with much delay, and the outputs weren't triggering. Then it just stopped working all together again... just goes up by one each time you press the button. Tried changing the button priority to "low" and the logic variables to "high" like you suggested above and the output statements in the logic to "high" and still nothing. Also tried it on a second computer with same results.

Similar Threads

  1. DigitalFX 4.0
    By JohnWPB in forum RR Skins No Longer Supported
    Replies: 5576
    Last Post: 03-27-2014, 05:48 PM
  2. **Please help!! disk drive/windows issue
    By Phoenix750 in forum General Hardware Discussion
    Replies: 26
    Last Post: 05-12-2009, 12:38 PM
  3. HP Laptop LCD Exstension issue
    By kendallb in forum LCD/Display
    Replies: 3
    Last Post: 03-22-2009, 07:16 PM
  4. My RR/DFX 4.0 100% CPU usage issue
    By Minoritydan in forum RR Bug Tracker
    Replies: 27
    Last Post: 12-23-2008, 01:40 PM
  5. No audio after resume from hibernate issue - almost fixed - Help me finish?
    By Trin in forum Software & Software Development
    Replies: 0
    Last Post: 07-26-2008, 08:35 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
  •