Welcome, Guest. Please login or register.
Did you miss your activation email?
November 17, 2017, 02:26:49 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Brains Development
| | |-+  compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?
Pages: 1   Go Down
Print
Author Topic: compare input1 (switch) to "1" or "0" no worky ...because BOOLEAN?  (Read 1093 times)
0 Members and 1 Guest are viewing this topic.
damo green
Active Member

Offline Offline

Posts: 18


View Profile
« on: September 01, 2017, 10:01:34 PM »

 | 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...
Logged
GrandpaXYZ
Holding

Offline Offline

Posts: 2


View Profile
« Reply #1 on: September 03, 2017, 02: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...)

Logged
imitheo
Active Member

Offline Offline

Posts: 41


View Profile
« 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 ?
Logged
damo green
Active Member

Offline Offline

Posts: 18


View Profile
« 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.

Logged
imitheo
Active Member

Offline Offline

Posts: 41


View Profile
« 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.
Logged
damo green
Active Member

Offline Offline

Posts: 18


View Profile
« 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. 
Logged
imitheo
Active Member

Offline Offline

Posts: 41


View Profile
« 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
Logged
imitheo
Active Member

Offline Offline

Posts: 41


View Profile
« Reply #7 on: November 15, 2017, 08:46:08 AM »

bump
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!