584,860 active members*
5,224 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > please, how to use NOT ( logical negation ) ?
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2015
    Posts
    4131

    please, how to use NOT ( logical negation ) ?

    hello all i tried to use NOT :
    ... "not 1" should return 0, but it returns -2
    ... "not 0" should return 1, but it returns -1
    ... "not 0101" should return 1010, but it returns -102

    it seems that "not" is not acting as a logic function, but more like " not [ n ] = - n - 1 "

    i wish to improve the readability of conditional codes; kindly
    Attached Thumbnails Attached Thumbnails infos a.png   infos b.png  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  2. #2
    Join Date
    Jun 2010
    Posts
    4252

    Re: please, how to use NOT ( logical negation ) ?

    Part of your problem is that you think you are working in binary, but you are not. You are working in integer mode.

    ... "not 1" should return 0, but it returns -2
    Correct. not 00001 => 11110, which is -2

    ... "not 0" should return 1, but it returns -1
    Correct. not 00000 => 11111, which is -1

    ... "not 0101" should return 1010, but it returns -102
    Correct. The 0101 is one hundred and one.

    Cheers
    Roger

  3. #3
    Join Date
    Jun 2015
    Posts
    4131

    Re: please, how to use NOT ( logical negation ) ?

    hy Roger thank you 4 the fast answer; i needed time to get it

    ... decimal : 0 1 2 3 .. +inf
    ... signed decimal : -inf .. -3 -2 -1 0 1 2 3 .. +inf
    ... binary : 0 1 10 11 ... +inf
    ... but what is signed binary ? for mere mortals, nothing but in electronics, etc, stuff like you described appears

    so the argument and the result of the NOT function ( NOT [ argument ] = result ) is a signed binary ( or how is it called ); also showed in image "a" of my 1st post

    but in image "b", the manuals present the function as being able to handle a logical atribute ( boolean; true/false, etc )

    this is contradictory from manuals, i would say that NOT can return both "signed binary" or "boolean" result; from trials, i can say that NOT returns only "signed binary", while i need "boolean"

    is there a way to shift the way NOT behaves ? who needs "signed binary" when writing programs for a cnc ?

    Code:
        V1 = something binary from somewhere
        V2 = decimal [ 01011110 ]
        if [ [ NOT V1 ] EQ  V2 ] then drill else peck_drill :)
    kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  4. #4
    Join Date
    Jun 2010
    Posts
    4252

    Re: please, how to use NOT ( logical negation ) ?

    I suspect you must be using a Fanuc system, as Mach3 and NIST do not support the IF statement. I do not know the fine details of Fanuc as I use Mach3.
    Frankly, I find the logical functions of little use in g-code and very rarely bother to use them. Sorry! I do however use ABS[] and FUP[] quite a lot.

    Cheers
    Roger

  5. #5
    Join Date
    Jun 2015
    Posts
    4131

    Re: please, how to use NOT ( logical negation ) ?

    hey Roger i also believe that most codes are linear, and only a fraction* of programers use conditional/logical statements, etc ...

    they add a bit of versatility ( if needed / when needed ) etc ; kindly

    *fraction = the most important fraction
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. no logical home position
    By blakey235 in forum Fagor Automation
    Replies: 1
    Last Post: 07-13-2014, 04:32 PM
  2. Ballscrew and supports don't seem to match in any logical way
    By ianlesnet in forum Linear and Rotary Motion
    Replies: 4
    Last Post: 01-29-2014, 04:02 PM
  3. Fanuc 18iM, logical AND
    By Mika M. in forum Fanuc
    Replies: 7
    Last Post: 05-11-2010, 10:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •