How to continue/stop a program based on user response
How to continue/stop a program based on user response
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.
- US_Helpdesk
- Moderator
- Posts: 1087
- Joined: Wed Feb 23, 2011 7:26 pm
Re: i want to continue/stop a program based on a response.
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:
Program to be skipped if user presses [No]
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
Code: Select all
MyAlign = MsgBox("Is manual alignment required?", 4)
If MyAlign = 6 Then
Code: Select all
End If
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
Re: i want to continue/stop a program based on a response.
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
answer = MsgBox("Has Alignment been performed?", 4)
If answer = 6 Then
...rest of program
End If
- US_Helpdesk
- Moderator
- Posts: 1087
- Joined: Wed Feb 23, 2011 7:26 pm
Re: i want to continue/stop a program based on a response.
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
Features outside tolerance
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
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
I moved your topic... See above for you answer.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