6 Replies - 1039 Views - Last Post: 11 October 2012 - 06:31 AM Rate Topic: -----

#1 ladybridgeport  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 05-October 12

Need Help with On/Off Buttons for XML

Posted 05 October 2012 - 07:48 AM

I am integrating a Fusion Brain v6 using the software FuseGL, which is only in alpha stage and the creator stopped working on the program so I have to create code to use my Fusion Brain v6. The code file is in XML, Some have used VB.NET to program it. The FuseGL software allows me to create buttons, but has no options to add variable and I need to integrate my HVAC heater controls. First I am working on my blower motor switch. A simple switch where if switch is in the OFF position, the ignition (polarity +) makes the OFF position wire hot and the blower speed positions 1-5 are not hot. When switching blower motor swtich from OFF to position 1, the ignition wire connects to position 1 and OFF position wire is not hot anymore. If I switch the blower to position 2, the OFF position, position 1, 3, 4, and 5 are not hot. This switch is manual and I am going to integrate the blower motor to my fusion brain using six 12vdc relays.

So you probably have an idea of what I'm trying to accomplish, the thing is I don't know how to program the fusion brain with code. Since there are no variables in the FuseGL program, I need help creating the code and not sure which file to edit and I think I need to create variables with boolean or instances so if I click on a button to turn it on, the result will turn off any buttons that are on and only one button will be on at a time. Can anyone write out a template code so I have an idea how to write it so if I turn a button on, it will turn on the digital output and turn all others off? I have dreamweaver, maybe someone can recommend another program or is dreamweaver enough to do what I want?

My vehicle is a 2000 Chevrolet Monte Carlo. It has manual heater controls with vacuum lines. I replacing the manual heater control with a digital heater control with vacuum lines out of a 1999 Chevy Lumina, but the 1992 service manual has the correct wiring for the digital controller.

Posted Image

Here are the parts I'm using to integrate my HVAC: TYCO 12vdc relays:

Posted Image

PC board:

Posted Image

AC Delco 15306155 wire harness so I don't have to cut into my factory harness:

Posted Image

Posted Image

Here is the case I made for the FBv6. It's made of ABS plastic Metra 89-00-9032 and plastic standoffs:

Posted Image

Posted Image

The other case is just for my carputer's power supply:

Posted Image

On my Fusion Brain v6, the digital output 25 is stuck on the on mode, oh well:

Posted Image

My Analog HVAC controller with vacuum lines:

Posted Image

Posted Image

Posted Image

Simply unplug the blower motor harness and connect my white wire harness adapter:

Posted Image

I soldered 18 AWG wire to the PC board:

Posted Image

The reverse side of PC board has my relays:

http://i197.photobuc...ain/HVAC_06.jpg

Posted Image

Now I can connect my harness to the blower harness and solder my wires to Cat6 wire that I ran from the trunk to my concoction. The Cat6 wires are nice because they have a bundle of 20-some gauge wire so it doesn't bulk under the carpet.

Posted Image

Is This A Good Question/Topic? 0
  • +

Replies To: Need Help with On/Off Buttons for XML

#2 ladybridgeport  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 05-October 12

Re: Need Help with On/Off Buttons for XML

Posted 05 October 2012 - 08:58 PM

Here is the xml code for two of my buttons, button 0 and button 1: I'm pretty sure I need a if, then statement to make if button 0 is on, it automatically turns off button 1. Also if I turn on button 1, it will automatically turn off button 0. I will have a total of six buttons. Button 0-5

<?xml version="1.0" encoding="utf-8"?>
<FuseGL_User_Settings>
  <User_Object type="FuseGL_Object">
    <setting type="string" name="GL - BTN - DO[0,0]" />
    <image location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.UserButtonBackground" />
    <image_hover location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.BaseButtonHover" />
    <text text="Toggle: 0" />
    <size width="120" height="30" />
    <location x="135" y="135" z="0" alignment="L" />
    <setting type="int" border_size="1" />
    <setting type="bool" mouse_cursor_to_hand_on_hover="true" />
    <events>
      <startup action="FuseGL.ExecuteCode" inputArgs="ChangeTextOnDigitalOutputChange.cs;FuseGL_TextManipulation.InternalFlyCompile_ChangeTextOnDigitalOutputChange;ChangeButtonTextOnDigitalOutputPersistant;{FB.DigitalOutput(0.0)};{this.text};Turn off: 0;Turn on: 0;" outputTo="this.text.text" />
      <onmousedown action="FB.ToggleDigitalOutput" inputArgs="Port:0.0" />
    </events>
  </User_Object>
  <User_Object type="FuseGL_Object">
    <setting type="string" name="GL - BTN - DO[0,1]" />
    <image location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.UserButtonBackground" />
    <image_hover location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.BaseButtonHover" />
    <text text="Toggle: 1" />
    <size width="120" height="30" />
    <location x="135" y="195" alignment="left" z="0.0" />
    <setting type="int" border_size="1" />
    <setting type="bool" mouse_cursor_to_hand_on_hover="true" />
    <events>
      <startup action="FuseGL.ExecuteCode" inputArgs="ChangeTextOnDigitalOutputChange.cs;FuseGL_TextManipulation.InternalFlyCompile_ChangeTextOnDigitalOutputChange;ChangeButtonTextOnDigitalOutputPersistant;{FB.DigitalOutput(0.1)};{this.text};Turn off: 1;Turn on: 1;" outputTo="this.text.text" />
      <onmousedown action="FB.ToggleDigitalOutput" inputArgs="Port:0.1" />
    </events>
  </User_Object>
</FuseGL_User_Settings>


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 11 October 2012 - 06:30 AM

Was This Post Helpful? 0
  • +
  • -

#3 ladybridgeport  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 05-October 12

Re: Need Help with On/Off Buttons for XML

Posted 06 October 2012 - 01:28 PM

This is what I came up with so far, not sure about variable name. A guy from work said to create an instance. The program describes fusion brain and ports as (0,0), (0,1) The (0...is the fusion brain number, I can connect up to 15 fusion brains. The ...,0) is the port number so fusion brain number 0 on port 0 is (0,0). Fusion brain 0 on port 1 is (0,1). I'm hoping by adding the following if, then statement it will automatically turn off all ports excdpt the port that is turned on.

<rule>
    <if>
        <conditions>
            <condition var="GL - BTN - DO[0,0]" operator="true"></condition>
            <!-- more conditions possible -->
        </conditions>
        <then>
            <condition var="GL - BTN - DO[0,1]" operator="false"></condition>
        </then>
    </if>
    <elseif>
        <conditions></conditions>
        <statements></statements>
    </elseif>
    <else>
        <statements></statements>
    </else>
</rule>


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 11 October 2012 - 06:30 AM

Was This Post Helpful? 0
  • +
  • -

#4 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1369
  • View blog
  • Posts: 4,737
  • Joined: 19-February 09

Re: Need Help with On/Off Buttons for XML

Posted 07 October 2012 - 08:40 PM

It would seem that there should be an action to switch a button off.

Something like this may toggle, but a switch off would be better

<statement action="FB.ToggleDigitalOutput" inputArgs="Port:0.1" /></statement>




A guess at a simple rule.

<rule>
<if>
  <conditions>
    <condition var="GL - BTN - DO[0,0]" operator="true"></condition>
  <conditions>
  <then> 
    <statements>
      <statement action "turn another button off"></statement>
    </statements>
  </then>
</if>
</rule>


Was This Post Helpful? 0
  • +
  • -

#5 ladybridgeport  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 05-October 12

Re: Need Help with On/Off Buttons for XML

Posted 08 October 2012 - 04:02 PM

I found this code for toggle a can node:

/* Toggle CAN Outputs */
void toggleCanOutputs(MPICan can, long nodeNumber, long channelCount)
{
    long            returnValue;
    long            channel;
   MPICanNodeInfo canNodeInfo;

    /* Find out how many digital outputs this node supports. */
    returnValue =
        mpiCanNodeInfo(can, nodeNumber, &canNodeInfo);
    msgCHECK(returnValue);

    /* Turn off all the digital outputs. */
   if( canNodeInfo.digitalOutputCount < 32 ) {
       mpiCanNodeDigitalOutSet(can, nodeNumber, 0, canNodeInfo.digitalOutputCount, 0, 1 );
   } else {
      mpiCanNodeDigitalOutSet(can, nodeNumber, 0, 32, 0, 1 );
      mpiCanNodeDigitalOutSet(can, nodeNumber, 32, canNodeInfo.digitalOutputCount - 32, 0, 1 );
   }

    /* Set each output bit in turn. */
    for(channel = 0; channel<CHANNEL_COUNT; channel++) {
        /* Turn digital output "on" */
        returnValue =
          mpiCanNodeDigitalOutSet(can, nodeNumber, channel, 1, 1, 1 );
        msgCHECK(returnValue);

        /* Pause for one half second */
        mpiPlatformSleep(500);

        /* Turn digital output "off" */
        returnValue =
          mpiCanNodeDigitalOutSet(can, nodeNumber, channel, 1, 0, 1 );
        msgCHECK(returnValue);
    }
}


The above (Turn digital output "off") uses mpiCanNodeDigitalOutSet. I need to find the right label for my version. I think I may have to use FB.ToggleDigitalOutput replaced with FB.DigitalOutputSet unless someone knows the specific command for turning it off? Feel free to give you insight.

MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 11 October 2012 - 06:30 AM

Was This Post Helpful? 0
  • +
  • -

#6 ladybridgeport  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 05-October 12

Re: Need Help with On/Off Buttons for XML

Posted 09 October 2012 - 09:27 PM

I found the code instead of FB.ToggleDigitalOutput I use FB.TurnOffDigitalOutput

<User_Object type="FuseGL_Object">
    <setting type="string" name="Digital Output Test Button OFF" />
    <image location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.BaseButton" />
    <image_hover location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.BaseButtonHover" />
    <image_click location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.BaseButtonHover" />
    <text text="Turn On 0.10" />
    <setting type="bool" mouse_cursor_to_hand_on_hover="true" />
    <size width="200" height="33" />
    <location x="100" y="150" z="0" alignment="center" />
    <events>
      <startup action="FuseGL.ExecuteCode" inputArgs="Config/FlyCompile_ButtonManipulationCodeTest.cs;FuseGL_ButtonManipulation.FlyCompile_ButtonManipulationCodeTest;ChangeButtonTextOnDigitalOutputPersistant;{FB.DigitalOutput(0.10)};{this.text};" outputTo="this.text.text" />
      <onmousedown action="FB.TurnOffDigitalOutput" inputArgs="Port:0.0" />
      <onmousedown action="FB.TurnOffDigitalOutput" inputArgs="Port:0.1" />
      <onmousedown action="FB.TurnOffDigitalOutput" inputArgs="Port:0.2" />
      <onmousedown action="FB.TurnOffDigitalOutput" inputArgs="Port:0.3" />
      <onmousedown action="FB.TurnOnDigitalOutput" inputArgs="Port:0.4" />
    </events>
  </User_Object>


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 11 October 2012 - 06:30 AM

Was This Post Helpful? 0
  • +
  • -

#7 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6078
  • View blog
  • Posts: 23,546
  • Joined: 23-August 08

Re: Need Help with On/Off Buttons for XML

Posted 11 October 2012 - 06:31 AM

For the love of GOD! When you post code, USE CODE TAGS!!!

:code:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1