Announcement

Collapse
No announcement yet.

Logic Questions

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Logic Questions

    Just got my board set up & installed. I'm playing around with it & trying to get familiar with MDX. I've used both the pre-installed skin & made my own via the wizard, so I'd say I've got the basics down with respect to the digital outputs. I have a couple problems that are probably just due to my way of doing things, so set my logic straight please.
    I've done ladder logic with PLC & pnuematic controls, so my thinking tends along those lines.

    1. Can you switch an output between toggle & momentary? You get the option to pick using the wizard, but not when creating from scratch. The momentary also acts funny - sometimes a double click latches it.

    2. Scenario - 3 outputs, 3 buttons. I want Output3 on when Output 1 & 2 are on, but ONLY when 1 & 2 are on. I can turn it on without problems, but i can't get it to go off for anything. setting it as momentary & shutting off 1 & 2 doesn't work (Trigger output = toggle on, how do i toggle off?).

    Using a boolean variable, it will go on if variable=true (only if i use 2 NOTs before the output because it forces me too use a boolean operator before the output), but I have not figured out how to change the variable back to false. There's gotta be something I'm missing. For the "ON" I'm using an AND to change the variable from false (default) to true. I have not found a statement that will change the variable back to false. In the ThenDoForm, there is an unlabeled box beneath the "opinion" field (which is un-changeable) that has +0 in it by default. I've tried +1, -1, 0, +0 etc and nothing works. Is change variable only a flip-flop type function?

    I get the point of MDX for skinning purposes - it works well for that. The logic seems to be more difficult because I can't use If/Then/Else statements.

  • #2
    Originally posted by Iamthehor View Post
    1. Can you switch an output between toggle & momentary? You get the option to pick using the wizard, but not when creating from scratch. The momentary also acts funny - sometimes a double click latches it.
    You say you have some EE-type background, so I will be semi-nerdy.

    If you get it latching, change the upclick vote to a higher priority, or the downclick vote to a lower priority. Only time it latches is when you click faster than the sample rate of the gui portion of the program. This is settable in the timer area. Faster the frequency, the faster you have to click to vote 2 times down in the same period, or down and up in the same period. Also faster the frequency CPU cycles goes up obviously.

    As to changing a button from toggle to momentary on the fly, I have not thought about that. I am sure it can be done with some fancy logic where the button changes a variable, and the uplick changes a variable, and depending on another variable that determined momentary/toggle the button's variable would either increase or not making an output on or not. I would have to think about it more though.

    Originally posted by Iamthehor View Post
    2. Scenario - 3 outputs, 3 buttons. I want Output3 on when Output 1 & 2 are on, but ONLY when 1 & 2 are on. I can turn it on without problems, but i can't get it to go off for anything. setting it as momentary & shutting off 1 & 2 doesn't work (Trigger output = toggle on, how do i toggle off?).

    Using a boolean variable, it will go on if variable=true (only if i use 2 NOTs before the output because it forces me too use a boolean operator before the output), but I have not figured out how to change the variable back to false. There's gotta be something I'm missing. For the "ON" I'm using an AND to change the variable from false (default) to true. I have not found a statement that will change the variable back to false. In the ThenDoForm, there is an unlabeled box beneath the "opinion" field (which is un-changeable) that has +0 in it by default. I've tried +1, -1, 0, +0 etc and nothing works. Is change variable only a flip-flop type function?

    I get the point of MDX for skinning purposes - it works well for that. The logic seems to be more difficult because I can't use If/Then/Else statements.
    Each MDX logic section is and If/Then/Else.

    Have 1 logic section that says if (DigitalOutput0 && DigitalOutput1) connected to an output. Then in the then do area put the then statement to be turn on DigitalOutput3, and in the anti-then statement put in turn off DigitalOutput3. Done.

    It forces a boolean operation because each output is an if/then/else. If(42) doesnt makes sense, but if(true) does, and boolean gives a true/false, where non-boolean doesnt.

    If that doesnt make sense I can give some more input. Let me know.

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

    Comment


    • #3
      OK, thanks for that - You've cleared up a few things without me even knowing i didn't understand. My logic was OK, just doing a lot more work than i needed & being countered by something i didn't know existed- the "vote opinion" terminology fooled me. I though the on/off for that had something to do with the voting, which i thought was unnecessary for something as simply as on/off with 1 condition it was on for both cases, causing output 3 to stay on after coming on.

      BTW, I understood most of that but my EE knowledge is poor at best. I'm ME, but i do work with automotive wiring systems - low voltage and no digital logic, more how to get them in the vehicle rather than functionality.

      Comment

      Working...
      X