Frank Lehrbass Text file output using GEOPAK ASCII Format Text file output using GEOPAK ASCII Format Date: Author: 1 2019-01-28 Frank Lehrbass Document version: 1.20 General This document describes how the output with a GEOPAK ASCII Format file (*.GAF) works and how the output can be adapted to the user's needs. GEOPAK allows to output tolerances, elements and texts to a text file. This is done using the GEOPAK command "Open output file". Beside the two standard formats "Mitutoyo GEOPAK-Win" and "Mitutoyo GEOPAK-3" several other formats are offered. It is possible to create own GAF files. These files are located in the MCOSMOS\INI directory. The GAF file name in the INI directory corresponds directly to the selectable file format in the dialogue "Open output file". This document contains the necessary information to adapt these GAF files. 2019-01-28 Document v1.20 1 of 14 Text file output using GEOPAK ASCII Format 2 Frank Lehrbass Contents of a GAF file A GAF file has only the section [User]. It contains several entries for the output, such as - General settings e.g. Date/Time format, decimal separator - General tokens e.g. comment line, head line, line number, file begin, file end - Tokens and variable names for tolerance data output - Tokens and variable names for element data output - Format strings e.g. right bounded, left bounded, centred Variables Variables you can find at the beginning of a line followed by a "=" and a format string. E.g. Elm_Cir=, Tol_PosX= Tokens Tokens are used within a format string. They are encapsulated by a leading "«" and a trailing "»" character e.g. «Nominal»;«UpperTol»;«LowerTol». The tokens are later replaced by its contents (Number or text). Extracts from a GAF file: Tol_PosX= «ElemNo»;«TolName»;«FeatName»;«Nominal»;«UpperTol»;«LowerTol»; «Actual»;«Deviation»;«OutOfSpec»;«TolBar»^CR^LF Tol_PosY= «ElemNo»;«TolName»;«FeatName»;«Nominal»;«UpperTol»;«LowerTol»; «Actual»;«Deviation»;«OutOfSpec»;«TolBar»^CR^LF … Tol_Cone= «ElemNo»;«TolName»;«FeatName»;«Nominal»;«UpperTol»;;«Actual»; «Deviation»;«OutOfSpec»;«HalfTolBar»^CR^LF 3 Principle of the output The output is started when the GEOPAK command "Open output file" is called. It is finished when "Close output file" is called. There are different triggers for the output depending of which command is called in the GEOPAK part program Begin or end of the file output (FileBeg, FileEnd) Output text (Comment) Output if an element is calculated (Elm_...) Output if a tolerance comparison is called (Tol_...) 2 of 14 Document v1.20 2019-01-28 Frank Lehrbass 4 4.1 Text file output using GEOPAK ASCII Format Examples Output date and time at the beginning of the file The following output should be created at the beginning of the GAF file. FILNAM/'DMIS-Output' DATE=2016/06/28 TIME=09:14:35 The GAF file looks as follows: [User] FormatTime=%H:%M:%S FormatDate=%Y/%m/%d FileBeg = FILNAM/'«PartName»'^CR^LFDATE=«ActDat»^CR^LFTIME=«ActTime»^CR^LF 2019-01-28 Document v1.20 3 of 14 Text file output using GEOPAK ASCII Format 5 Frank Lehrbass Tokens and variable names 5.1 Variable names Variable name General settings Description DecimalSep The decimal separator separates the integer part and the decimal part of a number e.g. 123.456, or 123,456 Optional any character can be used e.g. a comma DecimalSep =. (Default point) DecimalSep =, FormatDate FormatTime %Y/%m/%d Y: Year m: Month d: Day Default: "%d.%m.%Y" 16.11.2011 %H:%M:%S H: Hours M: Minutes S: Seconds Default: "%H:%M:%S" 10:14:40 General output Comment Outputs the text from the command "Output text" Related token is «CommentLine» FileBeg The output is done when the file is opened. Possible tokens: SubLot, PartName, PartProgName, Operator, ActDat, ActTime The output is done when the file is closed Possible tokens: See FileBeg Outputs the head data if "Head data" is selected as output in "Open output file". FileEnd Headline HeadlineBeg, HeadlineEnd 4 of 14 Called at begin/end of the headline output. Just the given text is output. No further analysis of the format string is done Document v1.20 2019-01-28 Frank Lehrbass 5.2 Text file output using GEOPAK ASCII Format Elements Variable names for elements start with "Elm_". If the format string becomes too long they can be continued in the next line. Then you have to add the tokens "#1" or "#2" at the end. This indicates for the output that there is a following format line for this element output. Example: Elm_Lin =«Typ» «Group»^FF030…^CR^LF«#1» Elm_Lin#1 =«ElemName»^FF030«TxtLocY/R3»«LocY/R11» …^CR^LF«#2» Elm_Lin#2 =(«ElemNo»)^FF030«TxtLocZ/R3»…^CR^LF Elements Elm_Angle Element Angle Elm_Cir Element Circle Elm_CirInt Intersection Circle Elm_Con Element Cone Elm_Cyl Element Cylinder Elm_Dist Element Distance Elm_Ell Element Ellipse Elm_Lin Element Line Elm_LinInt Intersection Line Elm_LinSym Symmetry Line Elm_LinTan Tangent Elm_Pln Element Plane Elm_PlnSym Symmetry Plane Elm_Sph Element Sphere Elm_SphFit Fit element Sphere Hole shape elements Elm_Drop Element Drop Elm_Hexagon Element Hexagon Elm_Rectangle Element Rectangle Elm_Slot Element Slot Elm_Square Element Square Elm_Trapezoid Element Trapezoid Elm_Triangle Element Triangle 5.3 Tokens If the token can be used with tolerances or elements you can see in the column "Elm" and "Tol" Token name Description ActDat Actual date. Format can be set with "FormatDate" Possible for elements, tolerances, FileBeg, FileEnd Actual time. Format can be set with "FormatTime" Possible for elements, tolerances, FileBeg, FileEnd ActTime Element output Angle AngleCone 2019-01-28 Element angle: Angle Element cone: Half cone angle Element cone: Cone angle Document v1.20 5 of 14 Elm Tol x x x x Text file output using GEOPAK ASCII Format AvrTemp CalcMethod CorMode Frank Lehrbass Average temperature Calculation method of the element PO: Projected origin Ce: Centroid Depending on the actual co-ordinate system the following is output: CART: Cartesian co-ordinates POL : Polar co-ordinates SPH : Spherical co-ordinates Maximum deviation of the element Diameter 1 and 2 of a step cylinder Deviation Diam1 Diam2 Diameter Diameter of element DirPlnX, DirPlnY, Direction of element axes in X, Y or Z e.g. for an ellipse DirPlnZ DirSpcX, DirSpcY, Direction of element in space in X, Y or Z DirSpcZ The output depends on the setting for direction vector Dist DistX, DistY, DistZ DropRad1 DropRad2 ElemName ElemNo ElemTyp RefElemTyp Distance from origin (Line, Plane) 3D Distance (Element distance) Element distance: Distance in X,Y or Z in Cartesian co-ordiantes Radius 1 and 2 of a drop Element name of the actual element Element number of the actual element Returns type of element as text Returns type of reference element as text ElmAngle ElmCircle ElmCone ElmContour ElmCylinder ElmDistance ElmEllipse ElmLine ElmPlane ElmPoint ElmSphere ElmSurface Hole shape elements: ElmRectangle ElmSquare ElmSlot ElmDrop ElmTriangle ElmTrapezoid ElmHexagon 6 of 14 Document v1.20 2019-01-28 x x x - x x x - x x - x - x - x x x x Frank Lehrbass Eval Text file output using GEOPAK ASCII Format Returns tolerance state 0: Tolerance Ok Actual value between upper and lower control limit - x - x x - x - x x - x x x x x - x - x - x x - x x - x - x x - x x x x x x - x x 1: Actual value between upper tolerance and upper control limit Actual value between lower tolerance and lower control limit 2: Actual value out of tolerance Actual value beyond upper tolerance Actual value below lower tolerance FeatName HalfTolBar TolBar LowerTol UpperTol MMSLabel MMCApplied MMCRefLabel NomTol Nominal OutOfSpec PosNo ProjPlane RefCrdLbl1 RefCrdLbl2 RefCrdLbl3 RefNo RefElemTyp RefName RefCrd1 RefCrd2 RefCrd3 Surface Text tokens TxtActVal TxtNomVal TxtNomTol TxtUpTol TxtLoTol TxtDevFrNom TxtOutOfSpec TxtTol TxtActA TxtActB TxtActC TolLbl TolName 2019-01-28 Feature name used in "Further tolerance options" Graphic of tolerance bar Examples: |--->>, ---***-----, -----+--->>, -----*----Lower tolerance value Upper tolerance value Returns if MMC was applied to tolerance 0: not applied; 1: applied MMC Label of reference element Value of Nominal Tolerance Nominal value Value, how far the tolerance is out of specification value Position number or Position label used in "Further tolerance options" xy yz zx Signifier of 1st Reference Co-ordinate e.g. "XN=" Signifier of 2nd Reference Co-ordinate e.g. "YN=" Signifier of 3rd Reference Co-ordinate e.g. "ZN=" Element number of reference element Returns type of reference element as text For output texts see "ElemTyp" Element name of reference element Reference value of the first/second/third co-ordinate of position tolerance or concentricity, dependent on the projection plane Outputs language text for "Surface" Language texts for tolerances "AV" Actual value "NV" Nominal value "NT" Nominal tolerance "UT" Upper tolerance "LT" Lower tolerance "DV" Deviation "ER" Error "TO" Tolerance Signifier of 1st text e.g. "XA=", "XN, "R" Signifier of 2nd text e.g. "YA=", "YN, "PH", Signifier of 3rd text e.g. "ZA=", "ZN", "TH Feature label used in "Further tolerance options" Tolerance name e.g. "Position", "Diameter" Document v1.20 7 of 14 Text file output using GEOPAK ASCII Format TolType TolBar TolInOutTxt Uncertainty UpSAtMMS UpperTol UpS Unit Frank Lehrbass Tolerance type, e.g." Tol_PosX-YZ_XY", " Tol_Diam1-YZ_XY" See also "HalfTolBar" "INTOL" "OUTTOL" Value of uncertainty Upper specification of MMC Upper tolerance value Upper specification, including MMC bonus if applied Language dependent unit string "DEG" or "DMS" for angles "mm" or "Inch" for length PrgLine Line number in part program editor Upper line number in part program list Example: N«PrgLine/Z4» («LinNo/Z4») N0012 (0020) PartName Part name Output possible for FileBeg and FileEnd Part program name Output possible for FileBeg and FileEnd Point number of point with maximum deviation Point number of point with minimum deviation Radius of element Standard deviation of element Sublot Output possible for FileBeg and FileEnd Name of element type e.g. "Point", "Sphere", "Circle", "Ellipse"… PartProgName PntNoMaxDev PntNoMinDev Radius StdDev SubLot Typ Identifier TxtLocX TxtLocY TxtLocZ 8 of 14 Identifier for X value as string in the actual language X: Cartesian co-ordinate system R: Polar/Spherical co-ordinate system Identifier for Y value as string in the actual language Y: Cartesian co-ordinate system PH: Polar/Spherical co-ordinate system Identifier for Z value as string in the actual language Z: Cartesian co-ordinate system X,Y,Z: Polar co-ordinate system TH: Spherical co-ordinate system Document v1.20 2019-01-28 - x x x - x x x x x x x x - x - - x x x x - - x - x - x - x - Frank Lehrbass Text file output using GEOPAK ASCII Format TxtAngX Identifier for X value as string in the actual language AX=… : Cartesian co-ordinate system I=… : Angle as cosine If "Use uniform symbols" is set, this text is used x - TxtAngY Identifier for Y value as string in the actual language AY=… : Cartesian co-ordinate system J=…: Angle as cosine If "Use uniform symbols" is set, this text is used Identifier for Z value as string in the actual language AZ=… : Cartesian co-ordinate system K=… : Angle as cosine If "Use uniform symbols" is set, this text is used Identifier for diameter as string in the actual language D=… If "Use uniform symbols" is set, this text is used Identifier for diameter 1 as string in the actual language D1=… If "Use uniform symbols" is set, this text is used Identifier for diameter 2 as string in the actual language D2=… If "Use uniform symbols" is set, this text is used Identifier for angle as string in the actual language A=… If "Use uniform symbols" is set, this text is used Identifier for half angle as string in the actual language A2=… If "Use uniform symbols" is set, this text is used Identifier for half angle as string in the actual language L=… Identifier for maximum difference as string in the actual language d=… Identifier for distance as string in the actual language DI=… 3D distance DX=… Distance in X DY=… Distance in Y DZ=… Distance in Z Identifier for hole shape width as string in the actual language W=… Width W1=… Width of hexagon Identifier for hole shape length as string in the actual language L=… Identifier for hole shape height as string in the actual language H=… x - x - x - x - x - x - x - x - x - x - x - x - x - TxtAngZ TxtDiam TxtDiam1 TxtDiam2 TxtAngle TxtHalfAng TxtDistToOrig TxtMaxDiff TxtDist TxtDistX TxtDistY TxtDistZ TxtHoleDist TxtHoleLength TxtHoleHeight 2019-01-28 Document v1.20 9 of 14 Text file output using GEOPAK ASCII Format Frank Lehrbass TxtDropRad1 TxtDropRad2 Identifier for drop radius 1 and 2 as string in the actual language R1=… R2=… TxtHexagonWidth2 Identifier for hexagon width 2 and 3 as string in the actual TxtHexagonWidth3 language W2=… W3=… WithElem… For constructed elements the involved elements can be output with these tokens. Affected constructed elements are: - Symmetry element Point, Line, Plane - Distance and Angle - Fit in element Sphere, WithElemNo1 WithElemNo2 WithElemName1 WithElemName2 Tolerance output Actual ActualA ActualB ActualC Contour DistToMMS Output head data HD_<HeadDataID> 10 of 14 x - x - Element number of 1st and 2nd element x - Element name of 1st and 2nd element x - Tolerance value of actual tolerance 1st actual co-ordinate value of actual tolerance Position, Concentricity 2nd actual co-ordinate value of actual tolerance Position, Concentricity 3rd actual co-ordinate value of actual tolerance Position Outputs text "Contour" in the actual language Distance to max. material size, defined by tolerance of diameter or distance - x x - x - x - x x - x x x x x x Returns content of head data entry «HD_...» e.g. HD_DrawNumber Document v1.20 2019-01-28 Frank Lehrbass Text file output using GEOPAK ASCII Format Tokens for elements Group Returns the type of calculation, type how the element was built as string in the actual language "Theo. element" "Min. zone element" "Enveloping element" "Fit element" "Mean" "Symmetry" "Intersection element" "Side" "Add radius" "Subtract radius" "no compensation" "Calculated angle" "Difference to 180 degree" HoleHeigth Height of hole shape element HoleWidth Width of hole shape element HexagonWidth2 Width 2 of element hexagon Lambda1, Lambda1 or Lambda2 of element (Line, Cylinder, Cone) Lambda2 LangTxt<LineNo> This token is replaced by a text in the file ..\INI\ISR_LANG. The number is line number in this file x - x x x x - Example: LangTxt152 is replaced by "Distance" LinNo Internal line number of part program command Lower line number in part program list Example: N«PrgLine/Z4» («LinNo/Z4») N0012 (0020) x - LrgDiameter LrgRadius LocX,LocY, LocZ Large diameter of ellipse Large radius of ellipse Location of element Centroid or Projected origin dependent on calculation Vector of material direction in X, Y, or Z x x x - Minimum deviation of element Maximum deviation of element Number of points of element x x x - Pre-define element needs to be set Nominal angle of cone x - MatVecX, MatVecY, MatVecZ MinDev MaxDev NoofPnts Nominal data NomAngleCone 2019-01-28 Document v1.20 11 of 14 Text file output using GEOPAK ASCII Format NomDiam NomDirSpcX, NomDirSpcY, NomDirSpcZ NomLocX, NomLocY, NomLocZ Others Operator Element Two-Point-Size NoOfSizes Maximum Minimum Average Range TxtMaximum TxtMinimum TxtAverage TxtMaxDiff Nominal diameter Nominal direction of element axes in X, Y or Z x x - Nominal location X, Y, or Z of element x - x - - x x x x x - x x x x - MCOSMOS operator name Output possible for FileBeg and FileEnd Special tokens and symbols for "Element Two-Point Size" >= MCOSMOS v4.3 Number of sizes Maximum size Minimum size Average size Range of sizes Symbol Meaning MX Maximum size MN Minimum size AV Average size d Range of sizes Possible format strings for date and time output Format Description %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %c Date and time representation appropriate for locale %d Day of month as decimal number (01 - 31) %H Hour in 24-hour format (00 - 23) %I Hour in 12-hour format (01 - 12) %j Day of year as decimal number (001 - 366) %m Month as decimal number (01 - 12) %M Minute as decimal number (00 - 59) %p Current locale's A.M./P.M. indicator for 12-hour clock %S Second as decimal number (00 - 59) %U Week of year as decimal number, with Sunday as first day of week (00 - 53) %w Weekday as decimal number (0 - 6; Sunday is 0) %W Week of year as decimal number, with Monday as first day of week (00 - 53) %x Date representation for current locale %X Time representation for current locale %y Year without century, as decimal number (00 - 99) %Y Year with century, as decimal number 12 of 14 Frank Lehrbass Document v1.20 Example e.g. Wed Wednesday Nov November 11/16/11 13:49:17 16 13 1 320 11 49 PM 17 46 3 46 11/16/11 13:49:17 11 2011 2019-01-28 Frank Lehrbass Text file output using GEOPAK ASCII Format Formatting the output The output of the tokens can be formatted. The token itself is followed by the format string. Token name /L10 /R11 /Z4 ^CR^LF ^FF<Number> 2019-01-28 Description Left bounded output Example: «LangTxt195/L8» The language text 195 "Result" is output. Remaining places are filled with blanks Example: 1234567890 Result.. Right bounded output Example: «UpperTol/R11» The upper tolerance is output. Remaining places are filled with blanks Example: 12345678901 ....65.0000 Output with leading zeros Example: N«PrgLine/Z4» N1234 N0246 Outputs a Carriage return and Line feed "Goes" to the next line Form feed of <Number> characters Example: ^FF020ABCxyz 20 blank characters are output before "ABCxyz" is output 123456789012345678901234567890 ABCxyz Document v1.20 13 of 14 Text file output using GEOPAK ASCII Format 6 Frank Lehrbass History of changes v1.10 Token "ActDate" renamed to "ActDat" v1.20 Add tokens and symbols for Element "Two-Point-Size" 14 of 14 Document v1.20 2019-01-28