Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Update NCI


Dolan
 Share

Recommended Posts

The Chook that Im writing requires me to parse the current NCI(ASCII). How can I make sure the current operations are written to that file? If its a new part, that hasn't been saved yet, I'd want it written to T.NCI (with no prompt to overwrite). That seems to be MCs default scratchpad. For instance, if I wanted a "one off quickie". I wouldn't want to save the MC7 file, but I would need the NCI. The only func Ive found that seems remotely close is:

void write_prm_to_nci (void);

Is this writing to the binary NCI? I rather not got the binary route. Im guessing its quite cold, damp & dark in there smile.gif

Also, how can I check the db to see if there are actually any operations to output to the NCI?

All I really need is a current NCI to parse, to proceed. NC utils|Edit NCI is doing basically what Im looking for, as far as updating the NCI.

 

Link to comment
Share on other sites

To post all operations to your current post settings us the

nci_bin n;

boolean ok;

long fpos;

nci_manager (0, NCIMGR_POST_ALL, &n, &fpos, &ok)

 

Also, the 1016 line contains the operation id # which can be used to check against the operation list. To see if all operations have been posted, make a list of operation id #'s from the operation list:

ulong *op_ids = NULL, n_op_ids = 0;

op_list *opl = op_list_ptr;

while (opl != NULL)

{

++n_op_ids;

op_ids = (ulong *) REALLOC (op_ids, n_op_ids * sizeof (ulong));

if (op_ids == NULL) break;

op_ids[n_op_ids - 1] = opl->op.op_idn;

opl = opl->next_ptr;

}

Then compare the operation id # from the 1016 line to your op_ids and look for a match. If any of your op id #'s from the 1016 line aren't found in your op_ids list, then it has not been posted.

Don't forget to free up the op_ids with a

FREE (op_ids);

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...