i got no G viewer

Moderators: TomKerekes, dynomotion

turbothis
Posts: 331
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: i got no G viewer

Post by turbothis » Sun Jan 18, 2026 1:45 am

i changed from my custom screen to the basic 2 axis lathe. got the tool path but of course the tool is backwards
Attachments
doom.JPG

turbothis
Posts: 331
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: i got no G viewer

Post by turbothis » Sun Jan 18, 2026 4:32 pm

on the g code viewer. if i am in basic 2 axis lathe and there is no function to adjust a Y axis value, why is there an elevation difference from the toolpath and the tool? i would think they would be the same plane?

turbothis
Posts: 331
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: i got no G viewer

Post by turbothis » Sun Jan 18, 2026 5:01 pm

in case this helps....
Attachments
settings in question.JPG

turbothis
Posts: 331
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: i got no G viewer

Post by turbothis » Sun Jan 18, 2026 6:12 pm

ok, i found the backwards on the radius in my post processor again. :roll:
somehow i can edit in the c gode window too.
my Y axis hovering tool in the g code viewer does remain though. i downloaded a new kmotion cnc on my office desktop and it does not do that. not sure what it is

my working PPR again

Code: Select all

TITLE:
	:T1 = {
		CNC Lathe
			Mach3 Radius Mode Post
			G32 type threading
			Modified by Steve Blackmore 06/04/05
	}
	:T2 = {
			Added Mach3 Constant surface speed support 30/01/05
			Added G83 peck drilling 02/03/05
			New tool format support added 27/07/05
			Altered M6 to follow tool select 24/12/05
			Modified by Steve Blackmore
	}
END:

VERSION:
        FILEVERSION 11.0 TURNING
END:

WORDS:
	:TMP = {DDDDDD.dd}
	:BLOCK = {"N"DDDD" "}
	:XAXIS = {"Z"DDDDD.ddd" "} {"Z"DDD.dddd" "}
	:YAXIS = {"X"DDDDD.ddd" "} {"X"DDD.dddd" "}
	:XARC = {"K"DDDDD.ddd" "} {"K"DDD.dddd" "}
	:YARC = {"I"DDDDD.ddd" "} {"I"DDD.dddd" "}
	:ARAD = {"R"DDDDD.ddd" "} {"R"DDD.dddd" "}
	:DELAY = {"G04 P"DDD" "}
	:DWELL = {"P"DDDD.dddd" "}
	:PECK = {"Q"DDDDD.ddd" "} {"Q"DDD.dddd" "}
	:NDEEP = {"Q"DDDDD.ddd" "} {"Q"DDD.dddd" "}
	:RPLANE = {"R"DDDDD.ddd" "} {"R"DDD.DDDD" "}
	:FEED = {"F"DDDDD.dddI" "} {"F"DDD.dddd" "}
	:SPIN = {"S"DDDD" "}
	:TOOL = {"T"ZDD}
	:SUBPR = {"P"DDDD" "}
	:REPEAT = {"L"DDDD" "}
	:CRC = {"D"DD" "}
	:TLC = {""ZDD" "}
	:SURF = {"S"DDDD" "}
        :SRAD = {"R"DDDD.ddI} {"R"DD.ddddI}
	:INDEX = {"INDEX"DDD.ddd" "}
	:PROGNO = {"O"DDDDD" "}
	:NUM1 = {" "DDDD.dddd" "}
	:ROT = {" "DD" "}
	:TOOLD = {DDDDD.ddd} {DDD.dddd}
END:

AXES:
	YSCALE		1
        XSCALE		1
	TURRET
END:

GROUPS:
	:G1 = {G00_ G01_ G02_ G03_ G80_ G81_ G82_ G83_ G83.1_ G84_ G85_ G86_ G87_ G88_ G89_}
	:G2 = {G17_ G18_ G19_}
	:G3 = {G90_ G91_ G90.1_ G91.1_}
	:G5 = {G48_ G93_ G94_ G95_ G96_ G97_}
	:G6 = {G20_ G21_}
	:G7 = {G40_ G41_ G42_}
	:G8 = {G43_ G49_}
	:G10 = {G98_ G99_}
	:G12 = {G50_ G51_ G54_ G55_ G56_ G57_ G58_ G59_ G59.1_ G59.2_ G59.3_}
	:G13 = {G61_ G61.1_ G64_}
	:G4 = {M00_ M01_ M02_}
	:G7 = {M03_ M04_ M05_}
	:G8 = {M07_ M08_ M09_}
	:G9 = {M48_ M49_}
END:

CYCLES:

     	NPECK       CANNED
	NDEEP       CANNED
	TURN	    EXPAND
	FACE	    EXPAND
        THREAD	    EXPAND
END:

MACROS:
	#N = {
		$BLOCK:BLOCK

		; If the block number reaches the max (according to RD274) start over
		; Note: 'N' has no meaning in processing and is there for readability ONLY
		IF ($BLOCK EQ 99990) THEN
			SET $BLOCK = 5
		ENDIF
	}

	#L = { [RAPID ? (G01_) / (G00_)]  }
	#FTYPE = { [FEEDTYPE ? (G94_) / (G95_) ] }
	#X = { $X:XAXIS }
	#Y = { $Y:YAXIS }
	#I = { $XCEN:XARC }
	#K = { $YCEN:YARC }
	#AR = { $ARCRAD:ARAD }
	#R = { ($CCLDIST:RPLANE) }
	#P = { IF ($CDELAY NE 0) THEN ($CDELAY:DWELL) ENDIF }
	#F = { [RAPID ? [FEEDTYPE ? ($FPM:FEED) / ($FPR:FEED)] ] }
	#DWELL = { IF ($CDELAY NE 0) THEN (G82_) ELSE (G81_) ENDIF }
	#RAPID = { SET [RAPID] = 2 }
	#FEED = { SET [RAPID] = 1 }
	#SPIN =  { ($SPINDLE:SPIN) [SPIN ? (M05_) / (M03_) / (M04_) ] }
	#SURF =  { IF ( $SURF GT 1) THEN
                   $SURF:SURF
               ELSE "S525"
               ENDIF
              }
	#GCLW = {
		IF ($USR11 EQ 0) THEN
			(G02_)
		ELSE
			(G03_)
		ENDIF
		}
	#GACLW = {
		IF ($USR11 EQ 0) THEN
			(G03_)
		ELSE
			(G02_)
		ENDIF
		}
	#IPLANE = {
		IF ([CRETRACT] EQ 2) THEN
			(G99_)
		ELSE
			(G98_)
		ENDIF
	}

	#CRC = {
		; Only output G41/G42 if part surface is requested (PSPROG=2) which means the CNC
		;  has to offset the tool
		IF ([PSPROG] EQ 2) THEN
			[CUTCOM ? (G40_) / (G41_) / (G42_) ]
		ENDIF
	}

	#CRCNO = { 
		IF ([PSPROG] EQ 2) THEN
			($CRCNO:CRC)
		ENDIF
		}

  #Q = { ABS($CDEPTH/$CNDEPTH):NDEEP }

	#Q = { ABS($CDEPTH/$CNDEPTH):NPECK }

	#UNSET = {
		IF ((ABS($DELTAX) LT $USR8) AND (ABS($DELTAY) LT $USR8)) THEN
			UNSETALL
		ENDIF
	}

END:

RULES:

	:INIT = {
		set $RAPIDFEED = 100	 ; rapid feedrate
		SET $USR11 = 0 ; Set to 1 if Proturn Arcs to be negated (dependant on tool)
		SET $USR12 = 0 ; set for Arc direction fix for FRONT turret and TURN cycles.
		SET $USR13 = 1.0 ; SCALE FACTOR TO COMPENSATE FOR ANGLES BEING WRONGLY SCALED IN INCH.
		SET $USR14 = 0.0
	}

	:START = {
		; start with N10, increment in 1s
		SET $BLOCK = 1
		set $INCR = 1
	}

	:ORIGIN = {
		;#N (G92_) $ORIGINY:YAXIS $ORIGINX:XAXIS EOB
                ;unset :XAXIS
		;unset :YAXIS
	}

	

	:RETRACT = { #N #L #Y #X EOB }

	

	

	:UNITS = {
		; G20/G21 = Inch/MM units
		; G18 = XZ Plane
		; G64 = Constant velocity mode (G61 = exact stop)
		; G80 = Cancel modal motion (deactivates all move modalities)
		; G90 = Absolute mode (G91 = Incremental mode)
		; M49 = Disable speed/feed overrides

		#N [UNITS ? (G21_) / (G20_)] (G18_) (G64_) (G80_) (G90_) (M49_) "G90.1 "

		; KAA - changed order to default IN so that the set is not needed 2x for each IN
		; Sets MIN change in move for a program block to be written
		SET $USR8 = 0.00005		; default IN scale
		set $usr13 = 25.4

		IF ([UNITS] EQ 1) THEN
			SET $USR8 = 0.0005	; set MM scale
			SET $USR13 = 1.0
		ENDIF

		(G40_) (G49_) (G80_) EOB
		
		#N #FTYPE #F EOB
		
	}

	
	:CUTCOM = {
			IF (0 NE 0) THEN
			; Only output G41/G42 if part surface is requested (PSPROG=2) which means the CNC
			;  has to offset the tool
			IF ([PSPROG] EQ 2) THEN
				[CUTCOM ? (G40_) / (G41_) / (G42_) ]
			ELSE
				(G40_)
			ENDIF

			#CRCNO EOB
		ENDIF
	}

	:GOTO = 
		{
		NULL ; "DISTANCE : " $DISTANCE:NUM1 EOB
		IF ($DISTANCE GE $USR8) THEN
			#N #CRC #CRCNO EOB
			#N #L #Y #X #FTYPE #F EOB
		ENDIF
		}

	:GOCLW = {
		#UNSET
		IF (([PSPROG] NE 2) OR ([CUTCOM] LT 2)) THEN
			#N #CRC EOB
			#N #GCLW #Y #X #AR #F EOB
		ELSE
			#N #CRC #CRCNO EOB
			#N #GCLW #Y #X #AR #F EOB
		ENDIF
	}

	:GOACLW = {
		#UNSET
		IF (([PSPROG] NE 2) OR ([CUTCOM] LT 2)) THEN
			#N #CRC EOB
			#N #GACLW #Y #X #AR #F EOB
		ELSE
			#N #CRC #CRCNO EOB
			#N #GACLW #Y #X #AR #F EOB
		ENDIF
	}

	:DELAY = { #N $DELAY:DELAY EOB }

	:NDEEP = { #N (G83) #Y #X #R #Q #IPLANE #F EOB }

	:NPECK = { #N (G83.1) #Y #X #R #Q #IPLANE #F EOB }

	:SCREWING = { 	#N "G32 " #Y #X #F EOB
		UNSET (G5)
		UNSET :FEED
	}
	:SCRCUT = {
            	UNSET :FEED
		#N #FTYPE #F EOB
	       	#N (G0_) #X #Y EOB
		#N (G1_) $CXSTART:XAXIS $CYSTART:YAXIS EOB
		#N (G76_) ($CYEND-$CDEPTH):YAXIS $XEND:XAXIS ""$FEEDANGLE:PA " "$PITCH:FS " "$ROUGHCUTS:DS " "$FINISHCUTS:PF " T0 " $SPINDLE:SPIN ""$CLDIST:PO eob
		#N (G94_)eob
      		UNSET :FEED

    }


	:SPINDLE = {UNSET (G5)

        	IF ( [SPIN] eq 1) then
        	    	#N (M05) eob
        	ENDIF
        	IF ([SPINTYPE] EQ 2 ) THEN
        		#N [SPIN ? NULL / (M03_) / (M04_) ] #FTYPE #F EOB
			#N (G48_) $MAXSPIN:SPIN " " EOB
			#N (G96_) $SURF:SURF EOB
        	ELSE
        		#N [SPIN ? NULL / (M03_) / (M04_) ] #FTYPE #F EOB
			#N (G97_) $SPINDLE:SPIN " " EOB
        	ENDIF }



	:FINISH = { #N (M05_) (M09_) EOB
			#N (M30_) EOB " " EOB }

	

	:SELCTL = {
		SET $USR11 = 0
		IF ([TURRET] EQ 2) THEN
			SET $USR12 = 1     ; Front Turret, set $USR12 for TURN cycles arc direction
		else
			SET $USR12 = 0
		ENDIF
		set $CYCLETIME = $CYCLETIME + 0.5 ; 30 seconds for a tool change
			#N (M09_) EOB
	        	#N "G00"" " $YSAFPOS:YAXIS $XSAFPOS:XAXIS (M05_) EOB

		IF ($X NE $XTLOAD ) THEN
			#N (G28_) $XTLOAD:XAXIS EOB
			#N (G49_) EOB

		ELSE
		IF ($Y NE $YTLOAD ) THEN
			#N (G28_) $YTLOAD:YAXIS EOB
			#N (G49_) EOB

		ENDIF
		ENDIF
		EOB

			#N (G49_) EOB
			
			
		}

	

	:CYCLEOFF = {
		#N (G80_) EOB
		unset :G1
		UNSET(M08_)
		UNSET:RPLANE
		UNSET(M09_)
		UNSET :FEED
		UNSET:YAXIS
		UNSET:XAXIS
		UNSET (G5)
		UNSET :SPIN
		UNSET :PECK
		UNSET :DWELL
	}

	:GOHOME = {
		UNSET (G5)
		UNSET :FEED
		UNSET :SPIN
		#N "G00" " " $YSAFPOS:YAXIS $XSAFPOS:XAXIS #FTYPE #F EOB
		}


END:

User avatar
TomKerekes
Posts: 2889
Joined: Mon Dec 04, 2017 1:49 am

Re: i got no G viewer

Post by TomKerekes » Mon Jan 19, 2026 5:32 pm

i changed from my custom screen to the basic 2 axis lathe. got the tool path but of course the tool is backwards
With a custom screen normally the graphics goes to the GViewer on the custom screen. If you want to use the floating GViewer with your custom screen see here.
my Y axis hovering tool in the g code viewer does remain though. i downloaded a new kmotion cnc on my office desktop and it does not do that
I'm not sure what you mean. Maybe you have a Tool, Fixture, or G92 Offset that is non zero? You might add a dummy Y axis to the Coordinate System to display Y and view Machine Coordinates vs GCode Coordinates.
G code and CAM preview
the red line is what the machine tries to cut
You might change try changing Lath Options | X Positive Front.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply