Results 1 to 8 of 8

Thread: Logic Builder Clarifications Needed

  1. #1
    Newbie
    Join Date
    Apr 2009
    Posts
    7

    Logic Builder Clarifications Needed

    I have now gotten some forward motion on programming in MDX. The next question is: I see that the Logic Builder screens have "individual" chunks. Meaning that there is a blocl like "logic for input0". So how does one "link" other logic blocks to do more complex tasks? I also see "Root logic" blocks... Is that how you do it? How do you make root logic blocks and such? In my case, lets say I am watching the voltage of 8 inputs and then want a "master" logic to turn on a relay output#1 if all 8 are above 3 volts? Like that...
    Jeff

  2. #2
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by jeffkay View Post
    I have now gotten some forward motion on programming in MDX. The next question is: I see that the Logic Builder screens have "individual" chunks. Meaning that there is a blocl like "logic for input0". So how does one "link" other logic blocks to do more complex tasks? I also see "Root logic" blocks... Is that how you do it? How do you make root logic blocks and such? In my case, lets say I am watching the voltage of 8 inputs and then want a "master" logic to turn on a relay output#1 if all 8 are above 3 volts? Like that...
    Jeff
    Each logic block is essentially a if/then/else statement.

    So if you want to monitor 8 inputs, then you use 1 logic block.

    Just connect them with AND gates.

    if(input0 > 3 AND input 1 > 3 AND input 2 > 3 AND ...) then turn out output
    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

  3. #3
    Newbie
    Join Date
    Apr 2009
    Posts
    7
    I oversimplified the last example--it was clear that you could do that all in one block. Let's say you have two separate tasks like setting a clock running and then using that variable later in an input statement? Anyway, what about those Root logics and how do these labels get created or edited?

    My next question is about latching or not latching. In my test, I made an input close a relay after getting above a threshold. Since there was a GUI button onscreen, I noted that the button latched and my relay would not reopen until the GHI button was toggled. So what do I do if I wand to undo the latch made by the Ninja Kitty?
    Jeff

  4. #4
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by jeffkay View Post
    I oversimplified the last example--it was clear that you could do that all in one block. Let's say you have two separate tasks like setting a clock running and then using that variable later in an input statement?
    To set the variable, you would create a Then-Do after the first logic block that would change the variable to whatever value. Either "#" or "d#". "d#" is to change it by some amount. So to change it by +2, then it would be "d2". To change by -42 it would be "d-42". Alternatively you can use the "set" feature of variables which will set the variable to the value of whatever is before it. This is done in the actual logic layout.

    To then use the value of the variable you place the variable with the "get" feature, and that will insert the current value of the variable into whereever that is.


    Quote Originally Posted by jeffkay View Post
    Anyway, what about those Root logics and how do these labels get created or edited?
    Labels as in just the name? If so it is in the properties area of each logic block. It serves no purpose other than to help you organize things.

    Quote Originally Posted by jeffkay View Post
    My next question is about latching or not latching. In my test, I made an input close a relay after getting above a threshold. Since there was a GUI button onscreen, I noted that the button latched and my relay would not reopen until the GHI button was toggled. So what do I do if I wand to undo the latch made by the Ninja Kitty?
    Jeff
    When a button is pressed, it constantly sends out it's vote. If you want to override the button with a logic function you could set logic's vote priority to something higher than the buttons. So if the button is low priority, set the logic to medium priority. Or you can have the button change a variable. Then a logic block check the variable and if it equals some value turn on. Then you can manipulate the variable elsewhere too to turn it on/off from however many logic blocks you want.

    There are many ways to do it and it all depends on what you want to do.
    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

  5. #5
    Newbie
    Join Date
    Apr 2009
    Posts
    7
    ..."To set the variable, you would create a Then-Do after the first logic block....">>>>>

    What do you mean "after" the logic block? I see the then/do and then/else buttons--I also see how you can have more than one statement. Since they don't have a "linked" picture object like the other objects, how are these implemented? Are the commands done at the end of the linking--like in the green "output" object? Or is the then/do part of the main flow somehow? I don't understand this. Especially if you are changing and rechanging variables within the serial steps of the execution? Can you clarify this portion of the logic builder?

  6. #6
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    The first logic block gets executed first. The last gets executed last. Any change is sent into a prioritized queue and gets evaluated all at once at the beginning of the next logic timer sequence. It is a synchronous voting system with 3 priorities.

    by "after" I meant after having created your logic, then click on the then/do button, add the votes, and save that logic block. So all within that same screen/area, but technically you could do it at any time if you so desired.
    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

  7. #7
    Newbie
    Join Date
    Apr 2009
    Posts
    7
    Ah, now it is making more sense. So there can only be two instances in the then/do's, yes? Is the voting system like a command buffer with priorities attached? I understand that the PC (USB) and the timers would leave gaps, or like interrupts, right, so this bridges that? This is why the FB can only be Psuedo-real-time? Thanks for the help.
    Jeff

  8. #8
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by jeffkay View Post
    Ah, now it is making more sense. So there can only be two instances in the then/do's, yes? Is the voting system like a command buffer with priorities attached? I understand that the PC (USB) and the timers would leave gaps, or like interrupts, right, so this bridges that? This is why the FB can only be Psuedo-real-time? Thanks for the help.
    Jeff
    You can have an infinite amount of instances in the then/do's. It is averaged.

    Section 2 might be of help, to get a better understanding of how it works: http://www.fusioncontrolcentre.com/T...ual%20b005.pdf

    It is a command buffer essentially. But the variables' buffer is actually internal to each variable, and gets evaluated at the beginning of the logic timer. The voting system is used for everything, therefore any object can do any command at any time with the same syntax. A digital output has an internal buffer as well.

    It is pretty darned close to real time, and as close as it can get for the voltage in. Evaluating it to be something else through a logic block, means it will be 1 "clock cycle" off where the clock would be fired every XX milliseconds as determined by the timer configuration.
    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

Similar Threads

  1. New Car PC info needed
    By Tribalvision in forum Newbie
    Replies: 1
    Last Post: 01-06-2008, 10:00 PM
  2. Needed, Last few Norwegian translations needed
    By veetid in forum Centrafuse
    Replies: 1
    Last Post: 06-13-2007, 11:55 AM
  3. Power distribution clarifications needed please.
    By umarth in forum Power Supplies
    Replies: 0
    Last Post: 03-11-2005, 11:44 PM
  4. Amplifier Needed?
    By c0rrupti0n in forum Newbie
    Replies: 7
    Last Post: 03-15-2004, 04:04 AM
  5. My project for the day - advice needed
    By ddt in forum General MP3Car Discussion
    Replies: 2
    Last Post: 12-02-2002, 08:51 AM

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
  •