Results 1 to 4 of 4

Thread: I need help!

  1. #1
    Low Bitrate GadgetBandit's Avatar
    Join Date
    Oct 2008
    Posts
    100

    I need help!

    I need to fire a relay for ~1 min. ~ every 20 min.

    I'm assumming one function would increment a variable. Another function would fire the relay(with another incrementing variable) and reset the variable. I don't know. Would someone please help?

    GabgetBandit.

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

    What are your 4 timers set at?

  3. #3
    Maximum Bitrate bratnetwork's Avatar
    Join Date
    Oct 2007
    Location
    Haledon, NJ
    Posts
    503
    Set your logic timer for 100 so that way your logic will run 10 times every second

    If you want to trigger this sequence from a button make a button that will set set a variable to 600.

    Code:
    <button id="OneMinuteEnable" enabled="yes" function="change variable" functionTargetID="OneMinuteVariable" vote_opinion="600" vote_priority="High">
            <images imagePrimary="content\images\button_images\button_down.png" imageSecondary="content\images\button_images\button.png" imageDisabled="content\images\button_images\button.png" imagePushed="content\images\button_images\button_down.png"></images>
            <display size="230,70" location="287,75" page="0" z_order="0.9"></display>
            <vote_options minimum_delta_vote_time_down="20"></vote_options>
            <text font="verdana" font_size="25"></text>
            <text colourPrimaryARGB="255,255,255,255" textPrimary="Windows Down"></text>
            <text colourSecondaryARGB="255,255,255,255" textSecondary="Windows Down"></text>
          </button>
    Then in your logic code it to something like this:

    Code:
    <if fire_on="logic" minimum_delta_vote_time="100" id="one_minute_logic">
            <boolean_operation type="greater than">
              <parameter1>
                <variable do="get" name="OneMinuteVariable"></variable>
              </parameter1>
              <parameter2>
                <number>0</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 5" vote_opinion="On" vote_priority="Medium"></do>
    		  <do function="Change Variable" functionTargetID="OneMinuteVariable" vote_opinion="d-1" vote_priority="Medium"></do>
            </then>
          </if>
    That will trigger the output on for 1 minute but then you need a logic like this to turn it off:

    Code:
    <if fire_on="logic" minimum_delta_vote_time="100" id="one_minute_stop_logic">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="OneMinuteVariable"></variable>
              </parameter1>
              <parameter2>
                <number>0</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 5" vote_opinion="Off" vote_priority="low"></do>
            </then>
          </if>
    Now you would add to that the logic for the 20 minute rest using the same concept as above then after the 20 minuted it would set the variable back to 600 starting the whole process over again...

    Hope this gets you on the right track and hopefully my logics work properly... i used them once before and they worked but i modified them a bit to fit what you wanted,

  4. #4
    Low Bitrate GadgetBandit's Avatar
    Join Date
    Oct 2008
    Posts
    100
    What an excellent example!! Worked great. By the time I got done with my part . . . it didn't work, but I'm close. I didn't realize when I asked today, but the samples you put up, moved my greenhouse to the next level. If the MDX can count to 864000, I've got DAILY cycles!!! Thank you.

    GadgetBandit

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
  •