Different machines same program TXT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Different machines same program TXT

    Hello,

    I have a problem with exporting to txt file.

    At our company we just get a new machine so now we have three of them. On all of them we measure with same programs.
    So the problem is now we would like to include in txt file on which machine was it measured without typing it in a comment or something like that.
    It would have to work AUTOMATICALLY no matter where would I measure.

    Thanks for help.

    Best regards.

  • #2
    Possibly edit the file_header.lbl on the report at each machine to have the machine name. At each machine make sure your report template uses that .lbl and that the template is named the same.

    Comment


    • #3
      Originally posted by WM321 View Post
      Possibly edit the file_header.lbl on the report at each machine to have the machine name. At each machine make sure your report template uses that .lbl and that the template is named the same.
      But I would like to write it to txt file.

      Comment


      • #4
        Originally posted by WM321 View Post
        Possibly edit the file_header.lbl on the report at each machine to have the machine name. At each machine make sure your report template uses that .lbl and that the template is named the same.
        This is what I have done. I have the PC-DMIS version and machine type displayed in the PC-DMIS image at the top left on the report. The only hassle is to replace the file_header.lbl on each update.
        PC-DMIS CAD++ 2o19 R1 SP4

        Comment


        • #5
          Originally posted by rlusina View Post
          Hello,

          I have a problem with exporting to txt file.

          At our company we just get a new machine so now we have three of them. On all of them we measure with same programs.
          So the problem is now we would like to include in txt file on which machine was it measured without typing it in a comment or something like that.
          It would have to work AUTOMATICALLY no matter where would I measure.

          Thanks for help.

          Best regards.
          How would you get the information regarding the machine type that is running it? Normally, one would need what machine produced which report.

          Pseudocode:
          Code:
          Get machine info
          Write to textfile
          How do you get the machine info?
          PC-DMIS CAD++ 2o19 R1 SP4

          Comment


          • #6
            Why not just have a text file (MACHINENAME.TXT) on each computer, containing the machine name. Every part program reads the name from this file and sends it to the report with COMMENT/REPT...
            AndersI
            SW support - Hexagon Metrology Nordic AB

            Comment


            • #7
              Originally posted by AndersI View Post
              Why not just have a text file (MACHINENAME.TXT) on each computer, containing the machine name. Every part program reads the name from this file and sends it to the report with COMMENT/REPT...
              For results I'm not using report from pc-dmis but I'm writing it to txt file.
              did that with MACHINENEME.TXT but I can only put it in COMMENT/REPT not in FILE/WRITE or an assignment.

              Comment


              • #8
                Originally posted by vpt.se View Post

                How would you get the information regarding the machine type that is running it? Normally, one would need what machine produced which report.

                Pseudocode:
                Code:
                Get machine info
                Write to textfile
                How do you get the machine info?
                For results I'm not using report from pc-dmis but I'm writing it to txt file.
                I have on each machine a TXT file with machine name. I can read it in pc-dmis but then I can't write it back to a txt.

                Comment


                • #9
                  Scriptcode for filewrite:
                  Code:
                   Open "C:\MyText.txt" For Append As #1
                    Write #1, MyString_With_CMM_Name
                    Close #1
                  There are commands such as FILEWRITE for writing to file directly from within the partprogram.
                  PC-DMIS CAD++ 2o19 R1 SP4

                  Comment


                  • #10
                    Originally posted by vpt.se View Post
                    Scriptcode for filewrite:
                    Code:
                     Open "C:\MyText.txt" For Append As #1
                    Write #1, MyString_With_CMM_Name
                    Close #1
                    There are commands such as FILEWRITE for writing to file directly from within the partprogram.
                    Code:
                    ASSIGN/MACHINE=""
                                ASSIGN/DAT="C:\PROGRAM FILES (X86)\WAI\TXT_DATA\MACHINE.TXT"
                    FILE1       =FILE/EXISTS,FILE
                                IF/DAT1
                    FPTR         =FILE/OPEN,DAT,READ
                    MACHINE1       =FILE/READLINE,FPTR,":"+{MACHINE}
                                  FILE/CLOSE,FPTR,KEEP
                                END_IF/
                                ELSE/
                                  COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                                  "No file"+FILE
                                END_ELSE/
                    L1         =LABEL/
                                COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                                Park over left hole
                    PNT1       =FEAT/POINT,CARTESIAN
                                THEO/<-311,-776.6,641.8>,<-0.9999942,0.0020117,-0.0027362>
                                ACTL/<-311,-776.6,641.8>,<-0.9999942,0.0020117,-0.0027362>
                                READPOINT/
                    A1           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                                    ALIGNMENT/TRANS,XAXIS,PNT1
                                    ALIGNMENT/TRANS,YAXIS,PNT1
                                    ALIGNMENT/TRANS,ZAXIS,PNT1
                                  ALIGNMENT/END
                    C_D          =COMMENT/INPUT,NO,FULL SCREEN=NO,
                                  'WORK ORDER!'
                    C_P          =COMMENT/INPUT,NO,FULL SCREEN=NO,
                                  'PROCEDURE!'
                    C_M          =COMMENT/INPUT,NO,FULL SCREEN=NO,
                                  'OPERATOR!'
                    BACK3        =LABEL/
                    C_R          =COMMENT/INPUT,NO,FULL SCREEN=NO,
                                  'Measurment reason:'              
                                  IF/C_R.INPUT<>"P" AND C_R.INPUT<>"O" AND C_R.INPUT<>"K" AND C_R.INPUT<>"M" AND C_R.INPUT<>"N" AND C_R.INPUT<>"D"
                                  GOTO/BACK3
                                END_IF/
                    C_O        =COMMENT/INPUT,YES,FULL SCREEN=NO,
                                'PEACE NUMBER'
                                MODE/DCC
                    PNT2       =FEAT/POINT,CARTESIAN
                                THEO/<1.074,6.705,1.017>,<-1,0,0>
                                ACTL/<715.593,556.288,-483.58>,<-1,0,0>
                                MEAS/POINT,1,WORKPLANE
                                  HIT/BASIC,NORMAL,<1.074,6.705,1.017>,<-1,0,0>,<715.593,556.288,-483.58>,USE THEO=YES
                                ENDMEAS/
                    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                                  ALIGNMENT/TRANS,XAXIS,PNT2
                                ALIGNMENT/END
                                MOVE/POINT,NORMAL,<-3.039,-0.070,0.150>
                    CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                                THEO/<0,-0.016,-0.003>,<-1,0,0>,5
                                ACTL/<0,-0.223,-0.248>,<-1,0,0>,5.024
                                TARG/<0,-0.016,-0.003>,<-1,0,0>
                                START ANG=0,END ANG=360
                                ANGLE VEC=<0,0,1>
                                DIRECTION=CCW
                                SHOW FEATURE PARAMETERS=YES
                                  VOID DETECTION=NO
                                  REMEASURE=NO
                                  SURFACE=THEO_THICKNESS,0
                                  MEASURE MODE=NOMINALS
                                  RMEAS=NONE,NONE,NONE
                                  AUTO WRIST=NO
                                  CIRCULAR MOVES=STRAIGHT
                                  GRAPHICAL ANALYSIS=NO
                                  FEATURE LOCATOR=NO,NO,""
                                SHOW CONTACT PARAMETERS=YES
                                  NUMHITS=4,DEPTH=1,PITCH=0
                                  SAMPLE METHOD=SAMPLE_HITS
                                  SAMPLE HITS=0,SPACER=0
                                  AVOIDANCE MOVE=BOTH,DISTANCE=3
                                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                                SHOW HITS=NO
                    CIR2       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                                THEO/<0,38.184,-0.003>,<-1,0,0>,5
                                ACTL/<0,37.986,-0.018>,<-1,0,0>,5.024
                                TARG/<0,38.184,-0.003>,<-1,0,0>
                                START ANG=0,END ANG=360
                                ANGLE VEC=<0,0,1>
                                DIRECTION=CCW
                                SHOW FEATURE PARAMETERS=YES
                                  VOID DETECTION=NO
                                  REMEASURE=NO
                                  SURFACE=THEO_THICKNESS,0
                                  MEASURE MODE=NOMINALS
                                  RMEAS=NONE,NONE,NONE
                                  AUTO WRIST=NO
                                  CIRCULAR MOVES=STRAIGHT
                                  GRAPHICAL ANALYSIS=NO
                                  FEATURE LOCATOR=NO,NO,""
                                SHOW CONTACT PARAMETERS=YES
                                  NUMHITS=4,DEPTH=1,PITCH=0
                                  SAMPLE METHOD=SAMPLE_HITS
                                  SAMPLE HITS=0,SPACER=0
                                  AVOIDANCE MOVE=BOTH,DISTANCE=3
                                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                                SHOW HITS=NO
                    A3         =ALIGNMENT/START,RECALL:A2,LIST=YES
                                  ALIGNMENT/ROTATE_CIRCLE,YPLUS,TO,CIR1,AND,CIR2,ABOUT,ZPLUS
                                  ALIGNMENT/TRANS,YAXIS,CIR1
                                  ALIGNMENT/TRANS,ZAXIS,CIR1
                                  ALIGNMENT/TRANS,XAXIS,PNT2
                                ALIGNMENT/END
                                PREHIT/1
                                RETRACT/1
                    PLN_A      =FEAT/PLANE,CARTESIAN,TRIANGLE,NO
                                THEO/<0,19.548,1.694>,<-1,0,0>
                                ACTL/<0.005,19.55,1.699>,<-0.9999985,-0.0008769,0.0014862>
                                CONSTR/PLANE,BF,PNT_A1,PNT_A2,PNT_A3,,
                                OUTLIER_REMOVAL/OFF,3
                                FILTER/OFF,WAVELENGTH=0
                    A4         =ALIGNMENT/START,RECALL:A3,LIST=YES
                                  ALIGNMENT/LEVEL,XMINUS,PLN_A
                                  ALIGNMENT/TRANS,XAXIS,PLN_A
                                  ALIGNMENT/ROTATE_CIRCLE,YPLUS,TO,CIR1,AND,CIR2,ABOUT,XMINUS
                                  ALIGNMENT/TRANS,YAXIS,CIR1
                                  ALIGNMENT/TRANS,ZAXIS,CIR1
                                ALIGNMENT/END
                    SLTR_C     =FEAT/CONTACT/ROUND SLOT/DEFAULT,CARTESIAN,IN
                                THEO/<0,1.596,14>,<-1,0,0>,<0,1,-0.0000023>,2.55,2.969
                                ACTL/<0,1.599,14.012>,<-1,0,0>,<0,0.9999878,0.0049386>,2.576,3.015
                                TARG/<0,1.596,14>,<-1,0,0>,<0,1,-0.0000023>
                                MEAS ANGLE=130
                                SHOW FEATURE PARAMETERS=YES
                                  VOID DETECTION=NO
                                  REMEASURE=NO
                                  SURFACE=THICKNESS_NONE,0
                                  MEASURE MODE=NOMINALS
                                  RMEAS=NONE,NONE,NONE
                                  AUTO WRIST=NO
                                  GRAPHICAL ANALYSIS=NO
                                  FEATURE LOCATOR=NO,NO,""
                                SHOW CONTACT PARAMETERS=YES
                                  NUMHITS=8,DEPTH=1
                                  SAMPLE METHOD=SAMPLE_HITS
                                  SAMPLE HITS=0,SPACER=0.8
                                  AVOIDANCE MOVE=BOTH,DISTANCE=3
                                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                                SHOW HITS=NO
                    CIR_B      =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                                THEO/<0,36.6,14>,<-1,0,0>,2.55
                                ACTL/<0,36.613,13.99>,<-1,0,0>,2.575
                                TARG/<0,36.6,14>,<-1,0,0>
                                START ANG=0,END ANG=360
                                ANGLE VEC=<0,0.0000023,1>
                                DIRECTION=CCW
                                SHOW FEATURE PARAMETERS=YES
                                  VOID DETECTION=NO
                                  REMEASURE=NO
                                  SURFACE=THEO_THICKNESS,0
                                  MEASURE MODE=NOMINALS
                                  RMEAS=NONE,NONE,NONE
                                  AUTO WRIST=NO
                                  CIRCULAR MOVES=STRAIGHT
                                  GRAPHICAL ANALYSIS=NO
                                  FEATURE LOCATOR=NO,NO,""
                                SHOW CONTACT PARAMETERS=YES
                                  NUMHITS=5,DEPTH=1,PITCH=0
                                  SAMPLE METHOD=SAMPLE_HITS
                                  SAMPLE HITS=0,SPACER=0
                                  AVOIDANCE MOVE=BOTH,DISTANCE=3
                                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                                SHOW HITS=NO
                                MOVE/POINT,NORMAL,<-2.000,-0.000,0.000>
                    A_A        =ALIGNMENT/START,RECALL:A4,LIST=YES
                                  ALIGNMENT/LEVEL,ZPLUS,PLN_A
                                  ALIGNMENT/ROTATE_CIRCLE,XPLUS,TO,CIR_B,AND,SLTR_C,ABOUT,ZPLUS
                                  ALIGNMENT/TRANS,ZAXIS,PLN_A
                                  ALIGNMENT/TRANS,XAXIS,CIR_B
                                  ALIGNMENT/TRANS,YAXIS,CIR_B
                                ALIGNMENT/END
                    PLN_C      =FEAT/PLANE,CARTESIAN,TRIANGLE,NO
                                THEO/<17.249,-8.769,0>,<0,0,1>
                                ACTL/<17.227,-8.886,0.01>,<-0.0003401,-0.0006823,0.9999997>
                                CONSTR/PLANE,BF,PNT_C2,PNT_C6,PNT_C1,PNT_C3,PNT_C5,PNT_C4,,
                                OUTLIER_REMOVAL/OFF,3
                                FILTER/OFF,WAVELENGTH=0
                    DIM FLAT1= FLATNESS OF PLANE PLN_C  UNITS=MM ,$
                    GRAPH=OFF  TEXT=OFF  MULT=10.00  ARROWDENSITY=100  OUTPUT=BOTH
                    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                    M        0.000      0.100      0.000      0.009      0.009      0.000 #--------
                    
                                DATDEF/FEATURE=PLN_A,A
                                DATDEF/FEATURE=CIR_B,B
                                DATDEF/FEATURE=SLTR_C,C
                                COMMENT/REPT,
                                CIRCLE MIDLE LEFT
                    FCFLOC_DD1 =POSITION : CIR5
                                FEATCTRLFRAME/SHOWNOMS=NO,SHOWPARAMS=YES,SHOWEXPANDED=YES
                                CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
                                COMPOSITE=NO,FIT TO DATUMS=YES,DEV PERPEN CENTERLINE=ON,OUTPUT ALIGNMENT=Current Alignment
                                CUSTOMIZED DRF=NO
                                STANDARDTYPE=ISO_1101
                                  SIZE TOLERANCES/1,DIAMETER,4.5,0.1,-0.1
                                  PRIMARY DIMENSION/POSITION,DIAMETER,0.4,MMC,A,B,<MC>,C,<MC>
                                  SECONDARY DIMENSION/<Dim>,<tol>,<MC>,<dat>,<dat>,<dat>
                                  NOTE/FCFLOC_DD1
                                FEATURES/CIR5,,
                                COMMENT/REPT,
                                CIRCLE MIDLE RIGHT
                                COMMENT/REPT,
                                .
                                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    
                                ASSIGN/TIME=SYSTEMDATE("dd.MM.yy")+";"+SYSTEMTIME("hh:mm")
                                ASSIGN/V_1=C_D.INPUT+";"+C_P.INPUT+";"+1+";"+C_O.INPUT+";"+C_M.INPUT+";"+FLAT1.MEAS++";"+FCFLOC_DD1.DF.MEAS+";"+FCFLOC_DD1.TP.MEAS+";"+TIME
                    FPTR       =FILE/OPEN,C:\TEST.TXT,APPEND
                                FILE/WRITE_BLOCK,FPTR,
                                FILE/WRITELINE,FPTR,V1
                                FILE/CLOSE,FPTR,KEEP
                                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                    This is my program. In the midle are missing points for PLN_A becouse of too much characthers.
                    And now I would like to put the name of the machine which in writen under MACHINE into ASSIGN/V_1 so I could write it in txt.

                    Comment


                    • vpt.se
                      vpt.se commented
                      Editing a comment
                      Isn't it just enough to add +MACHINE1 to the string V_1?

                    • rlusina
                      rlusina commented
                      Editing a comment
                      No it is not enough. It returns as 0.

                    • Spikalus
                      Spikalus commented
                      Editing a comment
                      A couple things:

                      1. You check if the file exists and assign a boolean (True/False) value to the variable FILE1 but then check the variable DAT1 in you subsequent IF/ELSE statement.

                      2. When you use FILE/READLINE the value that you are reading in is assigned to the variable in the curly brackets {}. In your example the machine ID is being assigned to the variable MACHINE. MACHINE1 is assigned a boolean value that corresponds to whether or not the FILE/READLINE command succeeded or not, which is why you are getting a value of 0.

                  Related Topics

                  Collapse

                  Working...
                  X