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:

How do you parse NCI line using opinfo?


Recommended Posts

A NCI file has the following lines:

1031
0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
1032
3000 0 0 0 0 0 0 0 0 0

These are transform operation's custom parameters, where 3000 is the value of trans_mi1$ (or actually in case of nested transform, it is not, thus my attempt at opinfo)

The following code outputs the following string Test:3000 0 0 0 0 0 0 0 0 0

stest         : ""

pheader$         #Call before start of file
      stest = opinfo(1032, 0)
      "Test:", *stest, e$

However, I don't know how to capture the "3000" part of the NCI line; if I change the code to

test         : 0

pheader$         #Call before start of file
      test = opinfo(1032, 0)
      "Test:", *test, e$

the result is always 0 or -99999, no matter what I enter into the second and third parameter.

How Do I Use Opinfo Correctly?

Link to comment
Share on other sites

Just so you are aware, this is not an ideal use for opinfo.  When you tell opinfo to query an NCI line it searches the NCI file that’s on disc.

I’m almost positive you can get the value you are looking from a traditional parameter in memory, have you done a parameter dump?

Using opinfo on an NCI line should only be done if the data isn’t available in memory.

Link to comment
Share on other sites
15 minutes ago, Zaffin_D said:

Just so you are aware, this is not an ideal use for opinfo.  When you tell opinfo to query an NCI line it searches the NCI file that’s on disc.

I’m almost positive you can get the value you are looking from a traditional parameter in memory, have you done a parameter dump?

Using opinfo on an NCI line should only be done if the data isn’t available in memory.

Hi,

This hack is due to this problem

Program numbers are not written at all to NCI for transform operations, so I have to use a transform operations's misc integer. Furthermore, trans_mi$ does not contain the "latest" mi-value in case of nested operation. If you know a better way, I am all ears 🙃

Link to comment
Share on other sites
31 minutes ago, SlaveCam said:

Hi,

This hack is due to this problem

Program numbers are not written at all to NCI for transform operations, so I have to use a transform operations's misc integer. Furthermore, trans_mi$ does not contain the "latest" mi-value in case of nested operation. If you know a better way, I am all ears 🙃

Are you sure the values aren't written to the NCI? There is a switch inside the Control Definition, that controls which parameters; Original Op or Transform or Both, that actually get written. Is that switch set to "Transform" or "Both"?

I'm honestly not sure either way, but I do know that switch exists in the CD.

  • Like 1
Link to comment
Share on other sites
1 hour ago, Colin Gilchrist said:

Are you sure the values aren't written to the NCI? There is a switch inside the Control Definition, that controls which parameters; Original Op or Transform or Both, that actually get written. Is that switch set to "Transform" or "Both"?

I'm honestly not sure either way, but I do know that switch exists in the CD.

No, I'm not sure. Didn't even think about the existence of such a switch. I'm going to check it out tomorrow, thank you for this tip!

Link to comment
Share on other sites

Check on the "Files" page. This actual "Parameter Setting" (Radio Button) would be a zero-based index. Meaning "Option 1 = 0", Option 2 = 1, and Option 3 = 2.

I think you either want "Option 1" (Parameter output as "0", for the 1st option in the list), or "Option 3" (Both) [Option 3 would output as "2" for this parameter, being the 3rd item in the list.]

Technically, you won't be querying the value of the Radio Button. All you really care about is "are my Transform Operation Misc Values being written to the NCI File"?

Transform Source Parameter Settings - CD.PNG

Link to comment
Share on other sites

I did some testing and it seems no matter what's selected in the abovementioned setting, the program number of a transform operation that uses another transform operation as source does not have its program number written to NCI. So in this case program number seems to be kind of a special case.

In 4 axis work it's common that I use the same source operations for different tombstones and the fixture positions may wary as well, so there is no avoiding nested transforms, unless you love useless extra repetitive work. G54.2 would be a huge help, so maybe I'll get it one day.

Link to comment
Share on other sites
  • 1 year later...

sorry to bump an old thread.

 

were you ever able to find success with this? I am having some trouble with it myself. I have some nested transforms I am working with and I need the value of trans_mi1$ from the top most transform operation. unfortunately it seems as though the value of trans__mi1$ from the nested transform is being used. I tried experimenting with the settings in the control definition from Colin's post above and got the same result regardless of the setting in the control def.

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...