Hi all,
I'm manufacturing furniture, and for machining it i'm using multiple setup for each pieces.
I'm regrouping those setups in one NCprogram with custom "optional stop" at the end of each setup to have the time to change the stock.
I would like to write in the Gcode a comment on each "first section" of those setups to identify them easily
I'm not qualified in any ways for post modification but i managed to do that based on information I found in the post and on this forum.
var part = getGlobalParameter("job-description");
if (part) {
writeComment (" "+(part.toUpperCase())+(" "));
writeln("");
it works but for each "section" (or toolpath if you want) and even if the section is from a different setup it keep the initial setup name across all the sections of those multiple setups.
could someone check that ? where do I need to put thoses lines in the post and how to get this comment prompt on each first section of those differents setup regrouped in one file ?
thanks a lot
You can simply identify the new setup by comparing the wcs codes and print the comment only when there is a change in wcs codes. the code will something look like as shown below
var part = getGlobalParameter("job-description");
if (part && newWorkOffset) {
writeComment(" " + (part.toUpperCase()) + (" "));
}
@boopathi.sivakumar thank for taking the time.
I tried what you gave to me but the problem is that by doing that it keeps refering to the ever first setup of the NCprogram. (I have multiple setup in one NCprogram)
I also saw that dump post was outputting the "setupname" information only for the first toolpath of this setup.
For better explaination, The setups that I'm using for testing contains 2 toolpath each.
with this "code" (don't know how to call it),
var part = getParameter("job-description")
writeComment(" " + (part) + (" "));
I'm able to show in the gcode the "setupname" for every toolpath but there is a problem. As mentioned above dump.cps tells only for the first toolpath the "setupname" so ...
setup 1
first toolpath (section) is obviously ok
second toolpath (section) is ok "(part)" did not changed
setup 2
third toolpath (section) is ok "(part)" has changed
fourth toolpath (section) PROBLEM, "(part)" is refering the very first setup
as mentioned earlier I don't know what I'm doing, just trying to understand things
Can't find what you're looking for? Ask the community or share your knowledge.