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:

Sub Program Customisation


Vishu
 Share

Recommended Posts

Can the post be customised to call a Sub program with more than one arguments. I was looking for creating a sub program that is more generic that works according the arguments supplied.

 

Since the controller has limited storage space my sub program needs to be generic to support more functionalities.

 

Thanks

 

Viswanathan

Link to comment
Share on other sites

If I'm understanding you correctly, the answer is yes. Posts can actually assign subprogram numbers as per arguments. Here's a small cutout of a postblock for you to look at;

code:

psub_st_s       #Header in sub level

result = nwadrs(stro, sub_prg_no)

#sav_n2 = n

#n = seqno

 

if sav_mi2 = 43, sub_prg_no = macrocount

 

if virt_tlplnno = 2 & (sav_mi2 = 11 | sav_mi2 = 12 | sav_mi2 = 13),

sub_prg_no = macrocount + 3

if virt_tlplnno = 5 & (sav_mi2 = 11 | sav_mi2 = 12 | sav_mi2 = 13),

sub_prg_no = macrocount + 1

if virt_tlplnno = 6 & (sav_mi2 = 11 | sav_mi2 = 12 | sav_mi2 = 13),

sub_prg_no = macrocount + 5

[

" ", e

*sub_prg_no, e

]

Link to comment
Share on other sites

Here the post calls the Sub program number based on the requirement. But basically I need my single Sub program that has more than one parameter that can be called based on the requirements. For example if my custom operation is a Single Plunge operation it should take a single parameter ( a Depth). If the operation is a two plunge operation, it takes two and for a 3 plunge operation , 3 depths.

 

Thanks.

Link to comment
Share on other sites

Let me make it simple. Can Sub program calls take parameters? That is when we call a sub program number can we pass parameters along with Sub program number which the controller can understand?

 

Like this....

 

N182 M98 G65 P5555 K34.5 M35.0 Q375.0 R0.3

 

Here 5555 is the sub program number are the parameters. Namely 1st, 2nd and 3rd plunge depths.

 

Thanks

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