1. ## 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. ## ?

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

4. 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.

• 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

• Originally Posted by Superman
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.

• 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.

• 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...

• Thanks to all but i can't inter( IF [[#) likes value

• Originally Posted by Khalid.Ins-Tek
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

• hi stevo
then i feed from pc through RS232 but genrate a alarm 004

• Originally Posted by Khalid.Ins-Tek
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?

Stevo

• Page 1 of 3 123 Last