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:

One Question Please:)


Müřlıń®
 Share

Recommended Posts

You can also create a .vbs on the fly inside of MC, then execute it via the post using the launch mentioned above.. I haven't played with this much, so I can't explain it very well, but here's a sample that you can paste into a NEW post and post a file with it. Note that this is a post all by itself, don't merge it with any other posts.

 

code:

bug1:2

bug2:0

bug3:0

bug4:0

fastmode:0

whatno : yes

strtool_v7 : 2

tooltable:yes

 

fs 1 1^0 n

fs 2 1.3 nt

 

fmt 2 t

fmt 2 tldia

fmt 2 tcr

 

sbufname1 tools_xls.vbs

fbuf 1 1 80 0

result:0

str1 "wscript.exe"

str2 "tools_xls.vbs"

wc1:1

line:0

row:1

col:1

 

srow

scol

sdia

srad

szmin

szmax

stnr

sline

srow_col

scomm

 

s0 'Dim xs'

s01 'Set xs=CreateObject("Excel.Application")'

s02 "xs.visible=true"

s03 "Set newBook = xs.Workbooks.Add"

s04 "With newbook.activesheet"

s05 '.cells(1,1).value="T No."'

s06 '.cells(1,2).value="Name"'

s07 '.cells(1,3).value="WZ-Durchmesser"'

s08 '.cells(1,4).value="WZ-Eckradius"'

s09 '.range("A1:G1").Select'

s10 "xs.selection.font.bold=true"

s11 '.Columns("A:G").Select'

s12 "xs.selection.HorizontalAlignment = -4108"

s13 '.Columns("A:G").EntireColumn.AutoFit'

s14 '.range("A2").Select'

s15 "End With"

s16 ".cells("

s17 ').value="'

s18 '"'

s19 ","

svbs

fstrsel s0 line svbs

 

pheader

while line<15,[

result = updstr (svbs)

svbs = wbuf(1, wc1)

line=line+1

]

 

peof

s15 = wbuf(1, wc1)

result = fclose(1)

result = launch(str1, str2)

 

ptooltbl

if t>0,[

row=row+1

stnr = no2str(t)

sdia = no2str(tldia)

srad = no2str(tcr)

col=1

srow=no2str(row)

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + stnr + s18

sline = wbuf(1, wc1)

col=2

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + strtool + s18

sline = wbuf(1, wc1)

col=3

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + sdia + s18

sline = wbuf(1, wc1)

col=4

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + srad + s18

sline = wbuf(1, wc1)

]

 

1501. Insert parameter information in the ascii NCI? n

1502. Write operation information to binary file (.ops)? y

1999. ? 9

 


'Rekd teh pilage and plunder

 

[ 07-09-2003, 05:38 PM: Message edited by: Rekd ]

Link to comment
Share on other sites

Thanks Mick G smile.gif

 

The Script we made, cleans up mistakes the post makes. So I need to run it on the NC file after each posting.

 

Can I run the .exe I already have with the result = launch(str1, str2) command as someone has suggested ?

 

I am VB retarded:) I had help.......so I dont know how to make a script that actually generates the nc code.

 

It took all my resources to get to where I am now........... smile.gif

 

 

Murlin

Link to comment
Share on other sites

Marcy the guys at Mastercam havent had much luck at fixing it either. And I am not skilled enough to do it.

 

It has to do with me having Circular Interpolation turned on in the xz and yz axis in some of the toolpath algorythms.

 

It is a....... *whispers*... "bug".

Opps I said the "B" word:)

 

Murlin

Link to comment
Share on other sites

Jimmy......... would that be what Rekd is talking about up in the first of this post??

I think I know the place in my .pst where you are talking about right above the numbered questions??

 

Rekd.......... you guys sound like you already know how to fix my problem but are sooooo far above my head on this:)

 

****smiles with anticipation on finally having a fix for this***

 

Murlin

Link to comment
Share on other sites

Nopers I dont have the .pst CD, just the install CD......but you can bet I will get it. OH BTW where can I get it??

From my reseller??

 

I will be giving him a ring tomarrow if thats the case:)

 

 

You guys are the best:)

 

 

I wish I had found this board a long time ago.......

 

 

Murlin

Link to comment
Share on other sites

quote:

It has to do with me having Circular Interpolation turned on in the xz and yz axis in some of the toolpath algorythms.

 

It is a....... *whispers*... "bug".

Opps I said the "B" word:)

Murlin,

What "bug" are you referring to ?

What version of MC are you running ?

What would this script be fixing in the NC output from the post ?

Link to comment
Share on other sites

I'm sure that whatever you are doing to your NC code after posting should probably be handled by the post but in the meantime heres an example script that you may find interesting. Also if you know what your EXE is doing to the NC code you could probably just have the script do it.

 

Edit: I mention in the script that there is a bug with the function RunPostAll that does not suppress opening your default editor even when setting the function argument to false, this is not actually the case. You need to edit your post, specifically the setting bug1 and set it to 0.

 

bug1: 0 #0=No display, 1=Generic list box, 2=Editor

 

code:

Public Const DEF_NOTEPAD        = "C:WindowsNotepad.exe"

Public Const DEF_NOTEPAD_NT = "C:WINNTNotepad.exe"

 

' -- Start Script

Call Main()

 

 

' ////////////////////

' Sub Declaration

' ////////////////////

Sub Main()

 

Dim strNC

Dim strPath

Dim strShell

Dim FSO

Dim strFileName

Dim intOpId

 

' -- Do we have a drawing?

If Not IsDrawing Then

ShowString "No current drawing"

' -- Bail...

Exit Sub

Else

' -- Check for any operation

intOpId = GetFirstOperationID(vbNullString)

' -- Is there one?

If intOpId = -1 Then

ShowString "There are no operations in current drawing"

' -- Bail

Exit Sub

End If

End If

 

' -- Prompt user for a folder to save NC to

strPath = BrowseForFolder("Choose NC Folder")

 

' ******************************************

' * Make sure a valid folder was selected

' * this is not perfect as a cancel press

' * may return a path to the users desktop

' ******************************************

If IsNull(strPath) Or Len(Trim(strPath)) = 0 Then

ShowString "Invalid Folder Selection"

Exit Sub

End If

 

' *************************************

' * Create the NC code and dont show

' * the default NC editor. There is a bug

' * with the editor still opening even

' * when set to false and will be addressed

' * in an up coming mcamvb.dll release.

' *************************************

If Not RunPostAll(strPath, False) Then

ShowString "Call to RunPostAll failed"

Else

Set FSO = CreateObject("Scripting.FileSystemObject")

 

' ***********************************************

' * This example is using notepad, just change

' * the declaration to point to your custom EXE

' * and you should be good to go.

' ***********************************************

If FSO.FileExists(DEF_NOTEPAD) Then

strShell = DEF_NOTEPAD

ElseIf FSO.FileExists(DEF_NOTEPAD_NT) > 0 Then

strShell = DEF_NOTEPAD_NT

Else

strShell = vbNullString

End If

 

' -- Are we ok?

If Len(strShell) = 0 Then

' -- Inform user

Call ShowString ("Could not find EXE")

Else

' ***************************************************

' * My default NC file name is T.NC

' * Screen-Configure-Start/Exit-Default MC9 File Name

' ***************************************************

strNC = AddBackSlash(strPath) & "T.NC"

 

' -- Ok, show the file

strShell = strShell & " " & strNC

 

Call ShellAndWait (strShell, False)

End If

End If

 

 

' -- Clean up

Set FSO = Nothing

 

End Sub

 

' ////////////////////

' Function Declaration

' ////////////////////

 

Function AddBackSlash(sPath)

 

If Right(sPath, 1) <> "" Then sPath = sPath & ""

AddBackSlash = sPath

 

End Function

 

' ////////////////////

' Function Declaration

' ////////////////////

Function BrowseForFolder(strPrompt)

 

On Error Resume Next

 

Dim objShell, objFolder, intColonPos, objWshShell

 

Set objWshShell = CreateObject("WScript.Shell")

 

Set objShell = CreateObject("Shell.Application")

 

 

Set objFolder = objShell.BrowseForFolder(&H0&, strPrompt, &H1&)

 

BrowseForFolder = objFolder.ParentFolder.ParseName(objFolder.Title).Path

 

If Err.Number <> 0 Then

 

BrowseForFolder = Null 'will be null of no special case applies

 

If objFolder.Title = "Desktop" Then

BrowseForFolder = objWshShell.SpecialFolders("Desktop")

End If

 

intColonPos = InStr(objFolder.Title, ":")

 

If intColonPos > 0 Then

BrowseForFolder = Mid(objFolder.Title, intColonPos - 1, 2) & ""

End If

 

End If

End Function

 

 

' ////////////////////

' Function Declaration

' ////////////////////

Public Function IsDrawing

Dim Ret

 

Ret = StartDBSearch(mc_alive, -1)

 

IsDrawing = Ret

 

End Function

 

[ 07-10-2003, 05:10 PM: Message edited by: Mick G ]

Link to comment
Share on other sites

Be my guest Keith on using my Quote.

Glad to help.... any time:)

 

Mick, All I heard was a big VROOOM while all that flew over my head.......I think I even ducked....LOL....... I will have my VB programmer look at it and tell me what its doing.

 

Sorry Rodger, I didnt mean to offend by my use of the "B" word:)

 

I would be more than grateful if you could fix the post for my control. However its pretty old and I'm probably the only one insane enough to use such an outdated machine.

 

I just found this site yesterday, otherwise, I would have been in here a year ago to ask a couple questions.

 

I had my father(who is a computer programmer)compile an .exe file out of VB script we made to fix my post.

 

****There is ALWAYS a workaround****

 

I am using Ver9.0SP1.

 

I have run the update post DLL.

 

I have had several guys at my reseller look at my post and couldnt fix it. They advised me to turn off the arc outputs in the xy,xz planes.

 

They are pretty smart guys over there, and if they couldnt fix it, I assume it cant be fixed via the post. So I took a short cut:)

 

But if I could get a good NCI out of it, I'm all for that.....

 

Heres my post:

 

 

# Product Type : MILL

# Machine Name : CINCINATTI MILICRON

# Control Name : ACRAMATIC BIG BLUE

# Customer Name :

# Custom Text file : no

# Tool Planes : no

# Sub Programs : no

# Executable : MP 4

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

# MASTERCAM MP POST PROCESSOR -

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

#| REVISION LOG |

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

# Programmers Note:

#

# CNC 5/20/94 - Initial post setup for Mill5

# 05/29/96 - grt - Updated Post for Dynapath System 10 / 20

#

# MLC 05/28/98 - Set to feed at F500 for rapid moves

#

# MLC 07/05/00 - force xyz/ijk on arcs not in top plane

# add switch to break arcs not in top plane.

#

#

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

#| FEATURES: |

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

# Users Note:

#

# Following Misc_Reals & Misc_Integers are used:

#

#

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

# DEBUG/PROGRAM SWITCHES, debugging and program switches

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

bug1 : 1 # 1 = Output post to screen, 2 = output leader to screen

bug2 : 0 # Append postline labels, non-zero is column position?

bug3 : 0 # Append whatline no. to each NC line?

bug4 : 0 # Append NCI line no. to each NC line?

whatno : yes # Do not perform whatline branches?

 

get_1004 : 1 #Find gcode 1004 with getnextop?

rpd_typ_v7 : 1 #Use Version 7 style contour flags?

strtool_v7 : 2 # Use Version 7 toolname?

 

fastmode : 1 # Optimize processing time (set to no for debugging)

 

stop_tc : no # Program Stop Flag

arc_2d : no # set to yes, to break arcs that are not in the top plane

 

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

# FORMAT STATEMENTS - n=nonmodal, l=leading, t=trailing, i=inc, d=delta

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

fs 1 0 4t #Decimal, absolute, 4 place

fs 2 0 4t #Decimal, delta

fs 3 4 0 #Integer, not leading

fs 4 2 0ln #Integer, two leading

fs 5 3 1t #Integer, three leading

fs 6 2 0ln #Integer, four leading

fs 7 0 4 #Decimal, absolute, 1 place

fs 8 0 1 #Decimal, absolute, 2 place

fs 9 0 4t #Decimal, absolute, 3 place

fs 10 2 0n #No decimal, absolute, four trailing

fs 11 3 2nt #Decimal, absolute, four trailing

fs 12 2.0n

fs 13 1.4

 

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

# FORMAT ASSIGNMENTS

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

# Axis output formats - Linear

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

fmt X 1 x # X axis position

fmt Y 1 y # Y axis position

fmt Z 1 z # Z axis position

fmt X 1 xr # X rapid position from tool change

fmt Y 1 yr # Y rapid position from tool change

fmt Z 1 zr # Z rapid position from tool change

fmt X 1 xh # X home position

fmt Y 1 yh # Y home position

fmt Z 1 zh # Z home position

fmt Z 1 zout # Z axis position for axis substitution

 

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

# Axis output formats - Circular

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

fmt I 1 i # Arc center description in X

fmt J 1 j # Arc center description in Y

fmt I 1 ix

fmt J 1 jy

fmt K 1 k # Arc center description in Z

fmt R 1 arcrad # Arc Radius

fmt R- 1 arcradm # Arc Radius over 180 degree sweep

 

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

# Axis output formats - Rotary substitution

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

fmt A 9 xangle # Linear to rotary calculation of X

fmt A 9 yangle # Linear to rotary calculation of Y

fmt A- 9 m_zero # Negative Zero

fmt A 9 aout # rotary positioning move

 

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

# Program & Sequence number format

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

fmt O 7 progno # Program number

fmt N 7 n # Sequence nos.

fmt N 8 decseq # Decimal sequence nos.

fmt E 4 e_offset # E-Fixture offset

 

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

# Tool format

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

fmt T 4 t # Tool No

fmt T 4 first_tool# First Tool Used (bldnxtool: yes)

fmt T 4 next_tool # Next Tool Used (bldnxtool: yes)

fmt D 4 tloffno # Diameter Offset No

fmt H 4 tlngno # Length Offset No

 

fmt "TOOL - " 4 tnote # Note format

fmt "DIA. OFF. - " 4 toffnote # Note format

fmt "LENGTH - " 4 tlngnote # Note format

fmt "DIA. - " 11 tldia # Note format

 

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

# Spindle Speeds & Feedrate output formats

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

fmt S 3 speed # Spindle Speed

fmt F 5 feed # Feedrate

 

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

# Drill variable formats

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

fmt G 3 drillref # Initial / Reference Toggle (G98/G99)

fmt L 9 dwell # Dwell

fmt Z 1 initht # Initial Height

fmt R 9 refht # Reference Height

fmt Z 9 depth # Depth

fmt K 9 peck1 # First peck increment (positive)

fmt 9 peck2 # Second or last peck (positive)

fmt Q 9 peckclr # Safety distance

fmt 1 retr # Retract height

fmt F 5 frplunge # Plunge feedrate in drill cycles

fmt F 3 tpi # Threads per inch

 

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

# Miscellaneous output formats

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

fmt M 5 ssrange # Spindle Speed Range

fmt C 4 coolant # Coolant

 

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

# INITIALIZE - initialize system variables and define user variables

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

arctype : 1 # Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.

do_full_arc : 0 #Allow full circle output? 0=no, 1=yes

helix_arc : 0 #Support helix arc output, 0=no, 1=all planes, 2=XY plane only

breakarcs : 1 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs

 

bldnxtool : 0 # Build next tool table

tooltable : 0 # Read for tool table and pwrtt

 

progname : 1 # Use uppercase for program name

seqmax : 9999 # Max. sequence no.

skipmotest: no # Skip motion test in linear

spaces : 1 # No. of spaces to add between fields

absswp : 0 # Absolute sweep

drlgsel : -1 # Drill Select Initialize

maxfrdeg : 999 # Limit for feed in deg/min

 

 

newglobal : 1 # Turn on MP error checking

test : 0 # And/Or Test value

dir : 0 # Direction

 

feed_s : 0

c9k : 999

 

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

# FORMULAS - global formulas

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

 

speed = abs ( ss ) # Absolute spindle speed

arcradm = arcrad # Negative arcrad

spdlsel = fsg3(ss) # Spindle on selector based on pos. or neg. ss

ix = x

jy = y

 

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

# CANNED CYCLES - select long or short code

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

usecandrill : yes # Use canned cycle for drill

usecanpeck : yes # Use canned cycle for Peck

usecanchip : yes # Use canned cycle for Chip Break

usecantap : yes # Use canned cycle for Tap

usecanbore1 : yes # Use canned cycle for Bore1

usecanbore2 : yes # Use canned cycle for Bore2

usecanmisc1 : yes # Use canned cycle for Misc1

usecanmisc2 : yes # Use canned cycle for Misc2

 

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

# Lookup table definitions - for math functions FLOOK and FRANGE

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

flktbl 1 12 # Lookup table no. No. of entry pairs

58 63 # Code 1 (output) Match 1

59 90 # Code 2 Match 2

63 112 # . .

64 180 # . .

65 224 # . .

66 355

67 450

73 710

74 900

75 1400

76 1800

77 2800

 

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

# Strings - String labels must start with 's' - they are not pre-assigned

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

#Select operation note

sop00 NULL # String definition

sop01 2D-CONTOUR # " "

sop02 3D-CONTOUR # " "

sop03 DRILL/MISC # " "

sop04 POCKET.... # " "

sop05 RULED..... # " "

sop06 2D-SWEPT.. # " "

sop07 3D-SWEPT.. # " "

sop08 REVOLVED.. # " "

sop09 LOFT...... # " "

sop10 COONS..... # " "

sop11 TRIM ..... # " "

sop12 FILLET.... # " "

sop13 FINISH.... # " "

sop14 ROUGH..... # " "

sop15 OP15...... # " "

sop16 OP16...... # " "

sop17 OP17...... # " "

 

sopnote # Target string

 

fstrsel sop00 opcode sopnote

5

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

# Select motion G code

sg00 G01 # Linear movement at rapid feedrate

sg01 G01 # Linear movement at feedrate

sg02 G02 # Circular interpolation CW

sg03 G03 # Circular interpolation CCW

 

sgcode # Target string

 

fstrsel sg00 gcode sgcode

 

 

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

# Select spindle start

sm04 M04 # Spindle reverse

sm05 M05 # Spindle off

sm03 M03 # Spindle forward

 

spdlon # Target string

 

fstrsel sm04 spdlsel spdlon

 

 

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

# Select work plane G code

sg17 G17 # XY plane code

sg19 G19 # YZ plane code

sg18 G18 # XZ plane code

 

sgplane # Target string

 

fstrsel sg17 plane sgplane

 

 

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

# Canned drill cycle string select

sg81 G81 # drill - no dwell

sg81d G2 # drill - with dwell

sg83 G3 # peck drill - no dwell

sg83d G3 # peck drill - with dwell

sg73 G3 # chip break - no dwell

sg73d G3 # chip break - with dwell

sg84 G4 # tap - no dwell

sg84d G4 # tap - with dwell (selects left hand)

sg85 G85 # bore #1 - no dwell

sg85d G5 # bore #1 - with dwell

sg86 G7 # dead spindle bore #2 - no dwell

sg86d G7 # dead spindle bore #2 - with dwell

sgm1 G8 # rigid tap - no dwell

sgm1d G8 # rigid tap - with dwell

sgm2 G1 # misc #2 - no dwell

sgm2d G2 # misc #2 - with dwell

 

sgdrill # Target string

 

drlgsel = drillcyc * 2 + fsg2 ( dwell ) # 16 possible combinations:

# drillcyc = 0..7

# dwell = 0 or non-zero (2 states)

fstrsel sg81 drlgsel sgdrill

 

 

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

# POSTLINES, USER-DEFINED - Postline labels start with 'p'.

# End a line with ',' to continue on the next line.

# End a line with ', e' to generate carriage return and linefeed.

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

# Program general output control, user defined

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

pinit # Initialize Vars

prv_fr = c9k

prv_frplunge = c9k

prv_x = c9k

prv_y = c9k

prv_z = c9k

 

pcomment # Manual Entry - COMMENTS (on a block by itself) 1005,1006

# "(", scomm, ")"

 

 

pcooloff # Coolant off "M" code output

if prv_coolant > 0, "M09"

 

pcoolon # Coolant off "M" code output

if coolant = 1, n, "M08" # Flood

if coolant = 2, n,"M07" # Mist

 

pcoolnl # Coolant off "M" code output

if coolant = 0, n, "M09" # Off

if coolant = 1, n, "M08" # Flood

if coolant = 2, n, "M07" # Mist

 

pfr # Feedrate W/O Negative Feedrates

if fr > 0, feed_s = fr

if prv_gcode = 0, feed = 50

else, feed = feed_s

feed

 

pss # Output spindle speed

if ss <> 0, *speed

 

pspdlon # Output spindle start codes. Use M03 even if spindle speed = 0

if ss = 0, "M03"

if ss <> 0, *spdlon

 

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

# Axis linear/circular motion, user defined

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

 

parctyp # Arc output for IJK

if plane = 0, *x, *y, *i, *j, *k

if plane = 1, *x, *y, *z, *ix, *j, *k #yz

if plane = 2, *x, *y, *z, *i, *jy, *k #xz

 

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

# Drilling, user defined

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

 

pdwell # Determine whether to output dwell

if dwell <> 0, *dwell

 

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

# POSTLINES, PRE-DEFINED - Postline names are pre-assigned.

# Lines do not need to end with ', e' for carriage return and linefeed.

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

 

pheader # File header

 

 

psof0 # Start of file for tool zero

psof

 

psof # Start of file for non-zero tool number

gcode = 0

!gcode

eob = 36

n, *t, "M06"

n, "G17"

n, pss, pspdlon

pcoolon

n, "G01", *xr, *yr, pfr

n, *zr

 

 

ptlchg0 # Null tool change

if prv_speed <> speed, n, pspdlon, pss

 

ptlchg # Tool change

gcode = 0

!gcode

n, *t, "M06"

n, "G17"

if stop_tc = Yes, n, "M00"

n, pss, pspdlon

n, "G01", *xr, *yr, pfr

n, *zr

pcoolon

!coolant

 

 

peof0 # End of file for tool zero

peof

 

peof

n, pcooloff

n, "M00"

 

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

# Axis motion

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

 

pzrapid # Linear movement in Z axis only - at rapid feedrate

n, sgcode, z, pfr

 

prapid # Linear line movement - at rapid feedrate

n, sgcode, sgplane, *x, *y, pfr

 

plin # Linear line movement - at feedrate

n, sgcode, x, y, z, pfr

 

pz # Linear movement in Z axis only - at feedrate

n, sgcode, z, pfr

 

pcir0 # break arcs that are not on top plane

if (plane <> 0) & (arc_2d = 1), linarc = 1

else, linarc = 0

 

pcir # Circular interpolation

n, sgplane

n, *sgcode, parctyp, pfr

 

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

# Drilling

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

pdrill # Canned Drill Cycle

n, *x, *y, *depth, *frplunge, *sgdrill, *refht, pdwell

 

ppeck # Canned Peck Drill Cycle

peck1 = abs(peck1)

n, *x, *y, *depth, *frplunge, *sgdrill, *refht, *peck1,

*peckclr, dwell

 

pchpbrk # Canned Chip Break Cycle

n, *x, *y, *depth, *frplunge, *sgdrill, *refht, *peck1,

*peckclr, dwell

 

ptap # Canned Tap Cycle

n, *x, *y, *depth, *frplunge, *sgdrill, *refht

 

pbore1 # Canned Bore #1 Cycle

n, *x, *y, *depth, *frplunge, *sgdrill, *refht

 

pbore2 # Canned Bore #2 Cycle

n, *x, *y, *depth, *frplunge, *sgdrill, *refht

 

pmisc1 # Canned Misc #1 Cycle (Rigid Tapping)

tpi = peck1

n, *x, *y, *depth, *tpi, *sgdrill, *refht

 

pmisc2 # Canned Misc #2 Cycle (User Option)

pdrill

 

pdrill_2 # Canned Drill Cycle

n, *x, *y

 

ppeck_2 # Canned Peck Drill Cycle

pdrill_2

 

pchpbrk_2 # Canned Chip Break Cycle

pdrill_2

 

ptap_2 # Canned Tap Cycle

pdrill_2

 

pbore1_2 # Canned Bore #1 Cycle

pdrill_2

 

pbore2_2 # Canned Bore #2 Cycle

pdrill_2

 

pmisc1_2 # Canned Misc #1 Cycle

pmisc1

 

pmisc2_2 # Canned Misc #2 Cycle

pdrill_2

 

pcanceldc # Cancel canned drill cycle

!gcode

n, "G0", e

prv_z = initht

 

pcancelcc # Cancel cutter comp.

#n, "G40"

 

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

 

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

# Numbered questions for Mastercam

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

38. Rapid feedrate? 300.0

1538. Rapid feedrate (metric)? 10000.0

 

80. Communications port number for receive and transmit (1 or 2) ? 2

81. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,38400)? 300

82. Parity (E/O/N)? E

83. Data bits (7 or 8)? 7

84. Stop bits (1 or 2)? 2

85. Strip line feeds? N

86. Delay after end of line (seconds)? 0

87. Ascii, Eia, or Binary (A/E/B)? A

88. Echo keyboard to screen in terminal emulation? n

89. Strip carriage returns? N

90. Drive and subdirectory for NC files?

91. Name of executable post processor? MP

92. Name of reverse post processor? RP

93. Reverse post PST file name? RPDYPTH

100. Number of places BEFORE the decimal point for sequence numbers? 3

101. Number of places AFTER the decimal point for sequence numbers? 0

103. Maximum spindle speed? 4000

107. Average time for tool change (seconds)? 2.0

161. Enable Home Position button? y

162. Enable Reference Point button? n

163. Enable Misc. Values button? y

164. Enable Rotary Axis button? n

165. Enable Tool Plane button? n

166. Enable Construction Plane button? n

167. Enable Tool Display button? y

168. Check tplane during automatic work origin creation? n

 

#110. Default tool library? TOOLS.MTL

 

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

# Default Miscellaneous Real Values

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

201. Default miscellaneous real variable 1 (mr1)? 0.0

202. Default miscellaneous real variable 2 (mr2)? 0.0

203. Default miscellaneous real variable 3 (mr3)? 0.0

204. Default miscellaneous real variable 4 (mr4)? 0.0

205. Default miscellaneous real variable 5 (mr5)? 0.0

206. Default miscellaneous real variable 6 (mr6)? 0.0

207. Default miscellaneous real variable 7 (mr7)? 0.0

208. Default miscellaneous real variable 8 (mr8)? 0.0

209. Default miscellaneous real variable 9 (mr9)? 0.0

210. Default miscellaneous real variable 10 (mr10)? 0.0

 

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

# Default Miscellaneous Real Values (METRIC)

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

1601. Default miscellaneous real variable 1 (mr1) (metric)? 0.0

1602. Default miscellaneous real variable 2 (mr2) (metric)? 0.0

1603. Default miscellaneous real variable 3 (mr3) (metric)? 0.0

1604. Default miscellaneous real variable 4 (mr4) (metric)? 0.0

1605. Default miscellaneous real variable 5 (mr5) (metric)? 0.0

1606. Default miscellaneous real variable 6 (mr6) (metric)? 0.0

1607. Default miscellaneous real variable 7 (mr7) (metric)? 0.0

1608. Default miscellaneous real variable 8 (mr8) (metric)? 0.0

1609. Default miscellaneous real variable 9 (mr9) (metric)? 0.0

1610. Default miscellaneous real variable 10 (mr10) (metric)? 0.0

 

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

# Enable/Disable Miscellaneous Real Variable switches

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

1611. Enable miscellaneous real variable 1? y

1612. Enable miscellaneous real variable 2? y

1613. Enable miscellaneous real variable 3? y

1614. Enable miscellaneous real variable 4? y

1615. Enable miscellaneous real variable 5? y

1616. Enable miscellaneous real variable 6? y

1617. Enable miscellaneous real variable 7? y

1618. Enable miscellaneous real variable 8? y

1619. Enable miscellaneous real variable 9? y

1620. Enable miscellaneous real variable 10? y

 

 

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

# Default Miscellaneous Integer Values

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

301. Default Work Coordinate System (0 thru 3=G92, 4 thru 9=G54-G59)? 1

302. 4th Axis Positioning [1=X,2=Y] (mi2)? 0

303. Miscellaneous integer variable 3 (mi3)? 1

304. Miscellaneous integer variable 4 (mi4)? 0

305. Miscellaneous integer variable 5 (mi5)? 0

306. Miscellaneous integer variable 6 (mi6)? 0

307. Miscellaneous integer variable 7 (mi7)? 0

308. Miscellaneous integer variable 8 (mi8)? 0

309. Miscellaneous integer variable 9 (mi9)? 0

310. Miscellaneous integer variable 10 (mi10)? 0

 

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

# Enable/Disable Miscellaneous Integer Variable switches

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

1621. Enable miscellaneous integer variable 1? y

1622. Enable miscellaneous integer variable 2? y

1623. Enable miscellaneous integer variable 3? y

1624. Enable miscellaneous integer variable 4? y

1625. Enable miscellaneous integer variable 5? y

1626. Enable miscellaneous integer variable 6? y

1627. Enable miscellaneous integer variable 7? y

1628. Enable miscellaneous integer variable 8? y

1629. Enable miscellaneous integer variable 9? y

1630. Enable miscellaneous integer variable 10? y

 

 

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

# Configuration File association parameters (default is "y")

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

#400. Name of associated cfg file?

401. Read SYSTEM COLORS section? y

402. Read ALLOCATIONS section? y

403. Read TOLERANCES section? y

404. Read DATA PATHS section? y

405. Read COMMUNICATIONS section? y

406. Read DRAFT SETTINGS section? y

407. Read MISCELLANEOUS section? y

408. Read NC SETTINGS section? y

409. Read DIALOG SCRIPTS section? y

410. Read DESIGN SETTINGS section? y

411. Read PLOTTER SETTINGS section? y

412. Read ALT-KEY ASSIGNMENTS section? y

413. Read CAD section? y

414. Read START/EXIT section? y

415. Read SCREEN section? y

416. Read FILE NAMES section? y

 

1500. Chook to execute from 'Misc. values' button?

1501. Insert parameter information in the ascii NCI? n

1502. Write operation information to binary file (.ops)? n

 

1520. Display a warning when cutter compensation in control simulation finds an error? n

 

# Do NOT manually change the answer for Q.1999 !

1999. Product major version number that post supports? 9

 

3001. Machine acceleration? 2

3002. timing size? .1

 

 

My control exec has these rules to follow:

 

Plane changes on a line by itself with no other G codes. Circular blocks as follows.

 

G17 = X.0000 Y.0000 I.0000 J.0000 K.0000

where K is the Z endpoint position And I & J are the X & Y center points of the arc being swung in the given plane.

 

G18 = X.0000 Z.0000 I.0000 J.0000 K.0000

Where J is the Y endpoint position and I & K are the X & Z center points of the acr being swung in the given plane.

 

G19 = Y.0000 Z.0000 I.0000 J.0000 K.0000

Where I is the X endpoint position and J $ K are the Y & Z center points of the arc being swung in the given plane.

 

Ok the Alleged Buggar.........

 

 

My control will only accept 5 of the six fields in a cir block. They must be in the correct order I have layed out above. It will fault out on the redundant field.

 

Sometimes the post will Output all six on the same line, causing my machine to fault.

 

Sometimes the post will output only 4, which will cause a crash.

 

Sometimes the post will output random G17, G18, G19, in the wrong place that would result in a few more grey hairs......

 

As you can see in my post here, I have resorted to forcing all six fields to be output. This way I am assured that it never leaves it out.

 

My script..... then cleans it all up and makes me a happy camper:) smile.gif

 

 

Whew....... was that long winded or what..........

 

Murlin

Link to comment
Share on other sites

Murlin,

code:

  "Sorry Rodger, I didn't mean to offend by my use of the "B" word:)" 

No offense taken, it's just that if they IS a bug - I want to know about.

That's the way to eliminate them!

 

 

As for your post problem...

 

I kind of see what you are taking about, but a real world sample to probably to much to clarify.

 

Question about -> "Plane changes on a line by itself with no other G codes. Circular blocks as follows"

This means NO G17,G18,or G19 plane code output is needed?

 

If you could supply me with sample files ->

 

1> MC9 with toolpaths to process

2> The original NC output from your PST (with the 'bad' stuff)

3> The corrected NC file that works on your Big Blue

 

Roger

Link to comment
Share on other sites

Thanks Roger....

 

For every plane change, the G17,18,&19 must be input on a line by itself, preceeding the Circular Block.

 

One Correction, I was using the wrong terminology to explain what I was doing.

 

I dont actually have a "VB script".

 

What I have made is a Windows executible, that was compiled using Visual Basic 6.0:)

 

It does a complete rewrite of the NC file I run it on.

 

I think in order for me to run my .exe file from inside the post, I will have to know the name of the window that pops up when Mastercam asks for the NC file name.

 

Then I can rewrite my .exe to extract the file name variable.

 

Note....this "BUG", is in the Scallop toolpath.

I use alot of Scallops and MUST toggle the filter to output arcs in the xz and yz planes to keep the files shorter due to buffer restraints.

 

I would hate to have you guys waste any time on my problem.

 

Most machine tools work well running from point to point and the workaround is just to turn off the arcs on Scallop.

 

GRRRRR I just cant do that..........wish I could, my life would be soooo much simpler.haha

 

 

I can get you a sample of the NC code. I will have to dig up an old version of my post before all the modifications were done to it.

 

If there is anyone out there who uses this control that came over on the "Mayflower", I would be happy to share my source code with you.

 

Murlin

 

[ 07-11-2003, 12:04 PM: Message edited by: Murlin ]

Link to comment
Share on other sites

You can do that...

 

Use the LAUNCH() command to start your "post" Post Processor EXE

 

code:

 

peof # This is the PEOF postblock that ALREADY exists in your PST

n, pcooloff

n, "M00"

 

# ADDED CODE (START)

 

# Define the full PathNmae of the EXE to be run

strEXE "C:Mcam91CommonTempMY_SPECIAL_EXE"

 

# This string will hold the built up PathName of the NC file created by the post.

strfilename

 

result : 0 # Needed for the 'launch()' command

 

ppost # This posblock is called AFTER all the files from the PST run are closed!

if not(fastmode), pdiags # This postblock is ONLY for explanation purposes !

 

strfilename = spathnc + snamenc + sextnc # Build up the PathName of the NC file

result = launch(strEXE, strfilename)

 

pdiags # This postblock is ONLY for explanation purposes !

*e

"---------------------------------------------", e

"DIAGNOSTIC outputs (for explanation purposes)", e

"---------------------------------------------", e

*e

"PATH, NAME and EXTENSION of the NC file", e

"spathnc -> ", ~spathnc, e

"snamenc -> ", ~snamenc, e

"sextnc -> ", ~sextnc, e

*e

 

# ADDED CODE (END)

 

 


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