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.
Parents
  • 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.
Reply Children
No Data