1) Per others (I haven't tested this) the variable may not exist (or be set correctly) until the CUTCOM ON event
2) Guessing, if operation "A" uses it, the variable does NOT get deleted at the end of operation "A", so the next operation (operation "B") WILL see the *previous* operation's value. You might need to unset the variable to clear it at "end of path" event
3) If assigned to the TOOL, the value MAY exist at "start of path" - probably as mom_tool_*. But this will NOT reflect whether diameter comp is actually used (or not) in the toolpath (and may be over-ridden in the operation, or with a Cutcom ON UDE)
I believe, if you HAVE to have this in the operation header, the only reliable way to do this is to do multiple processing of the posted output. There are a couple ways to do this:
A) write a "flag string" where you want the output (e.g. "PUT CDC VALUE HERE") in the posted code. If you get to a cutcom on event, save the data in an array ("my_cutcom_data($mom_operation_name)") indexed on the operation name. After posting is done, close the output file, then (using normal tcl commands) open the output file, read thru, writing to a new file. Anywhere you see the "flag string", figure out the operation name & write the desired output. When done, close both files and delete the un-edited one.
B) create a 2nd (really small) post that only outputs operation name & CDC status. Then use MOM_run_postprocess to run that in "start of program" event. When it returns to the main post, parse the specified output file to get operation name & CDC status for that operation (store in global variables). Now, as each oper is encountered, output the correct data in the header.
There's probably some other options, but those are what I would try
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
using the advice of debugging and changing the register to 777 was able to find the correct variable >Tried the if info exists and setting the CDC as the out put literal keep encountering errors .