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:

User input during postprocessing


Rory
 Share

Recommended Posts

I have a post set up to ask a question of the user when they post a file. The window that pops up allows the user to input the needed data which is then written into the code for the CNC machine. Right now a person can just blow through the screen which leaves a blank space in the nc file. Does anybody know how to set up a check that the post will do to see if the entry was blank? If it is left blank, I do not want posting to continue but rather return to the screen and wait for user input again.

 

Rory

Link to comment
Share on other sites

if you are using a string, you could define a string

snull ""

to which you can compare the value of the answer and then ask again the question if needed.

 

something like this maybe:

 

q1 #question call

while (sanswer = snull),

[

q1

]

 

sanswer being the answer from the prompt screen

this way as long as the answer is null, you stay in the loop. Just make sure you don't create an infinite loop.

Another way could be the following:

q1 #question call

if swanswer = snull, q1

this way if the answer is null, it will ask again the question.

HTH

Link to comment
Share on other sites

That worked just like I wanted it to.

Maybe I will add a timer so that it can't get caught in an infinite loop. If it times out it can exit the posting process.

 

Isnt there a command called "exitpost" or something similar that will let this happen?

Link to comment
Share on other sites

I think there needs to be a wait function something like this;

 

q1 #question call

while (sanswer = snull),

[

q1

counter = counter + 1

Wait 1

if counter = 15, exitpost$

]

 

 

But I am unsure of how to add the wait in the correct format for the post.

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