Re: Using Variables
hy joe, indeed, like you said, using 'Step_Over ' instead of #105, improves a lot the code readability, making it easier to understand by others, or even by the one that developed it ( especially if he wishes to upgrade the code one year later after the moment of the initial release ) ... in most cases, is easier to re-write a macro, than trying to understand the "mess" created by someone else, who is nowehere to be found
on okuma cnc's:
... to achieve code readability, i use :
...... variables writen with 4 alpha-numerics ( TOOL, DIA, STEP, DONE )
...... procedure names writen with 16 alpha-numerics ( CALL OROUGHING, CALL OMEASURING, etc )
...... code identation
...... comments, foot notes
...... each soubroutine has input variables, and internal variables; i always group the input variables at the beging of the program
... to protect the code from being accidently altered, i may :
...... keep the file at a specific path ( <> path where the current program is stored ), and disabling it's content from being edited/seen during program execution
...... create an one-way mirror on the machine, thus always having the code compared with another one, in a location that can not be accesed by the operator
... to debug the code :
...... i may use a table that shows the values of all variables that i use
...... i may record the variables to a file, then inspect that file in excel, or wherever else
...... i may inspect the toolpath inside different animation modes / angles, etc
... to speed up machine operating :
...... i may use certain codes, that does not allow the program to be stopped in step-by-step mode, inside a macro
...... i may use internal timers, to optimize the code execution time, looking for minimal downtime, and consistent execution time, up to a time unit of 1ms ( or even less )
..... i may use the macro to generate simple g-code, then have the machine to auto-select & execute that file
* and many many other tricks
all these is done inside the g-code file (except the mirror), thus the control itself is very capable ( for example, i can generate a fanuc/siemens/heidenhain macro, from the okuma g-code, if i really wish, using file associated instructions; i can generate the code shared by old-phart, thus being sure that it works, before writing it to the file )
i am, however, trying to boost all these even more, but i don't know exactly what should i do; i have joined this conversation, because i believed that old_phart was looking for a way to create a custom "logic" inside a cam, thus i was looking for alternative programing methods; also, seing how others are doing it, it helps a lot / kindly
ps : i received some nice stuff when i googled "pearling"
Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg