Page 1 of 1

How to continue/stop a program based on user response

Posted: Wed Apr 18, 2012 11:27 am
by quality
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.

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

Posted: Wed Apr 18, 2012 4:57 pm
by US_Helpdesk
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

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

Posted: Thu Apr 19, 2012 1:23 pm
by quality
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

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

Posted: Thu Apr 19, 2012 4:12 pm
by US_Helpdesk
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

Features outside tolerance

Posted: Mon Jun 26, 2017 7:45 am
by Guido
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

Re: Features outside tolerance

Posted: Mon Jun 26, 2017 10:46 am
by CrashN8
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.