Page 2 of 7 FirstFirst 1234567 LastLast
Results 11 to 20 of 63

Thread: MDX and COM big update

  1. #11
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,691
    Blog Entries
    1
    Ok, I see the examples on how to tell RR to do something, but how do you tell MDX from RR what to do? (Turn on digital output 1) as well as check the status so an indicator can be on/off based on the state of digital output 1.

    Also how would you pull information into RR such as temperature probe hooked to Analog in 1 and have it automatically update?
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

  2. #12
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    Quote Originally Posted by JohnWPB View Post
    Ok, I see the examples on how to tell RR to do something, but how do you tell MDX from RR what to do? (Turn on digital output 1) as well as check the status so an indicator can be on/off based on the state of digital output 1.

    Also how would you pull information into RR such as temperature probe hooked to Analog in 1 and have it automatically update?
    rrfusion might be the way to go here

  3. #13
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Commands sent from RoadRunner and interpreted by MDX:

    MDX Code:
    Code:
          <commands>
            <command id="RoadRunnerCommand" minimum_delta_vote_time="100">
              <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>
            </command>
          </commands>
    RoadRunner Code:
    Code:
    /, B, x, y, w, h, Command;COMMANDCODES, Tooltip
    B02,348,70,104,75,"fusion_vote_RoadRunnerCommand",""
    What it does:
    When the button on RoadRunner is pressed, the command "RoadRunnerCommand" is sent to MDX. MDX will only recognize commands that first are fusion related, and that are of the vote type. I have set this to be seperated by underscored. So "fusion_vote_ZombieAttack" will send the command "ZombieAttack" to MDX. MDX will then look in the COM section of your configuration file under the <commands> tag for each <command> element. If the <command> element id equals that of the command receives it executes its votes (the <do> elements). The syntax is identical to those called from if/then logic blocks.

    ** Note: I am not a RoadRunner skinner guru, but I am guessing you can send that command from RoadRunner more ways than just a button. But I havent tried very hard to find out if it can be done some other way. I am sure a guru around here can elaborate.

    ==================================================
    ==================================================

    Commands sent from MDX and interpreted by RoadRunner:

    MDX Code in the COM area:
    Code:
          <executable_commands>
            <external_COM_id id="RoadRunner.SDK">
              <command internal_id="RoadRunnerCommand_PLAY" external_command="Execute">
                <parameter order="0" external_command_parameter="PLAY" />
              </command>
            </external_COM_id>
          </executable_commands>
    MDX Code to activate:
    Code:
          <button id="NINJABUTTON_COM_TEST" enabled="yes" function="external command" functionTargetID="roadrunnercommand_play" vote="filler" vote_opinion="filler" vote_priority="Medium">
            ...
            <vote_options minimum_delta_vote_time_down="20" ></vote_options>
            ...
          </button>
    RoadRunner Code:
    Internal to RoadRunner. Things like PLAY, STOP, MUTE, MINIMIZE, whatever else I am not sure. Like I said, I am no guru, RR takes care of that.

    What it does:
    When a button or logical if/then node, or remote control or even a received COM command from RoadRunner vote with their function tag being equal to "external command" and the functionTargetID equal to the id of a command (in this case "roadrunnercommand_play") then it will execute the command at the given application. So the function of "Execute" is being called in "RoadRunner.SDK", and the parameter "PLAY" is being passed in. So basically it is calling: (RoadRunner.SDK).Execute("PLAY"). If you want to send "KABLOOM" to RoadRunner, then change "PLAY" to "KABLOOM". And if you want to send "PENGUIN" to some application that exposes itself at "WildLifeThing" with the command "Add", then change "PLAY" to "PENGUIN", "Execute" to "Add", and "RoadRunner.SDK" to "WildLifeThing".

    ==================================================
    ==================================================

    Values sent from MDX and displayed by RoadRunner:

    MDX Code:
    Nothing specific, it is built off of any configuration file.

    RoadRunner Code:
    Code:
    /, L, x, y, w, h, color R;RGB, G, B, font size;FONT, font name, Code;LABELCODES, Tooltip;LABELALIGNMENT
    L03,260,10,150,30,255,255,255,18,"Arial Narrow:B","fusion_ai_0", ""
    L04,410,10,180,30,128,255,128,18,"Arial Narrow:B","fusion_ai_0_3", ""
    L03,260,10,150,30,255,255,255,18,"Arial Narrow:B","fusion_do_0", ""
    L03,260,10,150,30,255,255,255,18,"Arial Narrow:B","fusion_di_0", ""
    L05,260,40,150,30,255,255,255,18,"Arial Narrow:B","fusion_varbool_0", ""
    L06,410,40,180,30,128,255,128,18,"Arial Narrow:B","fusion_varnum_0", ""
    What it does:
    When a RoadRunner label is set to that above, it will poll MDX automatically. Like before, MDX only tries to interpret things that begin with "fusion".
    The next field is the type, which can be "ai", "do", "di", "varbool", "varnum" which give you back respectively: analogue input, digitial output, digital input, boolean variable, numeric variable.
    The next number is the index. 0 means the 1st one, 4 means the 5th one. The number is determined by the order in the configuration file, NOT the port number. 0th item is the top of the file, Nth item is at the end of the file.
    The optional fourh parameter is the decimal precision, only works on analogue inputs.
    These will automatically update as RoadRunner constantly polls.

    ==================================================
    ==================================================
    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

  4. #14
    Low Bitrate bigbuffs's Avatar
    Join Date
    Nov 2007
    Posts
    109
    OK 2k1, could you tell me how to code it so that I can send a SWC to RR through the COM port. Basically just trying to convert the code below to go through the COM port.
    Code:
    - <logic>
    - <!-- Begin Logging Setup
    -->
    <all_logging />
    - <!-- End Logging Setup
    -->
    - <!-- Begin Variable Declarations
    -->
    <all_variables />
    - <!-- End Variable Declarations
    -->
    - <!-- Begin Logic Declarations
    -->
    - <all_statements>
    - <if fire_on="logic" minimum_delta_vote_time="100">
    - <boolean_operation type="and">
    - <parameter1>
    - <boolean_operation type="less than">
    - <parameter1>
    <analogue id="swc" time="0" />
    </parameter1>
    - <parameter2>
    <number>2.5</number>
    </parameter2>
    </boolean_operation>
    </parameter1>
    - <parameter2>
    - <boolean_operation type="greater than">
    - <parameter1>
    <analogue id="swc" time="0" />
    </parameter1>
    - <parameter2>
    <number>1.9</number>
    </parameter2>
    </boolean_operation>
    </parameter2>
    </boolean_operation>
    - <then>
    <do function="Send Key" functionTargetID="RoadRunner" vote_opinion="DOWN" vote_priority="High" />
    </then>
    </if>
    </all_statements>
    - <!-- End Logic Declarations
    -->
    </logic>
    [||||||----] - 60% Complete

  5. #15
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by bigbuffs View Post
    OK 2k1, could you tell me how to code it so that I can send a SWC to RR through the COM port. Basically just trying to convert the code below to go through the COM port.
    Code:
    - 
    <general>
      <com>
          <executable_commands>
            <external_COM_id id="RoadRunner.SDK">
              <command internal_id="RoadRunnerCommand_PLAY" external_command="Execute">
                <parameter order="0" external_command_parameter="PLAY" />
              </command>
            </external_COM_id>
          </executable_commands>
      </com>
    </general>
    
    <logic>
    - <!-- Begin Logging Setup
    -->
    <all_logging />
    - <!-- End Logging Setup
    -->
    - <!-- Begin Variable Declarations
    -->
    <all_variables />
    - <!-- End Variable Declarations
    -->
    - <!-- Begin Logic Declarations
    -->
    - <all_statements>
    - <if fire_on="logic" minimum_delta_vote_time="100">
    - <boolean_operation type="and">
    - <parameter1>
    - <boolean_operation type="less than">
    - <parameter1>
    <analogue id="swc" time="0" />
    </parameter1>
    - <parameter2>
    <number>2.5</number>
    </parameter2>
    </boolean_operation>
    </parameter1>
    - <parameter2>
    - <boolean_operation type="greater than">
    - <parameter1>
    <analogue id="swc" time="0" />
    </parameter1>
    - <parameter2>
    <number>1.9</number>
    </parameter2>
    </boolean_operation>
    </parameter2>
    </boolean_operation>
    - <then>
    <do function="external command" functionTargetID="roadrunnercommand_play" vote_opinion="fluffy bunny" vote_priority="High" />
    </then>
    </if>
    </all_statements>
    - <!-- End Logic Declarations
    -->
    </logic>

    Like that.

    Exactly as I said in the post #13. The voting area's function was changed to external command, the targetID was changed to the command. Then in the general area the com part was added with an identical command id and where and what to do when called.

    Also make sure all those hyphens on the left side arent in your final code. It's odd that they are there.
    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

  6. #16
    Low Bitrate bigbuffs's Avatar
    Join Date
    Nov 2007
    Posts
    109
    OK thanks a lot I'll give it a try. I'm not sure whats up with the hyphens they showed up after some copying and pasting
    [||||||----] - 60% Complete

  7. #17
    Constant Bitrate stealinfool's Avatar
    Join Date
    Dec 2005
    Location
    Orlando
    Posts
    142
    I'm having some issues with getting RR's COM stuff to work. I can't even get the test Ninja button to work.

    I believe I've followed the examples well enough (copy and paste work wonders) but here is my conf file slimmed down a bit

    Code:
    ...
      <general>
      <!-- Begin Remote Control Configuration -->
        <remote status="disabled" user_name="default" port="4242"></remote>
      <!-- End Remote Control Configuration -->
    
    <com status="enabled">
          <executable_commands>
            <external_COM_id id="RoadRunner.SDK">
              <command internal_id="RoadRunnerCommand_PLAY" external_command="Execute">
                <parameter order="0" external_command_parameter="PLAY" />
              </command>
    
    	<command internal_id="RoadRunnerCommand_NEXT" external_command="Execute">
                <parameter order="0" external_command_parameter="NEXT" />
              </command>
    
    	<command internal_id="RoadRunnerCommand_VOL+" external_command="Execute">
                <parameter order="0" external_command_parameter="VOL+" />
              </command>
    
    	<command internal_id="RoadRunnerCommand_VOL-" external_command="Execute">
                <parameter order="0" external_command_parameter="VOL-" />
              </command>
    	
    	<command internal_id="RoadRunnerCommand_PREV" external_command="Execute">
                <parameter order="0" external_command_parameter="PREV" />
              </command>
            </external_COM_id>
          </executable_commands>
      </com>
    
      </general>
    
      ...
    
      <!-- Begin Analogue Input Instances -->
          <iochannel id="SWC1" port="0" brain="My Fusion Brain 0" type="analogue_input">
            <options history="15" auto_average="true"></options>
          </iochannel>
          <iochannel id="SWC2" port="1" brain="My Fusion Brain 0" type="analogue_input">
            <options history="15" auto_average="true"></options>
          </iochannel>
      <!-- End Analogue Input Instances -->
      </io>
    
      <logic>
      <!-- Begin Logging Setup -->
        <all_logging>
        </all_logging>
      <!-- End Logging Setup -->
    
      <!-- Begin Variable Declarations -->
        <all_variables>
          <variable name="Variable_SWC1">0</variable>
          <variable name="Variable_SWC2">0</variable>
        </all_variables>
      <!-- End Variable Declarations -->
    
      <!-- Begin Logic Declarations -->
        <all_statements>
          <if fire_on="logic" minimum_delta_vote_time="100" id="Logic for SWC1">
            <variable do="set" name="Variable_SWC1">
                <analogue id="SWC1" time="0"></analogue>
            </variable>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="Logic for SWC2">
            <variable do="set" name="Variable_SWC2">
                <analogue id="SWC2" time="0"></analogue>
            </variable>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="250" id="SW Vol UP Logic">
            <boolean_operation type="between ii">
              <parameter1>
                <number>0.89</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
              <parameter3>
                <number>0.95</number>
              </parameter3>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_VOL+" vote_opinion="VOL+" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW Vol DOWN Logic">
            <boolean_operation type="between ii">
              <parameter1>
                <number>1.9</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
              <parameter3>
                <number>2.1</number>
              </parameter3>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_VOL-" vote_opinion="VOL-" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW Track Next Logic">
            <boolean_operation type="equal to">
              <parameter1>
                <number>0</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_NEXT" vote_opinion="NEXT" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW Track Prev Logic">
            <boolean_operation type="between ii">
              <parameter1>
                <number>0.37</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
              <parameter3>
                <number>0.41</number>
              </parameter3>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_PREV" vote_opinion="PREV" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW MODE PLAY PAUSE #">
            <boolean_operation type="equal to">
              <parameter1>
                <number>0</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC2" time="0"></analogue>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_Play" vote_opinion="PLAY" vote_priority="Medium"></do>
            </then>
          </if>
        </all_statements>
      <!-- End Logic Declarations -->
      </logic>
    </FusionControlCentreConfiguration>
    Control Centre will crash immediately, and the configurator gives me warnings about "Then statement: What to do Invalid of "external command" and as I said before, even the COM section in the configurator doesn't work properly. (Hangs up, can't cancel out)

    Thanks in advance.

  8. #18
    Variable Bitrate
    Join Date
    Aug 2006
    Location
    Central PA
    Posts
    246
    Great job! You just made life much easier for us .

  9. #19
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by stealinfool View Post
    I'm having some issues with getting RR's COM stuff to work. I can't even get the test Ninja button to work.

    I believe I've followed the examples well enough (copy and paste work wonders) but here is my conf file slimmed down a bit

    Code:
    ...
      <general>
      <!-- Begin Remote Control Configuration -->
        <remote status="disabled" user_name="default" port="4242"></remote>
      <!-- End Remote Control Configuration -->
    
    <com status="enabled">
          <executable_commands>
            <external_COM_id id="RoadRunner.SDK">
              <command internal_id="RoadRunnerCommand_PLAY" external_command="Execute">
                <parameter order="0" external_command_parameter="PLAY" />
              </command>
    
    	<command internal_id="RoadRunnerCommand_NEXT" external_command="Execute">
                <parameter order="0" external_command_parameter="NEXT" />
              </command>
    
    	<command internal_id="RoadRunnerCommand_VOL+" external_command="Execute">
                <parameter order="0" external_command_parameter="VOL+" />
              </command>
    
    	<command internal_id="RoadRunnerCommand_VOL-" external_command="Execute">
                <parameter order="0" external_command_parameter="VOL-" />
              </command>
    	
    	<command internal_id="RoadRunnerCommand_PREV" external_command="Execute">
                <parameter order="0" external_command_parameter="PREV" />
              </command>
            </external_COM_id>
          </executable_commands>
      </com>
    
      </general>
    
      ...
    
      <!-- Begin Analogue Input Instances -->
          <iochannel id="SWC1" port="0" brain="My Fusion Brain 0" type="analogue_input">
            <options history="15" auto_average="true"></options>
          </iochannel>
          <iochannel id="SWC2" port="1" brain="My Fusion Brain 0" type="analogue_input">
            <options history="15" auto_average="true"></options>
          </iochannel>
      <!-- End Analogue Input Instances -->
      </io>
    
      <logic>
      <!-- Begin Logging Setup -->
        <all_logging>
        </all_logging>
      <!-- End Logging Setup -->
    
      <!-- Begin Variable Declarations -->
        <all_variables>
          <variable name="Variable_SWC1">0</variable>
          <variable name="Variable_SWC2">0</variable>
        </all_variables>
      <!-- End Variable Declarations -->
    
      <!-- Begin Logic Declarations -->
        <all_statements>
          <if fire_on="logic" minimum_delta_vote_time="100" id="Logic for SWC1">
            <variable do="set" name="Variable_SWC1">
                <analogue id="SWC1" time="0"></analogue>
            </variable>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="Logic for SWC2">
            <variable do="set" name="Variable_SWC2">
                <analogue id="SWC2" time="0"></analogue>
            </variable>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="250" id="SW Vol UP Logic">
            <boolean_operation type="between ii">
              <parameter1>
                <number>0.89</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
              <parameter3>
                <number>0.95</number>
              </parameter3>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_VOL+" vote_opinion="VOL+" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW Vol DOWN Logic">
            <boolean_operation type="between ii">
              <parameter1>
                <number>1.9</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
              <parameter3>
                <number>2.1</number>
              </parameter3>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_VOL-" vote_opinion="VOL-" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW Track Next Logic">
            <boolean_operation type="equal to">
              <parameter1>
                <number>0</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_NEXT" vote_opinion="NEXT" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW Track Prev Logic">
            <boolean_operation type="between ii">
              <parameter1>
                <number>0.37</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC1" time="0"></analogue>
              </parameter2>
              <parameter3>
                <number>0.41</number>
              </parameter3>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_PREV" vote_opinion="PREV" vote_priority="Medium"></do>
            </then>
          </if>
          <if fire_on="logic" minimum_delta_vote_time="100" id="SW MODE PLAY PAUSE #">
            <boolean_operation type="equal to">
              <parameter1>
                <number>0</number>
              </parameter1>
              <parameter2>
                <analogue id="SWC2" time="0"></analogue>
              </parameter2>
            </boolean_operation>
            <then>
              <do function="external command" functionTargetID="RoadRunnerCommand_Play" vote_opinion="PLAY" vote_priority="Medium"></do>
            </then>
          </if>
        </all_statements>
      <!-- End Logic Declarations -->
      </logic>
    </FusionControlCentreConfiguration>
    Control Centre will crash immediately, and the configurator gives me warnings about "Then statement: What to do Invalid of "external command" and as I said before, even the COM section in the configurator doesn't work properly. (Hangs up, can't cancel out)

    Thanks in advance.
    The Configurator's COM section is no where near complete. It should not be used as stated in post #4. I am working on it when I have a chance, but this semester is finishing up so that means final projects and final exams.

    I will look at your code tonight and see what is going on.
    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

  10. #20
    Constant Bitrate stealinfool's Avatar
    Join Date
    Dec 2005
    Location
    Orlando
    Posts
    142
    COM for RR seems to be fully functional after the last update. Thanks dude! Now I just have to figure out why it hangs up and keeps sending votes when my voltage drops to 0...

Page 2 of 7 FirstFirst 1234567 LastLast

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
  •