Write measurement data to csv file

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

  • Write measurement data to csv file

    We want to write a subroutine which can write all our data to a csv file.
    We did this with 'ascii_file.exe' and got the results needed, but we want some more variables (V1, V2, V3, V4 and V5) inserted in the data.
    We receive the data like seen in the photo now.


    1.png

    Code:
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                MODE/MANUAL
                PREHIT/3
                WORKPLANE/ZPLUS
                RETRACT/3
                CHECK/5,1
                MOVESPEED/ 300
                FLY/ON,3
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS,SD;NOM,MEAS,TOL,DEV,OUTTOL, ,
                LOADPROBE/T4BY50
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                WORKPLANE/ZPLUS
                SUBROUTINE/STATISTIEK,
                    OPERATOR = "" : ,
                    MEETMACHINE = "" : ,
                    TYPE_METING = "" : ,
                    BEWERKINGSMACHINE = "" : ,
                    OPMERKING = "" : ,
                    MALPOSITIE = "" : ,
                    PARTNAME = "" : ,
                     =
                ASSIGN/MALPOSITIE=MALPOSITIE
                ASSIGN/OPERATOR=OPERATOR
                ASSIGN/MEETMACHINE=MEETMACHINE
                ASSIGN/BEWERKINGSMACHINE=BEWERKINGSMACHINE
                ASSIGN/TYPE_METING=TYPE_METING
                ASSIGN/OPMERKING=OPMERKING
                ASSIGN/PARTNAME=PARTNAME
                ASSIGN/VRALL_COMPLEET=MALPOSITIE+";"+BEWERKINGSMACHINE+";"+MEETMACHINE+";"+TYPE_METING+";"+OPMERKING
                ASSIGN/FILEPATH="K:\\"+PARTNAME+".CSV"
    VEXIST     =FILE/EXISTS,FILEPATH
                IF/VEXIST==0
                EXTERNALCOMMAND/NO_DISPLAY, WAIT ; K:\ASCII_FILE.EXE
    FPTR       =FILE/OPEN,FILEPATH,READ
    V1         =FILE/READLINE,FPTR,
    FPTR       =FILE/OPEN,FILEPATH,APPEND
                ASSIGN/V2="MALPOSITIE;BEWERKINGSMACHINE;MEETMACHINE;TYPE METING;OPMERKING;"
                FILE/WRITELINE,FPTR,V2
                FILE/WRITELINE,FPTR,VRALL_COMPLEET + ";"
                FILE/CLOSE,FPTR,KEEP
                END_IF/
                IF/VEXIST==1
    FPTR       =FILE/OPEN,FILEPATH,APPEND
                FILE/WRITE_BLOCK,FPTR,VRALL_COMPLEET + ";"
                EXTERNALCOMMAND/NO_DISPLAY, NO_WAIT ; K:\ASCII_FILE.EXE
                FILE/CLOSE,FPTR,KEEP
                END_IF/


    What we want is the result in the next picture:

    2.png

    When we run the above code with the tweaked csv file, everything runs OK, but we want to let it run OK for the first time.
    This because we got many PC-DMIS programs (like 1800-2000) and insert this in a subroutine which is already available in all programs.
    When the adjusted subroutine runs for the first time, it has to make the file first.
    The 'ascii_file.exe' is making the document and filling it: the first line in the first picture as well as the first results (second line) in the first picture.

    Can anyone help us with this?

  • #2
    There is no ascii_file.exe on my computer, even though I have seven versions of PC-DMIS installed. Where did you get that program?

    Which version of PC-DMIS? 2019 has the new Excel Form Report, which might solve your problem.
    AndersI
    SW support - Hexagon Metrology Nordic AB

    Comment


    • #3
      Sorry, you are right. This is not a standard program and downloaded it online (http://www.bach-messtechnik.com/tooldownloads.htm).
      We are using PC-DMIS 2013 MR1. This version has also a export to CSV/Excel but it takes some time (we got programs with 6000+ lines) and the pc's hooked up to the measuring machines (we got 4 machines) don't have microsoft office. For saving in that format, we need the office version on these pc's.

      When using the ascii program, it writes in .txt format and thus no office is needed.

      Comment


      • AndersI
        AndersI commented
        Editing a comment
        Well, then you might get a better answer asking there. Unless someone else here have experience of that program.

        A modern PC-DMIS can do it by itself (no Office needed).

    • #4
      We also got PC-DMIS 2018 R2 on one machine. Mayby it works on the modern way there?
      Can you help me with the setup?

      Comment


      • AndersI
        AndersI commented
        Editing a comment
        Excel Form Report comes with 2019...

    Related Topics

    Collapse

    Working...
    X