|
 |
04-17-2009, 05:00 AM
|
#1
|
|
Newbie
Join Date: Aug 2008
Posts: 15
|
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>
|
|
|
|
|
|
Advertisement
|
Sponsored links
|
04-17-2009, 11:54 PM
|
#2
|
|
Fusion Brain Creator
Join Date: Mar 2005
Posts: 2,197
|
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
|
|
|
04-18-2009, 12:09 AM
|
#3
|
|
Fusion Brain Creator
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
|
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.
|
|
|
04-18-2009, 06:14 AM
|
#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?
|
|
|
04-18-2009, 03:46 PM
|
#5
|
|
Fusion Brain Creator
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
|
<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.
|
|
|
04-19-2009, 01:22 AM
|
#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?
|
|
|
04-19-2009, 01:36 AM
|
#7
|
|
Fusion Brain Creator
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
|
Do you have a version 3 or version 4 FB?
|
|
|
04-19-2009, 04:36 AM
|
#8
|
|
Newbie
Join Date: Aug 2008
Posts: 15
|
I have a version 3
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
04-19-2009, 09:33 AM
|
#9
|
|
Fusion Brain Creator
Join Date: Mar 2005
Posts: 2,197
|
Do you have two instances of MDX open? (Check task manager)
|
|
|
04-20-2009, 07:08 AM
|
#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?
|
|
|
04-20-2009, 08:10 AM
|
#11
|
|
Fusion Brain Creator
Join Date: Mar 2005
Posts: 2,197
|
have you tried MX270's software?
|
|
|
04-20-2009, 04:18 PM
|
#12
|
|
Fusion Brain Creator
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
|
Quote: Originally Posted by QuickSSilver 
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?
|
|
|
04-20-2009, 05:09 PM
|
#13
|
|
Newbie
Join Date: Aug 2008
Posts: 15
|
Quote: Originally Posted by greenman100 
have you tried MX270's software?
No, where do I find this? I've tried searching but can't find it.
|
|
|
04-23-2009, 10:58 AM
|
#14
|
|
Low Bitrate
Join Date: Jun 2004
Posts: 98
|
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)
|
|
|
04-24-2009, 05:40 AM
|
#15
|
|
Newbie
Join Date: Aug 2008
Posts: 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!
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:11 AM.
| |