hexagon logo

How do you keep ur programs neat and tidy?

Hey all
Maybe this thread belongs in "tips and tricks", but ill have a shot at it here.

As i mentioned in the title, how do you keeps ur programs neat and tidy so other CMM programmers can go into the programs and adjust e.t.c?

Do you use groups? Do you do $$ comments explaining stuff?
Do you sort out the code for alignment, measurment routine and evaluation etc?

Do you have a system for how you name the elements?

Me i try to group the Manual alignment, CNC-alignment, measurment code and evaluation.
I also try to name the elements after the drawing, such at Ø15±0.2 etc

How do you guys keep the programs clean?
Post some pictures of code if you'd like.
All answers are welcome.
  • This is common. Lots of people do it but it's never recommended.

    the reason being is that since PC-DMIS is capable of performing math functions you risk PC-DMIS trying to solve some math problem that doesn't actually exist. People have reported having spaces or characters in their names has caused some weird stuff. Though, never documented (to my knowledge) it's generally understood. At least, it should be.
  • Header Group:
    1. Comment with create data
    2. Sub Call: If running offline true, create .txt file with information passed from main routine
    3. Sub Call: read .txt file, either flowed down from PLC or created on step#2 if offline
    4. Sub Call: parse string from .txt into 8 variables used throughout routine.
    5. variables for date time
    6. Sub Call: create report header out of report comments from passed down info in .txt file
    7. CMM report formatting
    8. Sub Call: generic speeds and motions (if needed they can be edited In a single place and would affect all routines)
    9. mode switch DCC/MANUAL
    10. loadprobe and tip
    11. external alignment call
    12. Sub Call: script to write part name, rev number, ser number up on top from various variables and parsing file name (needed for DP stuff)
    13. Sub Call: turn on stats

    Part Routine (first op):
    1. super rough alignment
    2. rough alignment
    3. faster speeds and feeds
    4. fine alignment
    5. all of geometry
    6. all constructions
    7. all alignments
    8. Sub Call: export feature info to text file
    9. all dimensions with alignment recalls as needed

    Part Routine (second op):
    1. super rough alignment
    2. rough alignment
    3. faster speeds and feeds
    4. fine alignment
    5. all of geometry
    6. all constructions
    7. all alignments
    8. Sub Call: import features, create generic features in sub routine from text file info, consume txt file, reference features in main routine with SUBCALL:FEATURENAME eg "CS1:CIR1"
    9. all dimensions with alignment recalls as needed

    Tail Group:
    1. Sub Call: stats transfer for DP
    2. Sub Call: pull last load probe command and save to .txt
    3. Sub Call: call part program (txt file from step#2 consumed)
    4. Sub Call: create folders, 3 directories, 2 if network is down
    - Output, 3 letter acronym from part#, 10 letter part#, WO#, OP 1/2
    - If network is down create same folders locally to later transfer to network once it's up again
    5. Sub Call: add NG if part is out of tolerance
    6. Sub Call: if re-run append a instance number "_n" to file name, re-run an infinite number of times
    7. Sub Call: print report
    8.Sub Call: copy report to 2 more locations (if network is up)
    9. Sub Call: trigger CSV data generator executable

    This has sped up revision rolls, and/or editing. Requires disciplined folks though. One lazy programmer (in a non beneficial developer way) ruins it all and it's back to spaghetti code!!!!

    Can't say I'm the father of this as it's mostly copied over from other styles used in various developer roles that I've had the opportunity to venture in. Like PLC structured text, Fanuc robotics, SQL, VB.NET, VBA, VB SCRIPT, C#, C , C++, LUA, PC-DMIS, etc...

    Want to learn? check out the gran master jedi here: https://www.pcdmisforum.com/forum/pc-dmis-enterprise-metrology-software/pc-dmis-code-samples/22927-pcdmis-automation-with-visual-csharp-2010-express had the opportunity to listen to his story over a phone conversation, wow what a heck of a developer!!!

    here's another nice one to pay attention to structure: https://www.youtube.com/channel/UCAM...deHAsmG50wqL1g

    Nice place to document what a 'normal' part routine looks like If I ever lose all information on how/what is in my template.
    I will use this data stored on 'cloud' to re-generate.

    Most if not all parts we manufacture in the process I'm involved in gets made in 3 operations 2 of them are inspected on the CMM.
  • Nothing to fancy but most of the generic stuff is there and ready to change as needed

    PART NAME :
    REV NUMBER :
    SER NUMBER :
    STATS COUNT : 1

    STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
    ALIGNMENT/END
    STATS/ON,DATAPAGE,$
    DIRECTORY=,$
    READ=0,WRITE=0,MEMPAGES=0,FEATURE NAME,CONTROLCALC ON,$
    STATS/END
    FORMAT/TEXT,OPTIONS,ID,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
    $$ NO,
    .
    .
    PROGRAMER :CHAD O
    .
    PROVEOUT DATE :
    PROVEOUT SIGNOFF :
    .
    .
    PROGRAM NOTES / REVISIONS :
    .
    .
    C1 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    'MO #'
    C2 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    'EMPLOYEE #'
    C3 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    'WORK CENTER #'
    C4 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    'WORK OFFSET #'
    C5 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    'JOB STATUS'
    C6 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    'INSPECTION GAGE #'
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; MO # : C1.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; EMPLOYEE # : C2.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; WORK CENTER # : C3.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; OFFSET # : C4.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; JOB STATUS : C5.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; INSPECTION GAGE # : C6.INPUT
    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    .
    .
    .
    .
    NEW PROGRAM !!!
    .
    .
    MIT ONLY !!
    .
    .
    .
    .
    MODE/MANUAL
    WORKPLANE/ZPLUS
    MOVESPEED/ 100
    LOADPROBE/GLOBAL_PROBE9
    TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
    TOUCHSPEED/ 5
    FASTPROBEMODE/ON
    PREHIT/0.2
    RETRACT/0.2
    CHECK/0.1,1
    FLY/ON
    DISPLAYPRECISION/6
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    .
    .
    .
    START PROGRAM HERE !!
    .
    .
    .
    MODE/DCC
    CLEARP/ZPLUS,16,ZPLUS,16,ON
    MOVE/CLEARPLANE
    STATS/TRANSFER,DIRECTORY=C:\SPCDATA
    ROUTINE/END
  • Nice!
    That pcdmis link just takes me to the front page btw.
    and also, Whats a sub call? and why do you measure part in two operations?
  • There is nothing 'neat and tidy' about sheet metal w/ fixture programs. All the moves & tips changes to get in and around all the clamps and swing gates and hand-apply templates. But, I do what I can.
  • hi yeah thats a nice template to begin with.
    can i ask what
    CHECK/0.1,1 means?
  • How far "passed" the probe will drive trying to to take a point before it errors out
  • I think I know how I could do it, but I don't do it !!!!
    My planes are PLi, my circles CEi and my alignments REFi, my assignments Vi...
    It's totally unreadable for my co-worker...Disappointed

    I believe that I gave here a part of what you have to not to do !!!
  • earlier i was using naming like 'PNT_0.25_1', and what happens when you use this kind of naming is PCDMIS makes the feature unusable randomly.
    instead if i use PNT025_1 it works smoothly
  • can you guys guide through the steps to change the colours?