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:

srot_lable


Recommended Posts

Hello everyone,
   I'm trying to call out the "MACHINE CORRDINATE" in the MACHINE COMPONENT MANAGER - ROTARY AXIS label.  I found it is a built-in function to call out but only strings, I would like to call out like this "if  srot_label = 1, "A", e$" but I failed.  Is there away to call it out from string? 

 

Thank you and please help.


 

# --------------------------------------------------------------------------
# Common User-defined Variable Initializations (not switches!)
#
srot_label : ""      #Rotary Axis label (Generally A, B or C)


#region Parameter lookup tables
# --------------------------------------------------------------------------
# Parameter lookup tables - You must adjust the size value if you add any parameters to these tables!
# --------------------------------------------------------------------------
# Machine Definition Parameters 
fprmtbl 1   42   #Table Number, Size
#     Param   Variable to load value into 
      17397   srot_label   #Rotary Axis label (Generally A, B or C) - Not yet available.

 

 

psof$            #Start of file for non-zero tool number
     if srot_label = 1, "A", e$ #=========> I tried to call it out from here and I failed.
Link to comment
Share on other sites

Steven,

A String is a String. You can use String Comparison tests inside MP to check and see what the value of the string is, but it is not "linked" to a numeric variable. This is the way it is designed to work.

I don't want you to take this the wrong way, but you really should sign up for my Basic Post Class. I know you've been editing Posts for years, and probably feel like you are "way beyond" what we would cover in class, but I promise you that you are missing many of the Fundamental concepts of how Numeric and String variables work. You end up breaking the existing logic, that just "works" because of the way the MP Language is designed to process the NCI data.

If you want to "tie" the output of a particular string address to a Numeric Variable, then you can do that with a String Select Table, but it will not just "convert" the String "A" to a value of '1'.

With the logic that you have currently, 'srot_label' would simply read from the Machine Components, and the logic would set 'srot_lablel' to the string "A", or "B", or "C". So that is what the variable would hold. You must use "string" functions with Strings, and "numeric" functions with Numeric Variables. There are some functions to convert from Numeric to String, or String to Numeric, but using these functions depends on the "form" of the variable.

For example, I can convert the String "10" to the Numeric Value "10.", or the Numeric value "10." to the String Value "10" (or "10."), but there is no function to convert the string "A" into the value "1". It just doesn't work that way.

If you wanted to assign a Numeric Value, based on the String Character, you'd just need to use a user-defined variable to do that.

     if srot_label = "A" | srot_label = "B" | srot_label = "C", #Set the value of my 'user-defined' variable, based on String Comparison.
       [
       if srot_label = "A", my_rotary_val = 1
       if srot_label = "B", my_rotary_val = 2
       if srot_label = "C", my_rotary_val = 3
       ]
     else, my_rotary_val = m_one #Shut off Rotary, if 'srot_label' not set.

 

  • Like 1
Link to comment
Share on other sites

Hi Steven,

I won't have any time available for custom training until July at the earliest. I'm booked up with work and preparing for my upcoming Basic Post Processing course in June. I'll email you with some more information.

I really think you would benefit from taking my Basic Post Course. It is over 16 hours of training (about 20 hrs total), for $500.00. If you break it down, that is a cost of $25 per hour for the full course. That is an excellent deal for what you'll get out of the course. I know you think you probably don't need it, but you would really learn a great deal that would help you do your own Post Development. Don't get me wrong, I like being paid for custom post development, but I'd much rather help you understand how the Post and MP Language function, so that you don't need me to do the development for you. I want you to be able to really learn the MP Language, and understand how the PST file processes the NCI data. I think it would really help you, and the cost per hour is the cheapest you are going to find for Post Processor Training.

You need to understand the difference between Numeric and String Variables, and how the String Select Functions work. We'll talk about the Machine Definition and Control Definition, and how these "layers" work in conjunction with the Post to control output, and how to extract the Parameter Data for use in writing custom logic/output inside the PST File.  In addition, we'll be covering special MP Functions for working with Strings, Math Functions, and how to write Boolean Logic statements to control the output of the codes.

I really think you'll benefit from learning these fundamental features of the MP Language, and it will help to fill in the missing pieces in your knowledge of writing Mastercam Posts. I'm going to ask you to take this course before I do any more customization for you, because it will allow you to accomplish more development on your own, and then I'll be able to just help you with the really advanced stuff.

www.eapprentice.net

Thanks,

Colin

 

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