Results 1 to 3 of 3

Thread: Variables to trigger outputs

  1. #1
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151

    Variables to trigger outputs

    Well it seems like I should have a grasp on this by now but I still can't make it work. it is odd because I have 2 outputs one controlled through logic by a thermistor connected to an analog input, and the other controlled through logic by a variable connected to a button.
    the temp controlled one works flawlessly, but the variable controlled one, well I can turn it on but I cant seem to turn it off.
    the logic is almost identical in both circuits, for the temp one I have

    if input9 = 2.35 then trigger output1 on
    and
    if input9 = 2.40 then trigger output1 off

    i can hold the thermistor between my thumb and finger and in seconds the output comes on, then seconds after I release it the output shuts back off

    for the variable one I have

    if variable1 = 1 then trigger output0 on
    and
    if variable1 = 2 then trigger output0 off

    I can click the button and the the output comes on, but when I click it a second time the output stays on.

    I am watching the variable change as it should in the debugger window but the logic doesn't trigger the output back off. I had another then statement that also changed the variable back to "0" and that worked also, I removed it to simplify things, so it is like the logic is working for everything except shutting off the output.
    i have tried all priorities up thru absolute, to no avail. all my timers are set to 100 and seem to be working for the rest.
    here is my logic ;
    Code:
      <!-- Begin Logic Declarations -->
        <all_statements>
          <if fire_on="logic">
            <boolean_operation type="less than or equal to">
              <parameter1>
                <analogue id="Port9" time="0"></analogue>
              </parameter1>
              <parameter2>
                <number>2.35</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 0" vote_opinion="On" vote_priority="Low"></do>
            </then>
          </if>
          <if fire_on="logic">
            <boolean_operation type="greater than or equal to">
              <parameter1>
                <analogue id="Port9" time="0"></analogue>
              </parameter1>
              <parameter2>
                <number>2.4</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 0" vote_opinion="Off" vote_priority="Low"></do>
            </then>
          </if>
          <if fire_on="logic">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="My Variable1"></variable>
              </parameter1>
              <parameter2>
                <number>1</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 1" vote_opinion="On" vote_priority="Low"></do>
            </then>
          </if>
          <if fire_on="logic">
            <boolean_operation type="equal to">
              <parameter1>
                <variable do="get" name="My Variable1"></variable>
              </parameter1>
              <parameter2>
                <number>2</number>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="Trigger Output" functionTargetID="Digital Output 0" vote_opinion="Off" vote_priority="Low"></do>
            </then>
          </if>
        </all_statements>
      <!-- End Logic Declarations -->

  2. #2
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151
    I went back through this and started over, got the same results, so I changed the variables priorities to high leaving the temp priorities set to low. this time it all worked, so I stepped the high priorities down to medium, it still worked so I then stepped the Low priorities to medium(now all 4 logics are set at medium) it still is working, next set all 4 back to low, and it is still working!
    All I can say is it is working now, why it didn't from the start baffles me but oh well.

  3. #3
    Constant Bitrate
    Join Date
    Jan 2008
    Location
    Texas
    Posts
    151
    Ok so now how do I make a variable increment with time instead of button presses?

Similar Threads

  1. HD Radio Mod: Power Antenna Trigger
    By Iceman_jkh in forum Road Runner
    Replies: 51
    Last Post: 06-11-2009, 09:03 AM
  2. PAC TR-7 Trigger Module
    By archimense in forum General Hardware Discussion
    Replies: 5
    Last Post: 04-07-2008, 06:02 PM
  3. *NEW* USB 16 Isolated High Current Digital Outputs, IOPoint-USB
    By bibaja_llc in forum Hardware Development
    Replies: 9
    Last Post: 07-04-2007, 10:47 PM
  4. Trigger wire from Sony Amp..to Where?
    By palmharbor in forum Power Supplies
    Replies: 4
    Last Post: 11-24-2006, 02:43 PM
  5. In-car PC controlling 12v outputs hardware/software ?!?
    By skinhead in forum General MP3Car Discussion
    Replies: 3
    Last Post: 07-18-2006, 01:26 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
  •