Hello Guest it is March 28, 2024, 08:09:05 AM

Author Topic: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?  (Read 14209 times)

0 Members and 1 Guest are viewing this topic.

 | INPUT#1    0/:1  | -------| COMPARE =1 |               when I toggle the physical switch, I can watch the brain and see the input rung color & value toggle accordingly between 0 & 1 , bu the COMPARE rung will never toggle  even though the input matches "1"

I also tried  with | COMPARE >0|  , also does not work, just like above. I suspect it is because it is boolean  and 1/0 does not  represent true/false  exactly ?...but can not input "true" into the compare field…
---------
I found a workaround by comparing and LED set to "1" to the input and that did work…..which was a workaround in itself because trying to set an Input to be a local variable causes  Mach3 to hang…..


Would like to be able to write the brain without having to edit a screenset and set an led to "1" as a crazy workaround...
Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #1 on: September 03, 2017, 03:54:18 PM »
I think you're using the wrong compare 'function'.

-If you want to pass the value of a single switch directly you simply use 'no operation' instead of 'compare'. (Or no operation -> invert)

-If you want to 'compare' two inputs then you use one line per input. On each line you add 'no operation' right after your 'input' (same as above). DO NOT TERMINATE ANY LINE. The 'trick' is that you then select (click) both 'no operation' boxes  (both will be green) and then hit the '+' button.  TaDa!!! You will then see a popup where you can choose 'compare a b' or use boolean logic (and, or ,eor...)

Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #2 on: November 09, 2017, 08:28:31 AM »
The question the op asked if it is possible to compare a signal of input i believe, if it's high or low. I also need to do that, anyone ?
Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #3 on: November 09, 2017, 12:00:57 PM »
I did get it to work, I have to look at what I did later, I have not looked at it lately, so it is hard to remember.

I do remember that the solution was not to try to compare  the initial input boxes directly, but first had to pass into into "another box"...i'll try to look at it later and me more accurate with my wording as I can't remember off the top of my head. I did get it working though.

Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #4 on: November 09, 2017, 12:05:20 PM »
I see, i have a complex brain that i need to write for a door guard, but it requires this.
Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #5 on: November 09, 2017, 12:14:30 PM »
I do remember it was very simple, my initial problem was that you can not directly compare a physical input with a boolean, i had to first pass that physical (switch( input into another box and THEN do a boolean  compare on that......at the moment i cannot recall what "box"/node i had to pass it into...but it was simple.   It was my first brain that is why i can not remember. 

It did work to  repeatedly pickup the start of a multiple pass/depth threading cycle.  At some point I will  post a video of it working. 
Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #6 on: November 09, 2017, 12:19:08 PM »
Could you just check this boolean issue for me? It will help me a lot
Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #8 on: December 18, 2017, 02:54:10 PM »

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
« Reply #9 on: December 19, 2017, 03:35:14 PM »
Hi,
thats boolean locic:


Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.