![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Parametric Programing (custom macro b, fadal macro, okuma user task) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#14
| |||
| |||
| Stevo |
|
#15
| |||
| |||
| 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 |
| Sponsored Links |
|
#17
| |||
| |||
IF[#120AND7EQ1]GOTO1 would not do what you want. It means entirely different thing. |
|
#18
| |||
| |||
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 |
|
#19
| ||||
| ||||
| 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 |
|
#20
| |||
| |||
| 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. |
| Sponsored Links |
|
#22
| |||
| |||
| In Sinha's example, bitwise "AND" is being used to determine if one number is contained in the other, and is whats called for in the example you supplied. Using bit wise "AND" in the comparison of two numbers produces a third based on a bit by bit comparison of the two, and is how either 8 or zero is returned in Sinha's example. Bit wise "AND" can also be used to determine what number, if any, is contained in the two numbers being compared. The third number is created when the bit by bit comparison is made. If the corresponding bits are different,or are both "0", a "0" is returned for that particular bit,if they're both "1", a "1" is returned. In the following example: A = 9 AND 29 A = 8 This result is achieved as follows: -----16 8 4 2 1 0 0 0 1 1 1 0 1 = 29 0 0 0 0 1 0 1 0 = 9 0 0 0 0 1 0 0 0 = 8 Regards, Bill |
|
#23
| |||
| |||
| Incidently, why don't you purchase a copy of the book. Its "used" price is as low as $5.92; virtually free! |
|
#24
| ||||
| ||||
| Thanks Bill, Sinha, Once I've got my head around it I may find a use for it, or just incorporate it into my macros to confuse others...thanks for another preview of your book Sinha, you always cut it off just as it's getting onto another interesting topic and leave me wanting more...hey, maybe if I scanned this entire site I might be able to reconstruct the complete works ![]() DP |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |