cancel
Showing results for 
Search instead for 
Did you mean: 

Output Notes in NC program

Valued Contributor
Valued Contributor

Hello there,

 

I am working on outputting notes in an NC program through postprocessor. I have read the following post in this forum:

 

https://community.plm.automation.siemens.com/t5/Discussion-Forum-NX/NX10-Incorporating-quot-Notes-qu...

 

and used the following code:

 

global mom_sys_control_in mom_sys_control_out
global mom_operation_notes

set ci $mom_sys_control_in
set co $mom_sys_control_out


if { [info exists mom_operation_notes] && [array exists mom_operation_notes] } {
	
	foreach i [lsort -integer [array names mom_operation_notes]] {
		if {[string length $mom_operation_notes($i)]} {
			
				MOM_output_literal "$co$mom_operation_notes($i)$ci"
			
		}
		
	}
	
	array unset mom_operation_notes
	
}

 

It worked fine for most of the postprocessors, but now I have run into a problem for one postprocessor.

 

Capture.PNG

 

In the above two programs, only operation ENG_LEFT_014 has note. I first postprocessed program 014_OP2. It worked fine. Then when I used the same processor to postprocess program 114_OP2, it output the notes of operation ENG_LEFT_014 under the operation ENG_LEFT_114, but worked fine for operation ENG_RIGHT_114.

 

Any ideas?

 

Thanks,

Kai

16 REPLIES

Re: Output Notes in NC program

Esteemed Contributor
Esteemed Contributor

Hard to tell from your description, I *think* you have things correct, but without the parts & post its hard to tell.

What I'd check...

1) I'd make absolutely sure the notes are assigned to the operations (not groups, not parent groups)

2) After outputting the notes, I'd make sure to "unset" the variables.  Remember NX does NOT 'clean up" after itself - once variables are set, they tend to remain set.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thanks, Ken.

 

1. Can you please tell me how I can know whether the notes are assigned to the operations or groups? I created a proc called PB_CMD_path_notes with the code I posted, and then call this proc in start_of_path.

 

2. I unset the array. It works fine with other postprocessors, but just doesn't work for this one. How to "unset" a variable?

 

Thanks,

Kai

Re: Output Notes in NC program


Kai_Xue wrote: 

1. Can you please tell me how I can know whether the notes are assigned to the operations or groups? I created a proc called PB_CMD_path_notes with the code I posted, and then call this proc in start_of_path.

 

 


Notes are only on operations. You can see them if you turn on the Notes column in the Operation Navigator. 

 

BTW, this version of the code is a little cleaner - it uses OPERATOR_MSG:

 

#=============================================================
proc PB_CMD_output_operation_notes { } {
#=============================================================
#
#  Output operation notes one line at a time.
#  Add this to the Start of Path event. 
#
   global mom_operation_notes

  # If notes are defined, output each line of text from the array.
   if { [info exists mom_operation_notes] && [array exists mom_operation_notes] } {

      OPERATOR_MSG "------------------- Operation Notes ----------------------"
      foreach i [lsort -integer [array names mom_operation_notes]] {
         if [info exists mom_operation_notes($i)] {
         OPERATOR_MSG "$mom_operation_notes($i)"
         }
      }
		OPERATOR_MSG "----------------------------------------------------------"

     # Clear for next operation
      array unset mom_operation_notes
   }
}
Mark Rief
Retired Siemens

Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thanks, Mark.

 

I have tried your version of code. It works fine with other processors, but has the problem described above with one. Also, when I post processed the following program, although there is only note in the second operation, it outputs the note for both operations. Really don't know why.

 

Program.PNG

 

Thanks,

Kai

Re: Output Notes in NC program

Esteemed Contributor
Esteemed Contributor

Kai -

Can you copy your CAM part, delete everything except those 2 operations.

- check to make sure you are still getting the problem

The swap in a block or 2 for the geometry, delete the original components, etc.

- check to make sure you are still getting the problem

Do anything else required to remove propritary info (rese feeds/speeds/tolerances/attributes/etc.)

- check to make sure you are still getting the problem

 

And post the part here?

You might need to let us (or GTAC) have the post as well.

 

Just had another thought...

Does your post use MOM_post_oper_path or MOM_do_template_file ?

Could be these are setting variables for you.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thanks, Ken. My post uses MOM_do_template_file.

 

Kai

Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Hi there,

 

I found the problem only exists in the first operation of the program.

 

Take the following case as an example:

 

Notes.PNG

 

Four operations. Only the third one has notes, but output notes in both the first and the third operations.

 

I turned on the review tool when posting,

 

Debug.PNG

 

As can be seen, Process "MOM_start_of_path 57" belongs to operation DRLLING_2. I found the variable of notes exists in two processes. One is "MOM_start_of_path 57", the other is "MOM_OPER_BODY 13". When I clicked on MOM_OPER_BODY 13, the line on the third column of the review tool jumped to the front of the first operation.

 

Debu2.PNG

 

In my other posts, there are no MOM_OPER_BODY. I searched for it in the .tcl file, and only found an empty procedure 

proc MOM_OPER_BODY  {} {}

Any ideas?

 

Thanks,

Kai

Re: Output Notes in NC program

Phenom
Phenom

MOM_oper_body event is issued when MOM_cycle_objects is commanded and an operation is encountered in the query it commands. One post must have a MOM_cycle_objects in it and the other must not.

NX10.03
Windows 7 Pro

Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thanks, Study.

 

I searched for MOM_cycle_objects in the .tcl file, but didn't find it. I have seen MOM_cycle_objects in a .tpl file of shop doc before.

 

Kai 

Learn online





Solution Information