I am trying to write a new post in GPOST for our Siemens 840D controller, and I am having an issue trying to out put the PPRINT/ statements, the NCL file has the cl words in it, but the post is not outputting the statements.
Any help is welcome
Peter
All good, I have found it
Peter
Please post what your solution was in case others have the same issue.
Just in case someone is trying to use PPRINT statements and would like to have an example of FIL code that handles it, here's a chunk of code I use to get the "OPERATION COMMENTS" from the .ncl file into my G-code files:
$$
$$ --[ Macro : PRTCMT ]-------------------------------------------------
$$
$$ Write the Operation Comments into the Description portion of the out-
$$ put file. This is done by the following algorithm:
$$
$$ (1) Save the current CL record position.
$$ (2) Parse through the CL records until finding a PPRINT statment
$$ that contains the key phrase OPERATION COMMENTS. If no such
$$ statement is present, a blank Description line is output.
$$ (3) If the key phrase was found, read each subsequent PPRINT
$$ statement and print its contents to the output file.
$$ (4) If subsequent CL record is not a PPRINT statement, or if the
$$ key phrase TOOL COMMENTS is encountered, stop looking for
$$ more comments.
$$ (5) Reset the CL file to the restart position.
$$
$$ Note that for this to be useful, the user must be outputting the
$$ comments by specifying Operation Comments, and adding PPRINT
$$ parameters that allow them to be output to the CL file.
$$
PRTCMT = MACRO/
CIMPOS = POSTF ( 7, 1 ) + 1
LINCNT = 0
DO/ DOLIN, INDXLN = 0, 10, 1
RESULT = POSTF ( 14 )
CMDTYP = POSTF ( 7, 2 )
CMDSUB = POSTF ( 7, 3 )
IF ( CMDTYP .EQ. 14000 ) THEN
INDXLN = 11
ELSE
INDXLN = 2
TARGET = ICODEF ( PPRINT )
IF ( CMDTYP .EQ. 2000 .AND. CMDSUB .EQ. TARGET ) THEN
CMTNOW = TEXT/ OMIT, (TEXT/ CLW), 1
ISCOMT = INDXF ( CMTNOW, (TEXT/ 'OPERATION COMMENTS') )
IF ( ISCOMT .GT. 0 ) THEN
DO/ DOCMT, INDXCM = 0, 10, 1
RESULT = POSTF ( 14 )
CMDTYP = POSTF ( 7, 2 )
CMDSUB = POSTF ( 7, 3 )
IF ( CMDTYP .EQ. 2000 .AND. CMDSUB .EQ. TARGET ) THEN
CMTNOW = TEXT/ OMIT, (TEXT/ CLW), 1
CMTEND = INDXF ( CMTNOW, (TEXT/ 'TOOL COMMENTS') )
IF ( CMTEND .GT. 0 ) THEN
INDXCM = 11
ELSE
INDXCM = 2
CMTNOW = TEXT/ OMIT, (TEXT/ CLW), 1
CMTNOW = TEXT/ MODIFY,CMTNOW,(TEXT/ '/'),(TEXT/ ''),1
CMTNOW = TEXT/ OMIT, CMTNOW, 2
IF ( LINCNT .GT. 0 ) THEN
TXTPRE = TEXT/ '( '
ELSE
TXTPRE =TEXT/'( D',(TEXT/LOW,(TEXT/ 'escription :'))
ENDIF
INSERT/ TXTPRE, ' ', CMTNOW
INSERT/ ' )$'
LINCNT = LINCNT + 1
ENDIF
ELSE
INDXCM = 11
INDXLN = 11
ENDIF
DOCMT) CONTIN
ENDIF
ENDIF
ENDIF
DOLIN) CONTIN
$$
$$ If no comments were found, output a single line with the
$$ Description designation.
$$
IF ( LINCNT .LE. 0 ) THEN
TXTPRE = TEXT/ '( D', ( TEXT/LOW, ( TEXT/ 'escription :' ) )
INSERT/ TXTPRE
INSERT/ ' )$'
ENDIF
RESULT = POSTF ( 15, CIMPOS )
TERMAC
It might seem to be a bit much, but it's worked for me quite nicely.
Most of my PPRINT troubles have been figuring out which of the giant list of things to output to the .ncl file and setting the correct boolean indicator so they are passed through. It's messy. Plus, the POSTF stuff is incredibly cryptic.
Thank you for the code, I will look at it and see what I can use, I got mine to work, found the operator message tick box, and ticked it , it now outputs everything, but I will need a filter, so your code will help.
Thank you
Peter