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?
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?
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.
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....
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
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
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
Gentlemen,
So what is the answer to my original question, IF[#120AND7EQ1]GOTO1
would number 7 be read as a local variable #7? Had a apps. guy tell me
that the pound sign from #120 would be carried to the number 7 but
he did not seem to confident in his answer so that's why I come to the
experts here on CNC Zone. Thank You
I was just reading through this thread now, BUT I and am curious to see how it worked out for you.
I ran it through using NCplot, it seemed to work just fine.
#120=1
#7=1
IF [[#120 EQ 1] AND [#7 EQ 1 ]] GOTO 1
M00
N1
I want to resurrect this thread to get to a satisfactory conclusion. Looking through some Inspection Plus macros I see this kind of AND format everywhere and I really don't understand it...
examples from the 'settings' macro: -
IF[#120AND8NE8]GOTO6
IF[#120AND3EQ3]GOTO4
IF[#120AND3EQ2]GOTO3
DP
This is bitwise AND.
(#120 AND 8) checks the status of fourth bit of binary representation of #120 (starting counting from bit-1, bit-2, and so on) from right.
If #120 AND 8 is equal to 8, then fourth bit is 1.
#120 gets its value from input interface signals.(#120 = #1032)
Let us say first five signals are all 1. Then #1032 would be binary interpretation of 11111 i.e., 31.
31 AND 8 is equivalent to binary 11111 AND 01000 which gives 01000, i.e., 8.
8 means that the fourth bit is ON.
If the fourth bit is not ON, the value returned would be 0.
Thus the first statement means that "if the fourth input signal is 0 (OFF), jump to block number 6." (IF[#120AND8NE8]GOTO6)
Read the attachment for more details.