What's new
What's new

Macro Programming Fundamentals

Billet454

Plastic
Joined
Jul 16, 2021
Here you go.

O9010
#3003=1
IF[#2EQ#0]GOTO100
IF[#2EQ0.]GOTO010
IF[#2LT1.]GOTO104
#4=FIX[#2]
#2=#4
IF[#2LT0]GOTO102
IF[#2GE360.]GOTO103
N010IF[#4007NE40]GOTO106
IF[#1001EQ1.]GOTO105
IF[#1000EQ1.]GOTO008
IF[#13EQ#0]GOTO001
IF[#13NE6]GOTO101
M106
N001#30=#2-#550
IF[#30EQ0]GOTO030
#3=#4001
#5=#4003
G00G90
#6=#5021
IF[#30GT0]GOTO002
IF[#30GT-180]GOTO003
#30=#30+360
GOTO003
N002IF[#30LE180]GOTO003
#30=#30-360
N003IF[#4006EQ20]GOTO020
#31=ROUND[#30*1780.2358]/1000
#32=#5021+#31
IF[#32GT0.]GOTO004
IF[#32GT-610.]GOTO006
#33=-610.-#31
#32=-610.
GOTO005
N020#31=ROUND[#30*700.88025]/10000
#32=#5021+#31
IF[#32GT0.]GOTO004
IF[#32GT-24.01575]GOTO006
#33=-24.01575-#31
#32=-24.01575
GOTO005
N004#33=0.-#31
#32=0.
N005G53X#33
N006M123
G04P300
M122
G04P300
G53#32
M121
M124
IF[#5EQ90]GOTO0011
G53X#6
N011G#3G#5
N030IF[#2NE0]GOTO007
M120
N007#550=#2
IF[#13EQ#0]GOTO008
M107
N008#3003=0
M99
N100#3003=0
#3000=500
N101#3003=0
#3000=501
N102#3003=0
#3000=502
N103#3003=0
#3000=503
N104#3003=0
#3000=504
N105#3003=0
#3000=505
N106#3003=0
#3000=506
 

Billet454

Plastic
Joined
Jul 16, 2021
I changed #3003=1 to #3003=0, this allows me to use single block. I stepped through the entire program, line by line, and it did the exact same thing as it was doing in automatic mode. The pallet unlocks, locks, no rotation, no alarm, no error.
 

angelw

Diamond
Joined
Sep 10, 2010
Location
Victoria Australia
I changed #3003=1 to #3003=0, this allows me to use single block. I stepped through the entire program, line by line, and it did the exact same thing as it was doing in automatic mode. The pallet unlocks, locks, no rotation, no alarm, no error.
Hello Billet454,
That would depend on the setting of a parameter bit as to how #3003 has the control react. It still may not be actually progressing via Single Block when there are a number of consecutive Macro Statement. I wont have my hands on a parameter book until tomorrow to be able to advise what parameter it is.

As I said in an earlier Post, I believe that the index section of the program is that shown below. However, if this last listing of the program is a true representation of the program you have running, then it still has errors. The Block below G53#32 should be G53X#32, or is this a Typo of yours?

M122
G04P300
G53#32
M121
M124
IF[#5EQ90]GOTO0011
G53X#6

However, lets say that the program you're running does actually read as follows:
M122
G04P300
G53X#32
M121
M124
IF[#5EQ90]GOTO0011
G53X#6

then, as I stated in an earlier Post, put M00 in a Block immediately before G53X#32 as in the following and run the program. If the program doesn't stop at the M00, then you have a Conditional Statement that is making the program Branch to the end of the program, past that part of the program.

M122
G04P300
M00
G53X#32
M121
M124
IF[#5EQ90]GOTO0011
G53X#6

It will be probably easier for you to put an End Of Block in a Block by itself, between every Block in your program. To have the Program Single Block though every Block in the Program using #3003, you will have to change a parameter Bit.

If the program gets to the M00 above, the machine will surely index the pallet, for there are many iterations in your program to skirt around the above code if the index coordinate passed to the Macro is out of range or the same as the current position.

If you get to the point where the control is actually stepping through each and every Block in the program, you will definitely be able to see where the Local Variable #2 is Passed through to the Macro Program and where #2 is modified and passed on to #32. In Single Block through the Macro Conditional Statements, you will be able to identify if, when and why the program may be branching through to the end and not executing the Index part of the program.

Regards,

Bill
 

Billet454

Plastic
Joined
Jul 16, 2021
This is the download from the machine, and yes I agree with the missing "X" with the G53, and that makes perfect sense. The #3003 setting is for single block according to my programing manual, and yes his would be an entry error on my part. I will make the change today and try it again to see what happens, but I believe you have found the issue. I'll let you know as soon as I try it out. Thank you!
 

angelw

Diamond
Joined
Sep 10, 2010
Location
Victoria Australia
This is the download from the machine, and yes I agree with the missing "X" with the G53, and that makes perfect sense. The #3003 setting is for single block according to my programing manual, and yes his would be an entry error on my part. I will make the change today and try it again to see what happens, but I believe you have found the issue. I'll let you know as soon as I try it out. Thank you!
If the "X" was missing in the G53#32 Block, from the program you have been running, then I doubt that part of the program is being executed, meaning that a Conditional Statement upstream is branching past the Index part of the program. If the program had got to that part of the program, trying to execute G53#32 would have raised an alarm.

Yes, the setting of #3003 is to inhibit or allow Single Block in a program. For example, you may use #3003 set to inhibit Single Block in a Custom Macro for Continuous Threading, or some other program where to Single Block the Program would be detrimental. But the way in which #3003 behaves is determined by a parameter. I won't go into all scenarios, as you will find them in the Macro Programming section of your manual, but with the parameter bit set to the default setting, #3003 will only allow Single Block function in NC operations and not Macro Statements.

Accordingly, I suggest again that you add an EOB between each Block of your program and that way, Single Block will work for every Block in your program without having to change the parameter bit. Once you get to the point where you know for sure that Single Block is working with all Blocks in your Program, Single Block through your program, taking note of the values of Variables and then determine if the variable, if used in a Conditional Block would bypass the Index section of your program.

Before using the Single Block method to debug your program, I would put an M00 just before the G53 X#32 Block and run the program normally. If the program doesn't find its way to and stop at the M00, then the Conditional Blocks are directing your program to branch past that part of the program. If that is the case, then I would start with the Single Block method of debugging.

Regards,

Bill
 

Billet454

Plastic
Joined
Jul 16, 2021
Will do sir. Thank you for all your help and insight. I truly do appreciate you and your abilities. I will let you know what happens as I work through the steps you have outlined for me to follow. Thank you again very much.
 

Billet454

Plastic
Joined
Jul 16, 2021
If the "X" was missing in the G53#32 Block, from the program you have been running, then I doubt that part of the program is being executed, meaning that a Conditional Statement upstream is branching past the Index part of the program. If the program had got to that part of the program, trying to execute G53#32 would have raised an alarm.

Yes, the setting of #3003 is to inhibit or allow Single Block in a program. For example, you may use #3003 set to inhibit Single Block in a Custom Macro for Continuous Threading, or some other program where to Single Block the Program would be detrimental. But the way in which #3003 behaves is determined by a parameter. I won't go into all scenarios, as you will find them in the Macro Programming section of your manual, but with the parameter bit set to the default setting, #3003 will only allow Single Block function in NC operations and not Macro Statements.

Accordingly, I suggest again that you add an EOB between each Block of your program and that way, Single Block will work for every Block in your program without having to change the parameter bit. Once you get to the point where you know for sure that Single Block is working with all Blocks in your Program, Single Block through your program, taking note of the values of Variables and then determine if the variable, if used in a Conditional Block would bypass the Index section of your program.

Before using the Single Block method to debug your program, I would put an M00 just before the G53 X#32 Block and run the program normally. If the program doesn't find its way to and stop at the M00, then the Conditional Blocks are directing your program to branch past that part of the program. If that is the case, then I would start with the Single Block method of debugging.

Regards,

Bill
You were SPOT ON sir. Thank you again for your help, hopefully I can epay the kindness by helping someone else in need as well.
 

angelw

Diamond
Joined
Sep 10, 2010
Location
Victoria Australia

Camtasia 2022.2.0 Crack With Software Key [2022] Free Download​


Camtasia Studio Free DownloadThis tool is best for video editing. It is much more efficient than other programs that require a lot of information and do not give the best results. Moreover, you create new ideas from this tool. Camtasia Studio Serial Number Last has proven to be the most powerful. It gives you free access to great premium screenshot features. If you want to output a video of a particular quality, you do so.
Yes, well. That's entirely relevant to this Thread, "Macro Programming Fundamentals"; NOT!
Which part of the title didn't you understand? I do hope that the creators of this Software are a lot more on the ball than you seem to be.
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
I'm using DPRNT to write some macro results to the dataserver on my Fanuc30i machine. The files are automatically named PRNT0000.DAT, PRNT0001.DAT, etc.

Is there a way to specify the file name/number?

If I leave files in there, when the machine is power-cycled, it reverts back to PRNT0000.DAT and will alarm when trying to write data if the file is already there.

Or is it possible to change setting to overwrite existing file if the name is equal?
 

GiroDyno

Aluminum
Joined
Apr 19, 2021
Location
PNW
Is there a way to enter feed hold mode (not M0/M01 stops) by setting a variable? I see #3004 is override controls that can disable/enable feed hold, but what about activating it?
We have some cast parts that need to have vanes aligned properly. I'm brining a drill down near the part so operators can turn the part until it aligns with a hole, but they need to actually jog it down into the hole while turning the part for alignment.
In Haas-land we can use the "run-stop-jog-continue" function to do this mid program, but it must be done from feed hold state rather than M0; if you use it in M0 the program restarts. Right now I have an M0 to make sure we don't skip past the alignment stage, and then a dwell period to give operators a second to enter feed hold mode. I'd like to have it just go straight into hold by itself, is that possible?
 

TeachMePlease

Diamond
Joined
Feb 11, 2014
Location
FL
Is there a way to enter feed hold mode (not M0/M01 stops) by setting a variable? I see #3004 is override controls that can disable/enable feed hold, but what about activating it?
We have some cast parts that need to have vanes aligned properly. I'm brining a drill down near the part so operators can turn the part until it aligns with a hole, but they need to actually jog it down into the hole while turning the part for alignment.
In Haas-land we can use the "run-stop-jog-continue" function to do this mid program, but it must be done from feed hold state rather than M0; if you use it in M0 the program restarts. Right now I have an M0 to make sure we don't skip past the alignment stage, and then a dwell period to give operators a second to enter feed hold mode. I'd like to have it just go straight into hold by itself, is that possible?

It'd help a lot if you told us what control...
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
Its a Haas, not the NGC tho
You can control Single block, block delete, optional stop with #3030, #3032, #3033

If you set #3030 to 1, this is the same as pressing the single-block button on the control. Put it wherever you want.

I think you can probably do something like
#3030=1
(empty line)
#3030=0

I think that will stop in singleblock mode. You'd still have to press feed hold to stop-jog-continue. Pressing start again should turn off singleblock and continue.
 

GiroDyno

Aluminum
Joined
Apr 19, 2021
Location
PNW
You can control Single block, block delete, optional stop with #3030, #3032, #3033

If you set #3030 to 1, this is the same as pressing the single-block button on the control. Put it wherever you want.

I think you can probably do something like
#3030=1
(empty line)
#3030=0

I think that will stop in singleblock mode. You'd still have to press feed hold to stop-jog-continue. Pressing start again should turn off singleblock and continue.
That'll do!
Didn't need the empty line because it stops on the single block line, just press feed hold to enter jog mode, then cycle start x2 to exit RSJ and turn SB off.
Its the same number of button presses but I like removing the dwell timer for hitting feed hold.
 








 
Top