Page 1 of 3 123 LastLast
Results 1 to 12 of 27

Thread: IF[#120AND7EQ1]GOTO1

  1. #1
    Registered
    Join Date
    Jan 2009
    Location
    USA
    Posts
    39
    Downloads
    0
    Uploads
    0

    Question IF[#120AND7EQ1]GOTO1

    Gentlemen,
    In this conditional statement, IF[#120AND7EQ1]GOTO1 is the number 7 read as a local variable #7? And if so could it be written like this,
    IF[#120AND#7EQ1]GOTO1?


  2. #2
    Registered
    Join Date
    Feb 2009
    Location
    USA
    Posts
    64
    Downloads
    0
    Uploads
    0

    ?

    IF[#120AND7EQ1]GOTO1 would give a false return.

    #120 may equal 1 but 7 never will. The control will read '7' as a constant and not a variable.

    However, I ran this:
    #120 = 1;
    n2 IF[#120 AND 7 EQ 1] do1;
    goto2;
    end1;
    m1;

    and got it into an infinite loop. This is odd. This will confuse me for a while. I would expect this to go straight to m1, but the machine is counting the statement as true when I would expect it not to.

    F[#120AND#7EQ1]GOTO2 also gave an infinite loop. Very strange.


  3. #3
    Registered
    Join Date
    Mar 2005
    Location
    Silicon Valley, CA
    Posts
    988
    Downloads
    0
    Uploads
    0
    AND is an operator so I think in your loop, this becomes bitwise. Therefore, the product of bin 1 and 7 = 0001 ... or in other words equal to "1". So the program loops...
    It's just a part..... cutter still goes round and round....


  4. #4
    Registered
    Join Date
    Feb 2006
    Location
    india
    Posts
    1,273
    Downloads
    0
    Uploads
    0
    You are right.
    AND can be both bitwise and Boolean. It depends on what you have as its arguments. In fact, it is also possible to have "different" ANDs in the same Block!
    IF [[[#1 AND #2] LT 100] AND [#1 LT #2]] GOTO 10;
    Of course,parameter 6000#0 should be 1 to allow use of AND as a Boolean function in a conditional statement.

    Incidently, arithmetic 0 and 1 are not equivalent to Boolean FALSE and TRUE, as believed by Peter Smid.
    Last edited by sinha_nsit; 11-08-2009 at 11:16 PM.


  • #5
    Registered Superman's Avatar
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1,769
    Downloads
    0
    Uploads
    0
    IF [[#120 EQ 1] AND [#7 EQ 1 ]] GOTO 1
    Would this not be an easier way of getting the syntax correct ?
    You are breaking up the query to each variable and get a yes/no from each, if either give a 0 return then the IF statement will not jump


  • #6
    Registered
    Join Date
    Feb 2006
    Location
    india
    Posts
    1,273
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by Superman View Post
    IF [[#120 EQ 1] AND [#7 EQ 1 ]] GOTO 1
    Would this not be an easier way of getting the syntax correct ?
    You are breaking up the query to each variable and get a yes/no from each, if either give a 0 return then the IF statement will not jump
    Yes.
    This is what he perhaps wants to check.
    This would be the simplest method.


  • #7
    Registered
    Join Date
    Oct 2009
    Location
    Pakistan
    Posts
    12
    Downloads
    0
    Uploads
    0
    Hi to all.

    iI have vmc (Jih Fong Machinery Co) of taiwan with Fanuc 0-MD 20# of tool changer i have lost of its all macro and sub programs i am not able make the macro program how to call the 20 tools step by step please help me thanks to all.


  • #8
    Registered
    Join Date
    Feb 2006
    Location
    india
    Posts
    1,273
    Downloads
    0
    Uploads
    0
    For a better response, start a new thread for a new problem.

    Can call a tool without using any macro. Send it to a safe position (say, reference position), and command T1 M06, for example. Then bring it to the machining area, incorporate length offset and continue...


  • #9
    Registered
    Join Date
    Oct 2009
    Location
    Pakistan
    Posts
    12
    Downloads
    0
    Uploads
    0
    Thanks to all but i can't inter( IF [[#) likes value


  • #10
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1,509
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by Khalid.Ins-Tek View Post
    Thanks to all but i can't inter( IF [[#) likes value
    If you do not have the full keypad with these functions on it then you have to write the program and download it to the control.

    Stevo


  • #11
    Registered
    Join Date
    Oct 2009
    Location
    Pakistan
    Posts
    12
    Downloads
    0
    Uploads
    0
    hi stevo
    then i feed from pc through RS232 but genrate a alarm 004


  • #12
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1,509
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by Khalid.Ins-Tek View Post
    hi stevo
    then i feed from pc through RS232 but genrate a alarm 004
    Hmmm that’s weird. The PS04 alarm is “address not found”. This is typically when you are running a program not downloading. I saw the program you sent me via PM and it appears to be a tool change program in macroA format correct? Is this the program for your machine? My guess is it is not alarming on the M42 it is alarming on the block after “N1”. Do you have macroA on your control?

    You are doing a download and not dripfeeding correct?

    Stevo


  • Page 1 of 3 123 LastLast

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.