Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
**cl record ***
CYCLE/TURN,ZAXIS,0.075,XAXIS,0.025,DEPTH,0.5,FEED,0.008
***FIL CODE**
CYCTYP=POSTF(7,4)
IF (CYCTYP.EQ.ICODEF(TURN)) THEN
NBARG=POSTF(5)
DO/LL1,ILOOP=5,NBARG
ARG=POSTF(7,ILOOP)
ARGTYP=POSTF(6,ILOOP)
IF (ARGTYP.EQ.0) THEN
$$ This is a minor word
CASE/ARG
WHEN/ICODEF(DEPTH)
dp=POSTF(7,(ILOOP+1))
WHEN/ICODEF(ZAXIS)
za=POSTF(7,(ILOOP+1))
ENDCAS
ENDIF
LL1) CONTIN
********
Dear gpost guru
I need to extract the data from CL record to generate the G71 CYCLE
from the above cl record , I am not able to get the VALUE for DEPTH
since the system understand DEPTH as text
What should I do so that the system understand DEPTH has minor word.
Please help ???
Solved! Go to Solution.
This Pro NC Post Processor is written by Austin Corp, so it is an outside company that they just attach their program to. It is a good idea as many CAM companies use this Post Processor.
The thing is that INSERT, and actually most of the commands in Pro NC redirect the program pointer to an internal sub that wipes out the registers for the current command. You could use POSTF(21) to reestablish the registers if you want after using INSERT each time. Still doing all the non-command calculations together is the best choice. Make sure POSTF(20) is saved at the beginning of the sub.
Hi Paulson,
when extracting records from a CL record, remember your POSTF(7,4). That is the key. The 4 is the location in the CL file. For each parameter after "TURN" add one, so Z would be 6. X would be 8, Depth would be 10, and feed would be 12. The words ZLOC, XLOC, DEPTH, and FEED are minor words, but in this case are only place keepers to make reading the CL FILE easier. Creo will always create these lines in a fixed format so all you need to do is load variables. You also don't have to look for the text separately. You will have to prove this out and get the variables where they belong. The CL file will tell you what it loads each of your variables with.
ZA = POSTF(7,6) $$SAVE Z LOCATION
XA = POSTF(7,8) $$SAVE X LOCATION
DP = POSTF(7,10) $$SAVE DEPTH
FD = POSTF(7,12) $$SAVE FEED RATE
If you wish to stay with the DO loop, then when you read the XAXIS you can use ILOOP+3, or after finding FEED you can use ILOOP -1.
Another thing you can do is if DEPTH doesn't come up, you can go in and add the minor word to your file with PPWORD/DEPTH,(Open number) in your global variable section. The top of the CL_FILE will have a list of the minor words and their numbers. At the same time check to see if the number for DEPTH is used twice. If it is, use a different open number keep the number between 3101 and 4095. You will need to modify UNCMIL.V00 that is with all your post processor files. SAVE A BACKUP!
There is enough ideas to start with.
Have fun!
hi Scott Moorman,
Thanks for your time , and giving a very detail explanation.
and for looping , ILOOP+1 SHOULD BE FINE TO GET THE VALUE
mistake what I did was used INSERT function for debugging, which gave wrong answer
example
ZA = POSTF(7,6) $$SAVE Z LOCATION
INSERT/'ZA=',ZA,'$'
XA = POSTF(7,8) $$SAVE X LOCATION
INSERT/'XA=',ZA,'$'
DP = POSTF(7,10) $$SAVE DEPTH
INSERT/'DP=',DP,'$'
FD = POSTF(7,12) $$SAVE FEED RATE
INSERT/'FD=',FD,'$'
For the above program only ZA was coming ok
correct program
ZA = POSTF(7,6) $$SAVE Z LOCATION
XA = POSTF(7,8) $$SAVE X LOCATION
DP = POSTF(7,10) $$SAVE DEPTH
FD = POSTF(7,12) $$SAVE FEED RATE
INSERT/'ZA=',ZA,'$'
INSERT/'XA=',ZA,'$'
INSERT/'DP=',DP,'$'
INSERT/'FD=',FD,'$'
Why does the output value change when we add insert function between the program?
If that's your actual code, you are outputting ZA twice, once with "ZA=" and once with "XA=". Or if that was just a typo in your message, I'm sorry.
This Pro NC Post Processor is written by Austin Corp, so it is an outside company that they just attach their program to. It is a good idea as many CAM companies use this Post Processor.
The thing is that INSERT, and actually most of the commands in Pro NC redirect the program pointer to an internal sub that wipes out the registers for the current command. You could use POSTF(21) to reestablish the registers if you want after using INSERT each time. Still doing all the non-command calculations together is the best choice. Make sure POSTF(20) is saved at the beginning of the sub.
Hi Scott Moorman,
Thanks for you reply,
I am very much clear with your answer,
I was able to move forward with my post processor.
Thank you very much for your support.