Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > General Hardware Discussion > Fusion Brain


Reply
 
Share Thread Tools Display Modes
Old 04-21-2009, 05:47 PM   #1
Newbie
 
Join Date: Apr 2009
Posts: 7
jeffkay is an unknown quantity at this point
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
jeffkay is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 04-21-2009, 05:50 PM   #2
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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
2k1Toaster is offline   Reply With Quote
Old 04-21-2009, 06:01 PM   #3
Newbie
 
Join Date: Apr 2009
Posts: 7
jeffkay is an unknown quantity at this point
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

Last edited by jeffkay; 04-21-2009 at 06:02 PM. Reason: added
jeffkay is offline   Reply With Quote
Old 04-21-2009, 11:58 PM   #4
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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.
2k1Toaster is offline   Reply With Quote
Old 04-22-2009, 11:51 AM   #5
Newbie
 
Join Date: Apr 2009
Posts: 7
jeffkay is an unknown quantity at this point
..."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?
jeffkay is offline   Reply With Quote
Old 04-22-2009, 12:27 PM   #6
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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.
2k1Toaster is offline   Reply With Quote
Old 04-22-2009, 12:33 PM   #7
Newbie
 
Join Date: Apr 2009
Posts: 7
jeffkay is an unknown quantity at this point
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
jeffkay is offline   Reply With Quote
Old 04-22-2009, 12:48 PM   #8
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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.
2k1Toaster is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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



All times are GMT -5. The time now is 02:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics