586,094 active members*
3,829 visitors online*
Register for free
Login
Results 1 to 16 of 16
  1. #1
    Join Date
    Jan 2004
    Posts
    258

    Pallet checking macro

    I have been controlling my program operations using macros and system variables for a while. I have a machine that is being a PIA. The machine is a side by side pallet changer horizontal. I have a small "main" program to control which program to run to what ever pallet is in the machine. In these machines system varialbe "1101 & 1102" tell me which pallet is in the machine. When the pallets change from pallet A to pallet B I have a program stop so they can check to make sure everything is ok. If they rotate the pallet before the program starts the machine will change its data bit and run the wrong operation. I think that this is an issue with the switch. I need to make this more fail safe. I would like to check condition of both switches. I have tried a few different ways and the controller does not like it. I need a string like; IF[#1101NE1 AND #1102=0] GOTO100. Can someone tell me the proper syntax for this line? I will trro a #3000 alarm if they are either both 0 or 1.

  2. #2
    Join Date
    Jan 2007
    Posts
    91
    Here is a older post that might shed some light. Me I would opt to have more than one line...but I'm lazy

    http://www.cnczone.com/forums/showthread.php?t=35041

  3. #3
    Join Date
    Mar 2005
    Posts
    988
    "AND" is an operator that uses bit data and not numeric values. It also functions as a string and not a secondary condition. Same goes for "OR" and "XOR".

    If I get what you're doing, you're just looking to be sure the proper pallet is in correct? Seems you're also adding a condition of if both values are "0" or both are "1"... would your machine try to run with both pallets in or out of the machine? If not, then you could do a simple check at the top of the program for this:

    IF[#1101EQ1.]GOTO1000 (Use #1102 for the other pallet)
    GOTO9999
    N1000


    Then just run the program. If the value isn't "1", it will jump to N9999 and you can set an alarm up there.
    It's just a part..... cutter still goes round and round....

  4. #4
    Join Date
    Jun 2007
    Posts
    119

    ??

    O0001
    N1 IF[#1101EQ1]GOTO2
    IF[#1102EQ0]GOTO100
    GOTO110
    N2 IF[#1102EQ1]GOTO100
    GOTO110
    N100 ALARM
    GOTO1
    N110
    ...

  5. #5
    Join Date
    Jun 2008
    Posts
    1511
    To check to see if they are both 1 or both 0 is the first 2 statments. To set the proper program for the proper pallet are the second 2 statments. Program 1 is for pallet 1 and program 2 is for pallet 2 change what #1 is to what ever programs are being used for pallet 1 and 2.

    IF[#1101+#1102]EQ2 GOTO100
    IF[#1101+#1102]EQ0 GOTO100
    IF[#1101EQ1]THEN#1=1
    IF[#1102EQ1]THEN#1=2
    M98P#1
    N100#3000=10(PALLET PROBLEM ALARM)

  6. #6
    Join Date
    Jan 2004
    Posts
    258
    Quote Originally Posted by psychomill View Post
    "AND" is an operator that uses bit data and not numeric values. It also functions as a string and not a secondary condition. Same goes for "OR" and "XOR".

    If I get what you're doing, you're just looking to be sure the proper pallet is in correct? Seems you're also adding a condition of if both values are "0" or both are "1"... would your machine try to run with both pallets in or out of the machine? If not, then you could do a simple check at the top of the program for this:

    IF[#1101EQ1.]GOTO1000 (Use #1102 for the other pallet)
    GOTO9999
    N1000


    Then just run the program. If the value isn't "1", it will jump to N9999 and you can set an alarm up there.
    I am doing that now. The switch for pallet exist on pallet 1 has a strange issue and has caused the machine to run the wrong program with the wrong tool. I want to exacute a conditional statement. I want to check both switches. One switch needs to be 0 and at the same time the other switch needs to be a 1. If both conditions are not met #3000 somthing is wrong.

  7. #7
    Join Date
    Jun 2008
    Posts
    1511
    IF[#1101+#1102]EQ2 GOTO100
    IF[#1101+#1102]EQ0 GOTO100
    IF[#1101EQ1]THEN#1=1
    IF[#1102EQ1]THEN#1=2
    M98P#1
    N100#3000=10(PALLET PROBLEM ALARM)

    With this program you are checking both switches. 1st line checks to see if they both are at 1. If they are they will equal 2 and alarm out. The second line checks to see if they are both 0. If they are they will equal 0 and alarm out. The only other combination for those are one of the switches is set to 1 and the other is set to 0. When that is the case it will not alarm out it will continue through the program to IF[#1101EQ1]THEN#1=1. This will set the program number to run for pallet/switch 1. If this is not tripped then it will continue to IF[#1102EQ1]THEN#1=2. And when this is true then it sets program 2 to pallet/swith 2. M98P#1 will call either program 1 or 2 depending on what switch is tripped. That way it runs the programs based on the swithches.
    Am I missing something or is that what you were trying to do??

    Stevo

  8. #8
    Join Date
    Jan 2004
    Posts
    258
    Stevo1,
    I was thinking about something like that. I am going down to the floor to reverse engineer a part and will try something like that.

  9. #9
    Join Date
    Jun 2008
    Posts
    1511
    Cool let me know how it works or if you need to do something else. You are not locked into programs 1 and 2.
    IF[#1101EQ1]THEN#1=?----put what ever program number you want to run for swith 1
    IF[#1102EQ1]THEN#1=?----put what ever program number you want to run for swith 2

    Stevo

  10. #10
    Join Date
    Jan 2004
    Posts
    258
    I post out my programs so all 1st ops are 1000 and 2nd ops 2000.

  11. #11
    Join Date
    Jan 2004
    Posts
    258
    How do I know that on the line "N100#3000=10(PALLET PROBLEM ALARM)" to call it 10? Where do I tell the control what these number are and what they say?

  12. #12
    Join Date
    Jun 2008
    Posts
    1511
    This should automaticlly generate an alarm I do not think that you have to set that in the machine. I never had to. If it does not work try #3000=1 or #3000=100 #3000 is just an alarm generation parameter. When the alarm is generated it will display what ever you write. The message that is in (). You write it in your program exactly how I posted it. I believe you can have up to 26 characters in the alarm message.
    N100#3000=10(PALLET PROBLEM ALARM);

    Stevo

  13. #13
    Join Date
    Jan 2004
    Posts
    258
    The reason I ask is one of my machines has a probe. It has a bunch of #3000 and they all have a value built into them. As far as the current macro I was working on, I think that there is something wrong with them. I went into MDI and said; #100=[#1101+#1102]. All I kept getting is a "0" in 100? This bothers me in that unless you turned the pallet so it did not contact the switch the values worked? I went back to the way I has controlled the pallets to the program in this machine. The machine is a side by side pallet changer so it uses a "G91P3X0" or a "G91P4X0" so I just tell the pallet change program that if the pallet is "P3X0" then #501 = 0 and if "P4X0" then # 501=1. I don' like that the statement is not controlled by a switch but until Ellison calls me back with my system variables this will have to work.

  14. #14
    Join Date
    Jun 2008
    Posts
    1511
    You can use the #3000 anywere you want it is not restricted to just your probe macro.

    So let me get this correct if pallet 1 is in place #1101=1 and #1102=0 and if pallet 2 is in place #1102=1 and #1101=0?? But you tried in MDI #100=[#1101+#1102] and it said #100=0? Did you have a pallet in position?

    Or are the #1101 and #1102 dictated off of what you program G91P3X0 will dictate #1101 and G91P4X0 will dictate #1102?

    How does your start program look. I think this is something that can very easily be integrated into your start program by just using 1 variable to say what pallet you want to machine 1 or 2. You can then have it run through the system variable check program. Have it change to the correct pallet automatically and then have it run the program that is designated for pallet 1 or 2.

    Stevo

  15. #15
    Join Date
    Jan 2004
    Posts
    258
    The pallet change program does not have #1101 or #1102 in it. My newer machines use #1102 and #1102 for pallet checking. I think that my older machines must use other system variables for pallet checking. The problem I see with this issue is the machine sees the switch when the pallet is at home position. As soon as the operator unlocks and turns the pallet the switch will go to 0. Under normal operation this should not be a problem but can cause issues.

  16. #16
    Join Date
    Jun 2008
    Posts
    1511
    Ok I guess I am a little confused on what your askin for then but it is Friday and by now my brain is usually pretty numb and I just kind of stare and drool most of the day . Need switch check? Run programs based on switch? Let me know when you get the system variables being used from Ellison and if you have questions on how to set the macro up with them. This should be rather simple to make it easy and error proof. That is the way all of my machines and macros are set up. Most of my programs are only a few lines long but I have 20 lines of calculations that will cause and alarm if they don't add up.

    Stevo

Similar Threads

  1. Looking for NC checking software...
    By Jesusbot in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 5
    Last Post: 06-04-2012, 04:01 AM
  2. CHECKING
    By CHANDRU in forum Fanuc
    Replies: 1
    Last Post: 12-25-2007, 02:48 AM
  3. checking accuracy
    By DEW in forum Waterjet General Topics
    Replies: 2
    Last Post: 10-01-2005, 03:27 PM
  4. Double Checking!!
    By chas in forum Gecko Drives
    Replies: 4
    Last Post: 04-12-2005, 05:38 AM
  5. Newbie checking in.
    By jstuedle in forum DIY CNC Router Table Machines
    Replies: 10
    Last Post: 07-01-2004, 04:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •