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:

Recalling Comments


crazy^millman
 Share

Recommended Posts

I have been working on a post that does probing. Well I got my dprnts all worked out now thanks to CNC APPS guy and well now I am wanting to take the comment and use it, problem is once it is used it does not use it again. I hate buffers could never figure them out so was trying to use comment$ = sav_comment but that is not working. So if anyone knows of a good way to do this I am all ears even if it means using buffers. wink.gifwink.gif I guess for know I am going to do string and do feature and then I will add to the string and every time I measure something I will just have it add to that string.

 

As always any and all help is greatly appreciated.

Link to comment
Share on other sites

comment$ is not a variable, it is a command. You cannot save its value. The post guide does a pretty decent job explaining exactly what the command does but in a nutshell it basically tells MP to dump the contents of the comment buffer. What happens to the individual comments at that point is really up to you to decide.

 

If you are simply looking to capture a comment for output later in the operation in which it appears you can do so by checking for the relevant gcode like we do in our .set files

 

ie.

 

code:

pcomment2        #Output Comment from manual entry

sopcomment = snull

scomm$ = ucase(scomm$)

if gcode$ = 1051, smachname = scomm$ #Machine name

if gcode$ = 1052, sgrpcomm = scomm$ #Group comment

if gcode$ = 1053, sgrpname = scomm$ #Group name

if gcode$ = 1008, sopcomment = scomm$ #Operation comment

However, if you are looking to use comments in subsequent operations then you will need to buffer the data.

Link to comment
Share on other sites

Yes Paul that is what I am looking to do and you confirmed what I already suspected. It is external output I need to control not internal handling. I describe my operation very precisely so that when it is probing a hole in View W-W Sheet 10 Zone G-5 who ever is running it can see that when running the program. Well I want the same output for the probing I am doing to that feature. If not then I am having ot go back and put it in the code by hands a waste of time if you ask me. I guess I can do it through Manual Entry was looking to save myself some trouble is all since it is there, just pull it our when I post that operation and life is good.

 

Thanks for the suggestions Reece and Bradst and for taking the time to look at my problem. Yes Reece it changes every time you do something like a Boss for one thing, then you are doing a surface, or a stock Material check. With that I want who ever needs to follow it to be able to follow it and in essence be able to read my mind and think what I was thinking.

 

Paul you would think after all these years I would have figured out buffers, but it is still one that eludes me.

Link to comment
Share on other sites

Yeah James I am pulling my hair outright now.

 

Here is what I did and got so far those who are far better at this can correct me and I gladly welcome it.

 

I initialized my buffer output variable here:

 

code:

buf_comment  : 0    #For comments Buffer  

I only need one Column so I define my buffer reuqirments here:

 

code:

# --------------------------------------------------------------------------

# Buffer 7 - Holds the Comments to be used Later

# --------------------------------------------------------------------------

rc7 : 1

fbuf 7 0 1 0 0 # Buffer 7


I then put it in the post here:

 

code:

 psof$            #Start of file for non-zero tool number             

 

##### Custom changes allowed below #####

pwritbuf7

if ntools$ = one,

[

skip single tool outputs, stagetool must be on

stagetool = m_one

!next_tool$

]

 

if drillcyc$ = 10, #Bore/Boss

[

pdrlcommonb

pbld, n$, *sg00, *prorefht, e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *strg659814, diadwell, [if shftdrl$ = zero, *zbossdep], [if radclear, *radclear], [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *sg00, *prorefht, e$

if drl_prm10$,

[

spaces$ = 0

preadbuf3

sdprint, "[", *buf_comment, "]", e$ ##Not working Like I would want RDB


That right before a StartBin I put this:

 

code:

# --------------------------------------------------------------------------

# Buffer 7 Read / Write Routines for posting out comments when doing Probing Routines and a DPRNT

# --------------------------------------------------------------------------

pwritbuf7 # Write Buffer 1

comment$ = wbuf(7,rc7)

 

preadbuf7 # Read Buffer 1

buf_comment = rbuf(7,rc7)

#size7 = rbuf(7,0)

#while rc7 <= size7,

# [

# if rc7 <= size7, buf_comment = rbuf(7,rc7)

# ]


As you can see and not see I have been tinkering with this and can not get it. I looked at mpmaster to help and it does some, but I need only one buffer and from what I read in the other thread I posted up I only need to define one buffer varaible. I did that and nothing.

 

I guess my next question would be can comment even be buffered out this way. I see numbers can, but how about text?? Does the MP buffer handle text or does it only handle numbers????

 

Again any help is greatly appreciated.

Link to comment
Share on other sites

Ron,

First you have to fill the buffer before you write it out. I have a post that spits out G10's and a Tool List. It has tempwc7 : 0 and tempwc8 : 0

 

If any of this helps great

 

 

code:

 # --------------------------------------------------------------------------

# Buffer 7 - Holds the variable 'mi1' for each toolpath segment

# --------------------------------------------------------------------------

rc7 : 1

wc7 : 1

tempwc7 : 0

size7 : 0

fbuf 7 0 1 0 0 # Buffer 7

 

# --------------------------------------------------------------------------

# Buffer 8 - Holds the variables 'tox,toy,toz' for each G54 toolpath segment

# --------------------------------------------------------------------------

rc8 : 1

wc8 : 1

tempwc8 : 0

size8 : 0

fbuf 8 0 4 0 0 # Buffer 8


code:

 # --------------------------------------------------------------------------

# Toolchange / NC output Variable Formats

# --------------------------------------------------------------------------

fmt T 4 t$ #Tool No

fmt T 4 first_tool$ #First Tool Used

fmt T 4 next_tool$ #Next Tool Used

fmt D 4 tloffno$ #Diameter Offset No

fmt H 4 tlngno$ #Length Offset No

fmt P 4 g_wcs #WCS G address

fmt P 4 p_wcs #WCS P address

fmt P 4 p_l2 #L2 P address

fmt S 4 speed #Spindle Speed

fmt M 4 gear #Gear range

# --------------------------------------------------------------------------

fmt N 4 n$ #Sequence number

fmt N 4 tseqno #tool change seq number

fmt X 2 xabs #X position output

fmt Y 2 yabs #Y position output

fmt Z 2 zabs #Z position output

fmt X 3 xinc #X position output

fmt Y 3 yinc #Y position output

fmt Z 3 zinc #Z position output

fmt X 2 toxtmp #X G10 pos

fmt Y 2 toytmp #Y G10 pos

fmt Z 2 toztmp #Z G10 pos

fmt B 2 toctmp #B G10 pos

fmt A 11 cabs #C axis position

fmt A 14 cinc #C axis position

fmt A 4 indx_out #Index position

fmt R 14 rt_cinc #C axis position, G68

fmt I 3 i$ #Arc center description in X

fmt J 3 j$ #Arc center description in Y

fmt K 3 k$ #Arc center description in Z

fmt K 2 lead #Helical lead

fmt R 2 arcrad$ #Arc Radius

fmt F 15 feed #Feedrate

fmt P 11 dwell$ #Dwell

fmt M 5 cantext$ #Canned text

# --------------------------------------------------------------------------


code:

 # --------------------------------------------------------------------------

# Misc. Output

# --------------------------------------------------------------------------

pparameter$ # Run parameter table

if opcode$=13 | opcode$=14, result = fprm (opcode$)

if prmcode$ = 10000, stoper = ucase(sparameter$)

if prmcode$ = 10055, spostname = ucase(sparameter$)

if stoper=snull, stoper = snullop

 

pwrttparam$ #Information from parameters

if prmcode$ = 20004, slot = rpar(sparameter$, 16)

if prmcode$ = 20006, cut_ability = rpar(sparameter$,8)

if prmcode$ = 20007, pilot_dia = rpar(sparameter$, 11)

 

pfillbuf78 #Fill buffers 7 and 8

zero = wbuf(7,wc7)

zero = wbuf(8,wc8)

 

plistl2 #G10 list

size7 = rbuf(7,0)

while size7>=rc7, plistl2_2

 

plistl2_2 # Define G54 fixture offsets

result = rbuf(7,rc7)

toxtmp = rbuf(8,rc8)

#if rc7 <= 10,

[

p_l2 = rc7 - 4 # L20 P address

if result = 1, n$,"G90", "G10", "L20", *p_l2, *toxtmp, *toytmp, *toztmp, e$ #*toctmp, e$

]

#else,

#[

#p_l2 = rc7 - 10 # L20 P address

#if result = 1, n$,"G90", "G10", "L20", *p_l2, *toxtmp, *toytmp, *toztmp, *toctmp, e$

#]

 

# --------------------------------------------------------------------------


code:

 psof$            #Start of file for non-zero tool number

ptravel

pwritbuf5

pcuttype

toolchng = one

if ntools$ = one,

[

#skip single tool outputs, stagetool must be on

#stagetool = m_one

!next_tool$

]

tooltotal = rbuf(4,0) #Reads total tool and null tool changes

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

 

if tool_table = 2, ppredstck,e$

if tool_table = 3, pmetastck,e$

 

spaces$=0

if output_z = yes$ & tcnt > 1,

[

"(OVERALL MAX - ", *z_tmax, ")", e$

"(OVERALL MIN - ", *z_tmin, ")", e$

]

spaces$=sav_spc

 

if plane$ < 0, plane$ = 0

#pbld, n$,*sgcode, "G28", "G91", "Z0", e$

#pbld, n$, *sgcode, *sgplane, "G40", "G80", *sgabsinc, e$

#pbld, n$,*smetric, e$

#"(*)", e$

plistl2

sav_absinc = absinc$

if wcstype <= one, #Work coordinate system

[

absinc$ = one

pfbld, n$, sgabsinc, "G28", *sgcode "Z0.", e$

pfbld, n$, "G28", "X0.", "Y0.", e$

pfbld, n$, "G92", *xh$, *yh$, *zh$, e$

absinc$ = sav_absinc

]

sav_mi9 = mi9$

sav_workofs = workofs$

if sav_workofs < 0, sav_workofs = 0

"(*)", e$

ptlchg_com


code:

 pheader$         #Call before start of file                         

if met_tool$ = one, #Metric constants and variable adjustments

[

ltol$ = ltol_m

vtol$ = vtol_m

maxfeedpm = maxfeedpm_m

]

result = nwadrs(srotary, cabs)

result = nwadrs(srotary, cinc)

result = nwadrs(srotary, indx_out)

"%", e$

spaces$=0

*progno$, " (", sprogname$, ")", e$

"(UNPROVEN-NOT SAVED)", e$

"(MACHINE-MATSURRA-405-HM-6)", e$

"(COMPANY- XXXXXXXXXXXXXX)", e$

"(PART-NUMBER- XXXXXXXXXX)", e$

"(PART-NAME- XXXXXXXXXXXX)", e$

"(OP-NUM- XXXXXXXXXXXXXXX)", e$

"(PROGRAM-BY-JIMMY XXXXXXXX)", e$

"(PROGRAM-DATE-", *smonth, "-", day$ , "-", year$ , ")", e$

"(PROVEN-BY XXXXXXXXXXXXX)", e$

"(CYCLE-TIME- XXXXXXXXXXX)", e$

"(*)", e$

spaces$=sav_spc

tseqno = t$, e$

sav_rot_on_x = rot_on_x

rot_on_x = 0

sav_progno = progno$

#seqno = 10

#seqinc = 10

#n = seqno

 

while wc7<54, pfillbuf78


code:

 # --------------------------------------------------------------------------

# Tooltable Output

# --------------------------------------------------------------------------

pwrtt$ # Write tool table, scans entire file, null tools are negative

if rotaxis$ > 0 | rotary_type$ > 0 | mill5$ <> 0,

[

rot_on_x = sav_rot_on_x

output_z = no$

]

#if vmc = 0 & tlplnno <> 2, rot_on_x = sav_rot_on_x

#if vmc = 1 & tlplnno > 1, rot_on_x = sav_rot_on_x

if tlplnno$ > 1, rot_on_x = sav_rot_on_x

tlplnno$ = wbuf(3,wc3) #Buffers out tool plane values

t$ = wbuf(4,wc4) #Buffers out tool number values

if tool_table = 1, ptooltable,e$

if tool_table = 2, ppredtool,e$

if tool_table = 3, pmetatool,e$

if t$ >= zero, tcnt = tcnt + one

ptravel

pwritbuf5

 

tempwc7 = workofs$ + 4

one = wbuf(7,tempwc7)

tempwc8 = workofs$ + 4

tox$ = wbuf(8,tempwc8)

 

ptooltable # Write tool table, scans entire file, null tools are negative

tnote = t$

toffnote = tloffno$

tlngnote = tlngno$

spaces$=0

if t$ >= zero,

[

#if tcr>0, "(", *t, ptspace, " | ", plistcomm, " | ", *tlngno, phspace, " | ", *tloffno, pdspace, " | ", *tldia, punit, pdiamspc, " | ", *tcr, " | ", popnote, ")"

#if tcr=0, "(", *t, ptspace, " | ", plistcomm, " | ", *tlngno, phspace, " | ", *tloffno, pdspace, " | ", *tldia, punit, pdiamspc, " | ", " | ", popnote, ")"

if tcr$>0, "(", *t$, ptspace, " ", plistcomm,")"

if tcr$=0, "(", *t$, ptspace, " ", plistcomm,")"

]

#if t >= zero,

# [

# "(", *t, ptspace, " - ", plistcomm, ")"

# ]

#if t >= zero,

# [

# if tcr>0, "(", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia, " ", *tcr, " ", popnote, ")"

# if tcr=0, "(", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia, " ", popnote, ")"

# ]

spaces$=sav_spc


this is sample program output

 

(T37 .515 33/64 HSS JOBBER DRILL)

(T08 1/2 3 FLT ENDMILL 1.5 LOC .03R)

(T49 .375 3 FLT CARBIDE E.M. 1.0 LOC)

(T39 .25 3 FLT CARBIDE E.M. .75 LOC)

(T81 .1094 7/64 2 FLT CARBIDE E.M. .375 LOC)

(T24 1/4 X 90 DEG SPOTDRILL)

(T25 .173 # 17 HSS DRILL)

(T51 .1495 #25 HSS JOBBER DRILL)

(T52 .1875 CARBIDE REAMER)

(T53 .1562 CARBIDE REAMER)

(T55 .1875 3 FLT CARBIDE E.M. .375 LOC)

(T50 .25 3 FLT CARBIDE W/.03R .75 LOC)

(T33 .25 CHAMFER MILL)

(T21 1/2 X 90 DEG SPOTDRILL)

(T65 .4375 7/16 HSS JOBBER DRILL)

(T40 .203 HSS JOBBER DRILL)

(T20 .02 ENGRAVING TOOL)

(*)

(SERIAL NUMBER CONTROLLED BY H503)

(PARTS COUNTER CONTROLLED BY H504)

IF[#10503GT#10504]GOTO9990

(*)

G90G10L20P31X0.Y15.4Z9.600B0.

G90G10L20P32X0.Y15.4Z9.765B0.

G90G10L20P33X0.Y15.4Z9.600B0.

G90G10L20P34X0.Y15.4Z9.765B0.

Link to comment
Share on other sites

You are wanting to save off 'comment' - aka. string data.

 

You are defining a numeric buffer ->

 

fbuf 7 0 1 0 0 # Buffer 7

 

You may need more work in the rest of your code (I did not look any further that the 'fbuf' statement), but start with this, define the buffer as a string buffer ->

 

fbuf 7 0 1 80 0 # Buffer 7

 

3rd parameter of '80' in the 'fbuf' declaration means "this buffer holds text (string) data".

Link to comment
Share on other sites

Ron,

I'd like to help but I still do not understand exactly what it is you are trying to achieve. From this:

 

code:

      if drillcyc$ = 10, #Bore/Boss

[

pdrlcommonb

pbld, n$, *sg00, *prorefht, e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *strg659814, diadwell, [if shftdrl$ = zero, *zbossdep], [if radclear, *radclear], [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *sg00, *prorefht, e$

if drl_prm10$,

[

spaces$ = 0

preadbuf3

sdprint, "[", *buf_comment, "]", e$ ##Not working Like I would want RDB

it would appear that you are simply attempting to save off an (operation?) comment and to output it in a specific location in psof. If this is true, you are completely over complicating things in attempting to use a buffer. All you need to do is to load the comment into a string variable in pcomment2 and then output it where you desire. Something like:

 

code:

pcomment2       #Output Comment from manual entry

scomm$ = ucase (scomm$)

if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$ #Manual entry - as comment

if gcode$ = 1006, scomm$, e$ #Manual entry - as code

if gcode$ = 1007, sopen_prn, scomm$, sclose_prn #Manual entry - as comment with move NO e$

if gcode$ = 1026, scomm$ #Manual entry - as code with move NO e$

if gcode$ = 1008, #Operation comment

[

sopcomment = scomm$ #Load comment into user defined variable

sopen_prn, scomm$, sclose_prn, e$ #Output comment

]

if gcode$ = 1051, sopen_prn, scomm$, sclose_prn, e$ #Machine name

if gcode$ = 1052, sopen_prn, scomm$, sclose_prn, e$ #Group comment

if gcode$ = 1053, sopen_prn, scomm$, sclose_prn, e$ #Group name

if gcode$ = 1054, sopen_prn, scomm$, sclose_prn, e$ #File Descriptor

And then:

 

code:

psof$            #Start of file for non-zero tool number             

 

##### Custom changes allowed below #####

pwritbuf7

if ntools$ = one,

[

skip single tool outputs, stagetool must be on

stagetool = m_one

!next_tool$

]

 

if drillcyc$ = 10, #Bore/Boss

[

pdrlcommonb

pbld, n$, *sg00, *prorefht, e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *strg659814, diadwell, [if shftdrl$ = zero, *zbossdep], [if radclear, *radclear], [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *sg00, *prorefht, e$

if drl_prm10$,

[

spaces$ = 0

sdprint, "[", sopcomment, "]", e$ #Output operation comment again

would work just fine. The only reason I can think of to write this data to a buffer is to save the information for use later (in another operation after the comment has changed).

Link to comment
Share on other sites

D'OH!!! bonk.gif

 

An update on my earlier post on declaring a buffer to hold string data.

That information was for v9.

 

*Parameters for ‘fbuf’ (for an ‘X’ post) ->

 

Parameter 1 = Buffer number ( 1 thru 10 )

 

Parameter 2 = Keep flag, set flag to 1 to keep file or 0 to discard file when posting is completed. Saved files are saved under the name of the NC file with the extension of .TX1 through .TX0.

 

Parameter 3 = Number of reals in each record. (ie. number of variables listed per line )

 

Parameter 4 = Initialize flag, set to 1 to initialize (open an existing file) or 0 (do not open an existing file).

 

Parameter 5 = Buffer type (0=numeric, 1=string)

Link to comment
Share on other sites

Sorry, just reread what I put above and realized I forgot to remove the pwritbuf7 from the code snippet for psof$. You would also need to add the comment$ command prior to outputting sopcomment. Of course this would lead to the comment buffer being dumped so you'd likely want to completely comment out the operation comment output in pcomment2 to keep it from coming out at the top of psof$. You could then just put sopcomment anywhere else in psof$ that you desire the operation comment to be output.

Link to comment
Share on other sites

Ok Tons of information here and a lot to digest. Greatly appreciated and many thanks!!!!!

 

I will try to explain what I am after as best I can. When doing an operation I label the operation exactly as to what it is doing. So when you post out the operation you get that comment coming out for that operation which is what you want when running a program so the operator can follow what you are doing. Well with the probing that is going on the machine it has a printer hooked up to it. The idea is that when you probe a certain operation all of the information is then captured and then printed real time as you are running the part like a inspection report for that part. What I am trying to accomplish is a Comment coming out for the program just like you are running it for the operator to see and then the same comment or a copy of that comment coming out inside of my drpnt posting so that when it reads that it will post it out and then make it print that same information to that printer that is hooked up to that machine so then when you are looking at this inspection report and looking at 100 different things that have been probed on this part it makes sense and I have not go to go back and manually put into the NC code what I already did when I made the comments for what I was doing in the probing operation. Does that makes sense???

 

I will digest this and see how I can make it work for what I am attempting to do, but I think the pcomment2 method may be what I am looking for. I went down the buffer road just not knowing what is really the best way to achieve what I am after.

 

Again thank you for taking the time and posting up some very valuable information to me and I hope others. To be honest still not sure what I am doing with buffers but will keep giving it a try.

Link to comment
Share on other sites

Ok look at this now and see where this could have got confusing.

 

code:

 psof$            #Start of file for non-zero tool number             

 

##### Custom changes allowed below #####

pwritbuf7

if ntools$ = one,

[

skip single tool outputs, stagetool must be on

stagetool = m_one

!next_tool$

]

 

 

This above is just a snipet from the psof part of the post.

 

 

 

 

The other part came from this part of the post:

 

pdrlcst$ #Custom drill cycles 8 - 19 (user option)

#Use this postblock to customize drilling cycles 8 - 19

 

 

if drillcyc$ = 10, #Bore/Boss

[

pdrlcommonb

pbld, n$, *sg00, *prorefht, e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *strg659814, diadwell, [if shftdrl$ = zero, *zbossdep], [if radclear, *radclear], [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *sg00, *prorefht, e$

if drl_prm10$,

[

spaces$ = 0

preadbuf3

sdprint, "[", *buf_comment, "]", e$ ##Not working Like I would want RDB

This drilling section is where it would normally be, I just cut out all the stuff in between trying to keep the size down. I am sorry for the confusion.

 

 

Ok here is what I get for posted code right now and that was trying the above method with the sopcomment method:

 

code:

%

O0001 ( PROGRAM - T )

( DATE - 17-09-08 TIME - 17:13 )

( PROGRAMMER - RON BRANCH )

( ************************************ )

( 6MM PROBE TOOL - 66 DIA. OFF. - 0 )

( LEN. - 66 DIA. - .236 )

( *********************************** )

 

( SOMETHING_TO_TRY )

G20

G0 G17 G40 G80 G90 G94 G98

G0 G91 G28 Z0.

M43

M11

G91 G28 B0. A0.

M42

M10

G0 G91 G28 X0. Y0.

G0 G90

T66

M6

M43

M11

G0 G54 G90 X-2.0837 Y.5517 B0. A0. S0 M5

M42

M10

G43 H66 Z2.

G0 Z.1

G65P9810 Z0.

G65P9814 D.75 Z-2. W2

G65P9810 Z0.

G0 Z.1

DPRNT[] <------- Nothing coming out here

DPRNT[X*POSITION*=*#135--X*ERROR*=*#140]

DPRNT[Y*POSITION*=*#136--Y*ERROR*=*#141]

DPRNT[Z*POSITION*=Z-2.]

DPRNT[DIAMETER*OF*FEATURE*=*#138--ERROR*=*#143]

DPRNT[TRUE*POSITION*ERROR*=*#145]

DPRNT[-------------------------------------------]

G0 G91 G28 Z0.

M43

M11

G91 G28 B0. A0.

M42

M10

G0 G91 G28 X0. Y0.

G0 G90

T198

M06

M30

%


Here is what I want:

 

code:

%

O0001 ( PROGRAM - T )

( DATE - 17-09-08 TIME - 17:13 )

( PROGRAMMER - RON BRANCH )

( ************************************ )

( 6MM PROBE TOOL - 66 DIA. OFF. - 0 )

( LEN. - 66 DIA. - .236 )

( *********************************** )

 

( SOMETHING_TO_TRY )

G20

G0 G17 G40 G80 G90 G94 G98

G0 G91 G28 Z0.

M43

M11

G91 G28 B0. A0.

M42

M10

G0 G91 G28 X0. Y0.

G0 G90

T66

M6

M43

M11

G0 G54 G90 X-2.0837 Y.5517 B0. A0. S0 M5

M42

M10

G43 H66 Z2.

G0 Z.1

G65P9810 Z0.

G65P9814 D.75 Z-2. W2

G65P9810 Z0.

G0 Z.1

DPRNT[sOMETHING_TO_TRY] <<<<<---- Desired results

DPRNT[X*POSITION*=*#135--X*ERROR*=*#140]

DPRNT[Y*POSITION*=*#136--Y*ERROR*=*#141]

DPRNT[Z*POSITION*=Z-2.]

DPRNT[DIAMETER*OF*FEATURE*=*#138--ERROR*=*#143]

DPRNT[TRUE*POSITION*ERROR*=*#145]

DPRNT[-------------------------------------------]

G0 G91 G28 Z0.

M43

M11

G91 G28 B0. A0.

M42

M10

G0 G91 G28 X0. Y0.

G0 G90

T198

M06

M30

%

I hope that makes sense I am now trying the buffer method I will keep you posted.

 

Again I really appreciate you help and suggestions I am learning so neat things here.

Link to comment
Share on other sites

Well if you do it this way you can get an unexpected error and shut down Mastercam.

 

Here is where I define my varaible:

 

code:

buf_comment  : 0    #For comments Buffer  

Here is where I define my buffer:

 

code:

# --------------------------------------------------------------------------

# Buffer 7 - Holds the Comments to be used Later

# --------------------------------------------------------------------------

rc7 : 1

wc7 : 1

fbuf 7 0 1 80 0 # Buffer 7


This is the psof section of the post:

 

code:

psof$            #Start of file for non-zero tool number             

 

##### Custom changes allowed below #####

pwritbuf7

if ntools$ = one,

[

skip single tool outputs, stagetool must be on

stagetool = m_one

!next_tool$

]

tooltotal = rbuf(4,0) #Reads total tool and null tool changes

#comment$ = rbuf(7,0) #Reads Comments and Stores it to the Buffer for Later Use

sopcomment, e$

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

if progno$ = zero, progno$ = one

"%", e$

*progno$, *sopen_prn, "PROGRAM - ", sprogname$,*sclose_prn, e$

pbld, *sopen_prn, "DATE - ", date$, " TIME - ", time$, *sclose_prn, e$

pbld, *sopen_prn, "PROGRAMMER - RON BRANCH", *sclose_prn, e$

 

ptoolcomment

#comment$ = sav_comment

#if drl_prm10$ > 0, sdprint, "[", comment$, "]", e$

#else, comment$

comment$

pbld, n$, *smetric, e$

pbld, n$, *sg00, *sgplane, *sg40, "G80", *sg90, *sgfeed, *sg98, e$


This is in the drilling section part of the post:

 

 

code:

 pdrlcst$         #Custom drill cycles 8 - 19 (user option)

#Use this postblock to customize drilling cycles 8 - 19

if drillcyc$ = 8, #XYZ Single Surface Measure

[

pdrlcommonb

pbld, n$, *sg00, *prorefht, e$

pbld, n$, *strg659810, prnrefht, e$

pbld, n$, *strg659811, *yout, *zout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *sg00, *prorefht, e$

pcom_movea

]

if drillcyc$ = 9, #Web/Pocket Measure

[

pdrlcommonb

pbld, n$, *strg659810, prnrefht, e$

pbld, n$, *strg659812, *yout, *zout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pcom_movea

]

if drillcyc$ = 10, #Bore/Boss

[

pdrlcommonb

pbld, n$, *sg00, *prorefht, e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *strg659814, diadwell, [if shftdrl$ = zero, *zbossdep], [if radclear, *radclear], [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$

pbld, n$, *strg659810, *prnrefht, e$

pbld, n$, *sg00, *prorefht, e$

if drl_prm10$,

[

spaces$ = 0

preadbuf7

sdprint, "[", buf_comment, "]", e$ ##Not working Like I would want RDB

#sdprint, "[", sopcomment, "]", e$

sdprint, "[","X*POSITION*=*#135--X*ERROR*=*#140]", e$

sdprint, "[","Y*POSITION*=*#136--Y*ERROR*=*#141]", e$

sdprint, "[","Z*POSITION*=,*zbossdep,]", e$

sdprint, "[","DIAMETER*OF*FEATURE*=*#138--ERROR*=*#143]", e$

sdprint, "[","TRUE*POSITION*ERROR*=*#145]", e$

sdprint, "[","-------------------------------------------","]", e$

spaces$ = 1

]

pcom_movea

]

This is at the end of the post:

code:

# --------------------------------------------------------------------------

# Buffer 7 Read / Write Routines for posting out comments when doing Probing Routines and a DPRNT

# --------------------------------------------------------------------------

pwritbuf7 # Write Buffer 1

comment$ = wbuf(7,wc7)

 

preadbuf7 # Read Buffer 1

#buf_comment = rbuf(7,rc7)

size7 = rbuf(7,0)

while rc7 <= size7,

[

buf_comment = rbuf(7,rc7)

]

I am locking up Mastercam trying to use Buffers so I know I am doing something very wrong. I am just lost and not afraid to admit I am lost.

 

bonk.gifbonk.gifbonk.gifbonk.gifbonk.gif

 

 

I am off to church so I will see this later tonight or tomorrow.

 

Any help or ideas are greatly appreciated.

Link to comment
Share on other sites

Ok, let me say this again to try to make it clear.

 

COMMENT$ IS NOT A VARIABLE, IT IS A COMMAND.

 

You CANNOT do this: comment$ = wbuf(7,wc7)

 

And AGAIN, I believe that you DO NOT need to use a buffer to achieve the output you desire here.

 

Please, just humor me. Try adding the logic that I showed for pcomment2. Specifically the:

 

code:

      if gcode$ = 1008,                                    #Operation comment

[

sopcomment = scomm$ #Load comment into user defined variable

sopen_prn, scomm$, sclose_prn, e$ #Output comment

]

(Be sure to initialize sopcomment somewhere)

 

Remove all of the buffer stuff (hell, just comment it all out if you absolutely cannot trust me) and just add sopcomment in your pdrlcst$ post block, replacing buf_comment.

Link to comment
Share on other sites

Paul I did what you asked, except the initialize the sopcomment before. This time I did it and I got this:

 

code:

%

%

O0001 ( PROGRAM - T )

( DATE - 17-09-08 TIME - 21:27 )

( PROGRAMMER - RON BRANCH )

( ************************************ )

( 6MM PROBE TOOL - 66 DIA. OFF. - 0 )

( LEN. - 66 DIA. - .236 )

( *********************************** )

 

( SOMETHING*TO*TRY )

G20

G0 G17 G40 G80 G90 G94 G98

G0 G91 G28 Z0.

M43

M11

G91 G28 B0. A0.

M42

M10

G0 G91 G28 X0. Y0.

G0 G90

T66

M6

M43

M11

G0 G54 G90 X-2.0837 Y.5517 B0. A0. S0 M5

M42

M10

G43 H66 Z2.

G0 Z.1

G65P9810 Z0.

G65P9814 D.75 Z-2. W2

G65P9810 Z0.

G0 Z.1

DPRNT[sOMETHING*TO*TRY]

DPRNT[X*POSITION*=*#135--X*ERROR*=*#140]

DPRNT[Y*POSITION*=*#136--Y*ERROR*=*#141]

DPRNT[Z*POSITION*=Z-2.]

DPRNT[DIAMETER*OF*FEATURE*=*#138--ERROR*=*#143]

DPRNT[TRUE*POSITION*ERROR*=*#145]

DPRNT[-------------------------------------------]

G0 G91 G28 Z0.

M43

M11

G91 G28 B0. A0.

M42

M10

G0 G91 G28 X0. Y0.

G0 G90

T198

M06

M30

%

 


Paul I do listen to what you tell me and I had tired what you asked and did not do sopcomment initialize and when it did not work I went back down the buffer road since you mentioned it early was the only reason I was even trying it.

 

I thank you very much for helping me fix this problem and I did look at the .set like you suggested and it helped me sort this out so thank you for that idea it helped a lot.

 

Best Regards, and thank you for helping me get this straightened out.

 

cheers.gif

cheers.gif

cheers.gif

cheers.gif

cheers.gif

cheers.gif

cheers.gif

cheers.gif

 

Oh yeah I took all that buffer garbage out of the post as well.

 

Only one problem though I still do not understand buffers. LOLOLOLOLOLOLOLOLOLOL

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...