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:

Anyone Setup a NC Configuration for Code Expert?


Chaotic5555
 Share

Recommended Posts

We recently got in new post for the Swiss machines we have at the shop so I've finally been able to help the Swiss department out with some code.  

 

I'd like to setup the Code Expert to be able to run Multi-Streams and even utilize the Align Sync tool within it.  Does anyone have any experience doing this? I've been having a really hard time understanding the format that it uses as search conditions and I was just wondering if there was a guide somewhere.  I would prefer to not export my code in two seperate files and keep it contained to one, just to be able to view it as two. 

Each swiss code uses the header $1 or $2 and the ending code for both is M99. 

The sync codes used are $1L# or $2L# where # is the corresponding number that links the two commands.  

 

Anyone have any suggestions as to how to input this into the NC Configuration in Code Expert? I've attached a picture with what I attempted but when splitting into the Multi-Stream nothing happens and it all stays under one block.  

Code Expert Help.png

Link to comment
Share on other sites
11 minutes ago, crazy^millman said:

I think you have to open it through the Multi Stream view to see them in 2 or more streams. Just standard opening will not display the code in the streams. Have you tried that process through the home ribbon in code expert?

Yes, when opening through the Multi-Stream under my current configuration there is no manipulation done to the code.  The picture I posted is my NC Configuration in order to split the program into those separate streams.  Sorry I may have worded it poorly in my original post

Link to comment
Share on other sites

What are your Sync Point settings? How does the Swiss handle the Wait codes between the Sync Points? On a machine with more than channels you have to SYNC correctly between those streams. You only have 2 streams so it should be pretty straight forward process of syncing. That also plays into the Display Process. Are they separate programs or are the channels handled inside of one program? One a Nakamura Triple turret I have to highlight all 3 separate programs through the MultiStream windows to have it open all 3 and show the SYNC process correctly.

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

A $ in a regular expression asserts the end of a line, so that’s not going to work.  Escape the $ with a \.

I highly suggest you use a site like regex101.com to help you if you are new to regular expressions.

This is exactly what I was looking for!! Never dealt with regular expressions looks like this should be fun to mess around with!! 

8 minutes ago, crazy^millman said:

What are your Sync Point settings? How does the Swiss handle the Wait codes between the Sync Points? On a machine with more than channels you have to SYNC correctly between those streams. You only have 2 streams so it should be pretty straight forward process of syncing. That also plays into the Display Process. Are they separate programs or are the channels handled inside of one program? One a Nakamura Triple turret I have to highlight all 3 separate programs through the MultiStream windows to have it open all 3 and show the SYNC process correctly.

I'll have to figure out a way to grab the sync codes inside the program using the regular expression stuff that Zaffin referred to.  On the Swiss itself our wait codes are done by calling out the head and then just inputting a number directly after.  When both heads reach that they continue.  

For example: 

$1L1 syncs directly with $2L1

$1L2 syncs directly with $2L2 and so on.  

Worst comes to worst I'll have to just export the code in two separate programs and play around with it from there but ideally this regular expression stuff allows me to sort through one file.  I'll give it a shot and update the thread if I can get it working.  Thanks for the help!! 

Link to comment
Share on other sites
1 hour ago, Chaotic5555 said:

This is exactly what I was looking for!! Never dealt with regular expressions looks like this should be fun to mess around with!! 

I'll have to figure out a way to grab the sync codes inside the program using the regular expression stuff that Zaffin referred to.  On the Swiss itself our wait codes are done by calling out the head and then just inputting a number directly after.  When both heads reach that they continue.  

For example: 

$1L1 syncs directly with $2L1

$1L2 syncs directly with $2L2 and so on.  

Worst comes to worst I'll have to just export the code in two separate programs and play around with it from there but ideally this regular expression stuff allows me to sort through one file.  I'll give it a shot and update the thread if I can get it working.  Thanks for the help!! 

Yes that is going to be the issue because code expert is written to support $ as a defined variables in the MP language or end of line. Since you really need it to define a Spindle Variable going to be real tricky to get a Editor written to understand the dollar sign one way to do it a completely different way.

Might look to Cimco Editor Pro it handles Streams. Beyond Compare is a different editor that allows you to write your own scripts and other things.

Link to comment
Share on other sites
8 minutes ago, crazy^millman said:

Yes that is going to be the issue because code expert is written to support $ as a defined variables in the MP language or end of line. Since you really need it to define a Spindle Variable going to be real tricky to get a Editor written to understand the dollar sign one way to do it a completely different way.

Might look to Cimco Editor Pro it handles Streams. Beyond Compare is a different editor that allows you to write your own scripts and other things.

Code expert’s highlighting is file dependent; nc files highlight differently than post files.

The $ sign is not a problem, a proper regular expression needs to be used to identify the sync points.

  • Like 2
Link to comment
Share on other sites

And we've been successful! 

14 minutes ago, Zaffin_D said:

Code expert’s highlighting is file dependent; nc files highlight differently than post files.

The $ sign is not a problem, a proper regular expression needs to be used to identify the sync points.

This is exactly the case.  The Swiss takes programs as .prg files or program files rather then the typical nc file most other machines use.  I believe the only confusion that will occur is just like Zaffin said where it might highlight a different color.  Regardless it's the first time our Swiss guy has seen color coordinated code and he loves the printouts 😄

Here is my final product after messing with the Code Expert config.  Overall I think it came out pretty good.  I'll have to play around with multiple sync codes but as far as the first time we've been able to use mastercam to successfully program for the Swiss, it's looking very promising.  

 

If anyone was curious who is looking this thread up in the future, here were my exact values that I set: 

Start Characters (Regular Expressions Checked)      \$[1-2]

End Characters (Regular Expressions UnChecked)   M99

Sync Points (Regular Expressions Checked)               !(1|2)L*

 

This splits the Swiss code into two parts, and leaves out the configuration print at the bottom of the swiss code.  Ideally I was playing around with trying to get 3 parts out of the code, two parts for each primary spindle and then one part for the configurations at the bottom, but I couldn't get it working.  I attempted using (M99|%) as the end expression but for my second line of code it would continue until the % rather then stopping at the M99, essentially leaving me with seeing the configuration at the end of the code twice.  I may play around with it more some other day but for now it seems to work rather well.  You can see the highlighted Red lines for where the spindles would synchronise.

 

Now if only I could get the post to stop trying to open the main spindle in the subspindle code.... 🤯

Updated Code Expert.png

Link to comment
Share on other sites
2 hours ago, Zaffin_D said:

Code expert’s highlighting is file dependent; nc files highlight differently than post files.

The $ sign is not a problem, a proper regular expression needs to be used to identify the sync points.

Okay good to know thank you.

2 hours ago, Chaotic5555 said:

And we've been successful! 

This is exactly the case.  The Swiss takes programs as .prg files or program files rather then the typical nc file most other machines use.  I believe the only confusion that will occur is just like Zaffin said where it might highlight a different color.  Regardless it's the first time our Swiss guy has seen color coordinated code and he loves the printouts 😄

Here is my final product after messing with the Code Expert config.  Overall I think it came out pretty good.  I'll have to play around with multiple sync codes but as far as the first time we've been able to use mastercam to successfully program for the Swiss, it's looking very promising.  

 

If anyone was curious who is looking this thread up in the future, here were my exact values that I set: 

Start Characters (Regular Expressions Checked)      \$[1-2]

End Characters (Regular Expressions UnChecked)   M99

Sync Points (Regular Expressions Checked)               !(1|2)L*

 

This splits the Swiss code into two parts, and leaves out the configuration print at the bottom of the swiss code.  Ideally I was playing around with trying to get 3 parts out of the code, two parts for each primary spindle and then one part for the configurations at the bottom, but I couldn't get it working.  I attempted using (M99|%) as the end expression but for my second line of code it would continue until the % rather then stopping at the M99, essentially leaving me with seeing the configuration at the end of the code twice.  I may play around with it more some other day but for now it seems to work rather well.  You can see the highlighted Red lines for where the spindles would synchronise.

 

Now if only I could get the post to stop trying to open the main spindle in the subspindle code.... 🤯

Updated Code Expert.png

Thank you for the feedback really appreciate it when someone takes the time to put that effort into it.

Check your Axis Configuration for the operations. That is normally where this problem happens.

Link to comment
Share on other sites
  • 3 months later...
On 2/26/2021 at 1:11 PM, Chaotic5555 said:

And we've been successful! 

This is exactly the case.  The Swiss takes programs as .prg files or program files rather then the typical nc file most other machines use.  I believe the only confusion that will occur is just like Zaffin said where it might highlight a different color.  Regardless it's the first time our Swiss guy has seen color coordinated code and he loves the printouts 😄

Here is my final product after messing with the Code Expert config.  Overall I think it came out pretty good.  I'll have to play around with multiple sync codes but as far as the first time we've been able to use mastercam to successfully program for the Swiss, it's looking very promising.  

 

If anyone was curious who is looking this thread up in the future, here were my exact values that I set: 

Start Characters (Regular Expressions Checked)      \$[1-2]

End Characters (Regular Expressions UnChecked)   M99

Sync Points (Regular Expressions Checked)               !(1|2)L*

 

This splits the Swiss code into two parts, and leaves out the configuration print at the bottom of the swiss code.  Ideally I was playing around with trying to get 3 parts out of the code, two parts for each primary spindle and then one part for the configurations at the bottom, but I couldn't get it working.  I attempted using (M99|%) as the end expression but for my second line of code it would continue until the % rather then stopping at the M99, essentially leaving me with seeing the configuration at the end of the code twice.  I may play around with it more some other day but for now it seems to work rather well.  You can see the highlighted Red lines for where the spindles would synchronise.

 

Now if only I could get the post to stop trying to open the main spindle in the subspindle code.... 🤯

Updated Code Expert.png

Chaotic5555 I am trying to set this up for my swiss as well and am having no luck. I believe i duplicated your settings but it will not sync. I am using a program from an M machine with 3 channels. Any advice or anything you see in my settings?

code expert 1.PNG

code expert 2.PNG

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

Chaotic5555 I am trying to set this up for my swiss as well and am having no luck. I believe i duplicated your settings but it will not sync. I am using a program from an M machine with 3 channels. Any advice or anything you see in my settings?

code expert 1.PNG

code expert 2.PNG

Hey Kevin,

Just played around with what you have setup on my settings here and I think I found your issue.  Try changing the 'm99' to 'M99'.  Seems like its caps sensitive! 

I just tried it with my program and switched my $0 to $3 to try it.  Seemed to have worked just make sure your 3rd stream has a M99.  Mine doesn't typically because its the Machine Configuration for my L20.

Just out of curiosity what kind of machine do you have that uses 3 Streams?? Hope this helps out though! 

  • Like 1
Link to comment
Share on other sites
2 hours ago, Chaotic5555 said:

Hey Kevin,

Just played around with what you have setup on my settings here and I think I found your issue.  Try changing the 'm99' to 'M99'.  Seems like its caps sensitive! 

I just tried it with my program and switched my $0 to $3 to try it.  Seemed to have worked just make sure your 3rd stream has a M99.  Mine doesn't typically because its the Machine Configuration for my L20.

Just out of curiosity what kind of machine do you have that uses 3 Streams?? Hope this helps out though! 

That worked thanks. Citizen M32s. Did you mess around with syncing the G600s? I am guessing not since L machines can pretty much run in just G600. 

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