How to continue/stop a program based on user response

Post Reply
quality
User
User
Posts: 14
Joined: Wed Apr 18, 2012 10:39 am

How to continue/stop a program based on user response

Post by quality » Wed Apr 18, 2012 11:27 am

I have a program setup that uses a fixture reference frame. I want to be able to ask the operator if the fixture alignment has been established before the program runs. If the operator has already ran the program that establishes the fixture reference frame, he would answer yes to the question and the program would continue. If the operator has not established the fixture reference frame, he would answer no and the program would stop. I am as green as green can get when it comes to VB. Any assistance would be greatly appreciated. Thank you.

User avatar
US_Helpdesk
Moderator
Moderator
Posts: 1092
Joined: Wed Feb 23, 2011 7:26 pm

Re: i want to continue/stop a program based on a response.

Post by US_Helpdesk » Wed Apr 18, 2012 4:57 pm

You could create a simple Yes No prompt - just copy the VB Script from the <code> sections below and paste into your program as shown below:

skip_align.jpg

Code: Select all

MyAlign = MsgBox("Is manual alignment required?", 4)
If MyAlign = 6 Then
Program to be skipped if user presses [No]

Code: Select all

End If
Replace the 3-2-1 Alignment in this example with ANY CMM-Manager Program Operation(s) you would like to skip. You could get more elaborate yet and include an External Command inside the If Statement that automatically launches the CMM-Manager Alignment program.

Details on the VB MsgBox() function here - http://w3schools.sinsixx.com/vbscript/f ... ox.asp.htm
You do not have the required permissions to view the files attached to this post.
I've migrated to a new user account, see my other posts here

quality
User
User
Posts: 14
Joined: Wed Apr 18, 2012 10:39 am

Re: i want to continue/stop a program based on a response.

Post by quality » Thu Apr 19, 2012 1:23 pm

Thank you nfrost. I will keep this in mind as we figured out another way. We did the same with a yes/no prompt but if the answer was yes, the the program would continue to run.

answer = MsgBox("Has Alignment been performed?", 4)
If answer = 6 Then

...rest of program

End If

User avatar
US_Helpdesk
Moderator
Moderator
Posts: 1092
Joined: Wed Feb 23, 2011 7:26 pm

Re: i want to continue/stop a program based on a response.

Post by US_Helpdesk » Thu Apr 19, 2012 4:12 pm

You could also use a Select Case statement for more flexibility than just a Boolean response. See this post - http://www.cmmmanager.com/forum/viewtopic.php?f=32&t=62
I've migrated to a new user account, see my other posts here

Guido
New User
New User
Posts: 1
Joined: Mon Jun 26, 2017 7:35 am

Features outside tolerance

Post by Guido » Mon Jun 26, 2017 7:45 am

Hello all, i need to know how it is possible to use a question with VB if a feature is outside tolerance and finnish
program! The customer want stop the program run if a diameter is outside of tolerance and stop the program run! Please somebody could help me? Thank you in advance ! Guido from Germany

User avatar
CrashN8
Site Admin
Site Admin
Posts: 367
Joined: Thu Feb 09, 2017 4:07 pm

Re: Features outside tolerance

Post by CrashN8 » Mon Jun 26, 2017 10:46 am

Guido wrote:Hello all, i need to know how it is possible to use a question with VB if a feature is outside tolerance and finnish
program! The customer want stop the program run if a diameter is outside of tolerance and stop the program run! Please somebody could help me? Thank you in advance ! Guido from Germany
I moved your topic... See above for you answer.

Post Reply