Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

can we do a condition on PFXOUT, PFYOUT or PFZOUT?


Recommended Posts

Hello everyone,

   I tried to do an "IF, ELSE" condition for PFXOUT, PFOUT, PFZOUT and I failed.  Is there away I can make it work for the condition?

 

 

Under....

ptlchg_com      #Tool change common blocks

pbld, no_spc$, no_spc$, sgcode, [if gcode$ = 1, sgfeed], pfxout, [if pfxout <>0, "EXTRA MOVEMENT FROM REFEDRENCE POINTS",], pfyout, [if speed <> zero, pfspindleout], [if gcode$ = 1, *feed], e$ #APPROACH HERE

 

 

Thank you for our helps.

Link to comment
Share on other sites

You say you tired IF and Else and they failed. Mind sharing your failures to gleam what you are trying to accomplish?  Explain what you are trying to accomplish and what your previous attempts resulted in. What you have currently make no sense to me and not sure how to help you sort it out when I can not make head of tails of it. 

Link to comment
Share on other sites

First off just want to say.. never have I ever seen someone who was so obsessed with comments.. way too much trouble if you ask me .. if operators cant read code and figure it out they should find a job making burgers.. hell the burger guys will probably be better paid before long the way things are going.. but I digress..

 

I am not sure, but I don't think you can do what your trying to do like your trying to do it..

 

I think a lot of the problems you are running into is that you are attempting to make decisions use if / then / else statements where the variables you want to check are not instantiated.. you need to make sure you check for them in a postblock where they are actually there .. sometimes that means some extra steps to follow your data around so to speak..

 

Probably would need to create a variable prior to that line in ptlchg_com postblock and use it to identify that is where you are coming into pfxout from..

 

So basically set a variable at the beginning of post processing

 

camefromtlchg_com = 0

 

so you have a default value of 0 (false)

 

 

then when you enter ptlchg_com you set it to 1 (true) like follows before you have your call to pfxout

 

camefromtlchg_com = 1

 

then inside of pfxout you could check for your flag

 

if camefromtlchg_com = 1 check to determine what pfxout would output - cause now your in the pfxout postblock and can test variables to see what it would output..

 

based on the result / and your desired bahaviour, you could either set a variable to indicate output later,  and/or output whatever extra comment you wanted..

 

then once you got back into ptlchg_com you reset the camefromtlchg_com flag like camefromtlchg_com = 0

  • Like 1
Link to comment
Share on other sites

You say you tired IF and Else and they failed. Mind sharing your failures to gleam what you are trying to accomplish?  Explain what you are trying to accomplish and what your previous attempts resulted in. What you have currently make no sense to me and not sure how to help you sort it out when I can not make head of tails of it. 

 

Hello 5th Axis Consulting,

   Thank you for your respond, I'm apologize for my neglect not to explain things well.  Sometimes, I'm using REFERENCE POINTS, APPROACH feature such as X, Y, Z moves addition to what I already had in LEAD IN/OUT.

 

    I would like the post automatically to spits out the COMMENT as I wanted by using IF, ELSE, THEN....  

 

For instance,

N13(.2500, 1/4 JOBBER DRILL, HSS, 118DEG,)
(2FLTS 2.750LOC, 3.00LOH)
G0 G17 G40 G49 G80 G90
G53 Z0. M19
G54 X0.
G53 Y0. M45(CEILING/ BASE COOLANT ON)
T13 M6(DRILL 8X .250 THRU HOLES, CUT#58)
G0 G17 G90 G54
X1. Y2. S2292 M3 (ADDITIONAL XY APPROACH VALUE HERE)
G43 H13 Z3. /M8(DOC= Z-.6001)
X-1.375 Y1.375 Z1.
(7 PECKS TDOC= -.5376)
G98 G83 Z-.6001 R.0625 Q.1 F11.46
X-.2822 Y1.225
X.2822
X1.375 Y1.375
Y-1.375
X.2822 Y-1.225
X-.2822
X-1.375 Y-1.375
G80
X4. Y5. Z6. M9 (ADDITIONAL XYZ RETRACT VALUE HERE)
G90 G53 Z0. M5
G54 X0.
G53 Y0. M46(CEILING/ BASE COOLANT OFF) 
M30(1,056CHARS - 1.06KB)
%
 
Screenshot:
 
 
Therefore, I'm trying to use a conditional here if I can:
pbld, no_spc$, no_spc$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if speed <> zero, pfspindleout], [if gcode$ = 1, *feed], e$ #APPROACH HERE

 

 

Thank you for your responds.

Link to comment
Share on other sites

First off just want to say.. never have I ever seen someone who was so obsessed with comments.. way too much trouble if you ask me .. if operators cant read code and figure it out they should find a job making burgers.. hell the burger guys will probably be better paid before long the way things are going.. but I digress..

 

I am not sure, but I don't think you can do what your trying to do like your trying to do it..

 

I think a lot of the problems you are running into is that you are attempting to make decisions use if / then / else statements where the variables you want to check are not instantiated.. you need to make sure you check for them in a postblock where they are actually there .. sometimes that means some extra steps to follow your data around so to speak..

 

Probably would need to create a variable prior to that line in ptlchg_com postblock and use it to identify that is where you are coming into pfxout from..

 

So basically set a variable at the beginning of post processing

 

camefromtlchg_com = 0

 

so you have a default value of 0 (false)

 

 

then when you enter ptlchg_com you set it to 1 (true) like follows before you have your call to pfxout

 

camefromtlchg_com = 1

 

then inside of pfxout you could check for your flag

 

if camefromtlchg_com = 1 check to determine what pfxout would output - cause now your in the pfxout postblock and can test variables to see what it would output..

 

based on the result / and your desired bahaviour, you could either set a variable to indicate output later,  and/or output whatever extra comment you wanted..

 

then once you got back into ptlchg_com you reset the camefromtlchg_com flag like camefromtlchg_com = 0

 

 

Hi DJSTEDMAN,

   I used to work for a mid-side company (about 120 employees: 10 programmers and 80 setup man, + some office people).  It was demanded to write NOTES for every operation because usually we run 2D-HIGH SPEED machining and if we don't have notes setup man sometimes afraid to do the setup such as minimum feed rate of F200. or more.  

 

   Setup men don't have the ability to see what inside of MASTERCAM we programmed, they only can run G-CODES and sometimes it costs them time to CALCULATE "I, J, K" and take time to figure things out.  Therefore, all the NOTES must be there and it is required by the GENERAL DIRECTOR.  

 

    Thank you for you respond, and I will try your way as you directed.  Once again, thank you for your input. 

 

Best regards.

Link to comment
Share on other sites

Hi DJSTEDMAN,

   I used to work for a mid-side company (about 120 employees: 10 programmers and 80 setup man, + some office people).  It was demanded to write NOTES for every operation because usually we run 2D-HIGH SPEED machining and if we don't have notes setup man sometimes afraid to do the setup such as minimum feed rate of F200. or more.  

 

   Setup men don't have the ability to see what inside of MASTERCAM we programmed, they only can run G-CODES and sometimes it costs them time to CALCULATE "I, J, K" and take time to figure things out.  Therefore, all the NOTES must be there and it is required by the GENERAL DIRECTOR.  

 

    Thank you for you respond, and I will try your way as you directed.  Once again, thank you for your input. 

 

Best regards.

 

I have run about 40 million lines of code on this one part I have been working on for the last 3 months. Not once has anyone ever had to go back and check my IJK. If the program gets to the floor and is it that poor that the set up guy has to go behind me and check IJK for my work I need to be fired plain and simple. I use to write 2k to 40k lines of code by handle and would spend weeks making program with pencil and paper and even then it was rare someone had to go behind me and catch my math mistakes. That is what CAM is for to make your life easier not hard. To help your company make money not lose it. You should be able to post and go with your program.

Link to comment
Share on other sites

First off just want to say.. never have I ever seen someone who was so obsessed with comments.. way too much trouble if you ask me .. if operators cant read code and figure it out they should find a job making burgers.. hell the burger guys will probably be better paid before long the way things are going.. but I digress..

 

I am not sure, but I don't think you can do what your trying to do like your trying to do it..

 

I think a lot of the problems you are running into is that you are attempting to make decisions use if / then / else statements where the variables you want to check are not instantiated.. you need to make sure you check for them in a postblock where they are actually there .. sometimes that means some extra steps to follow your data around so to speak..

 

Probably would need to create a variable prior to that line in ptlchg_com postblock and use it to identify that is where you are coming into pfxout from..

 

So basically set a variable at the beginning of post processing

 

camefromtlchg_com = 0

 

so you have a default value of 0 (false)

 

 

then when you enter ptlchg_com you set it to 1 (true) like follows before you have your call to pfxout

 

camefromtlchg_com = 1

 

then inside of pfxout you could check for your flag

 

if camefromtlchg_com = 1 check to determine what pfxout would output - cause now your in the pfxout postblock and can test variables to see what it would output..

 

based on the result / and your desired bahaviour, you could either set a variable to indicate output later,  and/or output whatever extra comment you wanted..

 

then once you got back into ptlchg_com you reset the camefromtlchg_com flag like camefromtlchg_com = 0

 

Been saying that same thing for a while.

Link to comment
Share on other sites

Hello 5th Axis Consulting,

   Thank you for your respond, I'm apologize for my neglect not to explain things well.  Sometimes, I'm using REFERENCE POINTS, APPROACH feature such as X, Y, Z moves addition to what I already had in LEAD IN/OUT.

 

    I would like the post automatically to spits out the COMMENT as I wanted by using IF, ELSE, THEN....  

 

For instance,

N13(.2500, 1/4 JOBBER DRILL, HSS, 118DEG,)
(2FLTS 2.750LOC, 3.00LOH)
G0 G17 G40 G49 G80 G90
G53 Z0. M19
G54 X0.
G53 Y0. M45(CEILING/ BASE COOLANT ON)
T13 M6(DRILL 8X .250 THRU HOLES, CUT#58)
G0 G17 G90 G54
X1. Y2. S2292 M3 (ADDITIONAL XY APPROACH VALUE HERE)
G43 H13 Z3. /M8(DOC= Z-.6001)
X-1.375 Y1.375 Z1.
(7 PECKS TDOC= -.5376)
G98 G83 Z-.6001 R.0625 Q.1 F11.46
X-.2822 Y1.225
X.2822
X1.375 Y1.375
Y-1.375
X.2822 Y-1.225
X-.2822
X-1.375 Y-1.375
G80
X4. Y5. Z6. M9 (ADDITIONAL XYZ RETRACT VALUE HERE)
G90 G53 Z0. M5
G54 X0.
G53 Y0. M46(CEILING/ BASE COOLANT OFF) 
M30(1,056CHARS - 1.06KB)
%
 
Screenshot:
 
 
Therefore, I'm trying to use a conditional here if I can:
pbld, no_spc$, no_spc$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if speed <> zero, pfspindleout], [if gcode$ = 1, *feed], e$ #APPROACH HERE

 

 

Thank you for your responds.

 

Why not use a misc value to trigger this verse this convoluted more complex method? Look for the NCI trigger and use that number?

 

I am sorry, but you chase your elbow around your knee to your back with a lot of the exercises. There are more elegant ways to convey information and really like what you are trying to do with the setup sheets. I think that should be your focus not this.

Link to comment
Share on other sites

Hello 5Th Axis Consulting,

Thank you for your suggestions and to be honest I used all the "Misc Value" boxes already for the M-Code purposes of Vertical and Horizontal.

 

The reason I'm using the Reference Points, Approach and Retract because of the Horizontal purposes.

 

I did try to contact Colin to help me out but he is so busy for this season right now. I guess I'm going to send him my last payment check then I just have to get help from one of you guys for Post Training.

 

Therefore, if you know any body who is willing to train me through "Net Meeting" please let me know.

 

 

Thank you for your help and understanding.

Link to comment
Share on other sites

Hello 5Th Axis Consulting,

Thank you for your suggestions and to be honest I used all the "Misc Value" boxes already for the M-Code purposes of Vertical and Horizontal.

 

The reason I'm using the Reference Points, Approach and Retract because of the Horizontal purposes.

 

I did try to contact Colin to help me out but he is so busy for this season right now. I guess I'm going to send him my last payment check then I just have to get help from one of you guys for Post Training.

 

Therefore, if you know any body who is willing to train me through "Net Meeting" please let me know.

 

 

Thank you for your help and understanding.

 

Okay why didn't you use Cantext for the M codes to leave room it to be used for it or redo it so you can use them for this? Also you can create sub sections with the mi and mr with using decimals. or number ranges. You want mr1 to have more function then 1-10 is one function 10-20 is another function and so on and so on. Need to come up with a good documentation process, but the mi and mr are just triggers. Control the triggers and the sky is the limit on how they can be used.

  • Like 1
Link to comment
Share on other sites

Okay why didn't you use Cantext for the M codes to leave room it to be used for it or redo it so you can use them for this? Also you can create sub sections with the mi and mr with using decimals. or number ranges. You want mr1 to have more function then 1-10 is one function 10-20 is another function and so on and so on. Need to come up with a good documentation process, but the mi and mr are just triggers. Control the triggers and the sky is the limit on how they can be used.

Hello 5th Axis Consultant,

   Honestly, I never get trained on how to create the CANTEXT in the MD and the post.  It would be great if I know how to do it. Once again, thank you for your respond.

Link to comment
Share on other sites

Hello 5Th Axis Consulting,

Thank you for your suggestions and to be honest I used all the "Misc Value" boxes already for the M-Code purposes of Vertical and Horizontal.

 

 You really used all 10 values to swap out different M codes depending on if you are programming a horizontal or a vertical? To each their own, tho it sounds like something that no one besides yourself is ever going to be able to follow. Ron is correct, cantext would be a much more suitable and flexible spot to put these.....tho I can't imagine why you would want or need all these switches.

 

The X style coolant uses cantext to control output. That would be a good example of how to implement all these switches.

Link to comment
Share on other sites

Hello 5th Axis Consultant,

   Honestly, I never get trained on how to create the CANTEXT in the MD and the post.  It would be great if I know how to do it. Once again, thank you for your respond.

 

Guess what I have never had one post training class in my life. I had to figure it out and got plenty of help from this forum so sorry if I seem rough with you, but if someone like me a figure it out then I think anyone can figure it out.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...