![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I could not get this to work. It said macro statment invalid. #19 or #13 has to have a value of one in this prg. I wrote. If niether of them do I want it to alarm out on line 3000. I have the alarm variable deal figured out. |
|
#2
| |||
| |||
| Nope. It wont' recognize "OR". The only way you could do it is IF[#13NE1]GOTO1 IF[#13GE1]GOTOxxxx or IF[#13EQ1]GOTOxxxx or IF#13=1GOTOxxxx N1IF[#19NE1]GOTO3000 IF[#19GE1]GOTOxxxx or IF[#19EQ1]GOTOxxxx or IF#19=1GOTOxxxx or... IF[#13NE1]GOTO3000 IF[#19NE1]GOTO3000 In the first example if #13 is not equal to 1 it goes to N1 and checks #19, if #19 is not equal to 1 it goes to your alarm. If 13 or 19 is greater than or equal to 1 it will jump to it's respective spot in the program where you want it to go. Or check to make sure that it is equal (EQ, =) In the second example if #13 is not equal to 1 it jumps to your alarm. If it is equal to 1 it reads the next line and checks to see if #19 is equal to 1. If it is not equal it jumps to your alarm. If it is equal the program continues from there. I recommend the first method, especially if you're only checking to make sure one or the other is equal to your set value. |
|
#6
| |||
| |||
| I don't think you can use "OR" like that can you guys???? "OR" is an operator but I've never known it to be able to use in a branch statement. The only ones for that are "IF..GOTO..." and "IF...THEN..." that I know of. Although Dan's example is using it in a nest. The only thing though, is I'm thinking you might still get an error because the "IF" portion has no real solution. Let's say the answer to both variables is a "3" . The statement would essentially read like this: IF[3]GOTO3000 To me, I'd think you'd get a format error.
__________________ It's just a part..... cutter still goes round and round.... |
|
#7
| |||
| |||
| If you perform an OR operation between two integers (say, two variables with some value) then you get an integer with all the binary bits "ORed" together. If you perform an OR operation between two boolean values (true or false) then you get a boolean value. The statement [#19NE1] is boolean because it's either true or false The statement [#13NE1] is also boolean - true or false the statement [[#19NE1]OR[#13NE1]] is also boolean, so you should be able to use it in an IF--GOTO statement. It should work. |
|
#8
| |||
| |||
| I see what you're saying Dan. I've tried similar statments and wrote them the same way as thee; getting the same error. I had never thought to try nesting the whole statement. It seems like it's always something simple that ends up driving me crazy. |
|
#11
| |||
| |||
| I stand corrected Dan.... I think. I see what you're thinking though and I agree, it should work. Wasn't thinking it terms of booleans but for resolutions. Hurry up Mudracer!
__________________ It's just a part..... cutter still goes round and round.... |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Are VMC manufacturer accuracy claims valid? | rlevin | General Metal Working Machines | 10 | 09-16-2006 09:48 AM |