Skipping Features

Post Reply
mcasey
Frequent User
Frequent User
Posts: 36
Joined: Sat Jan 18, 2014 3:16 am

Skipping Features

Post by mcasey » Thu Jun 20, 2019 7:14 pm

Is it possible to do this? I've seen it referenced in other threads but it's never explicitly spelled out how to do it. We have a program that measures an internal keyway as part of the inspection. The problem is that quite often the part is submitted with this keyway machined too shallow for the probe to measure without crashing. Currently I am using a VB script to calculate how much clearance there will be and if it reports a negative number then we have to manually stop the program, disable the measurements that would result in a crash (lines 067 - 071 in the attached image), and then run the program again. I would like to change this so that if a negative number is calculated (i.e. the probe would crash) those features are skipped over (jump from line 66 to 72). Any assistance would be appreciated.

Image
You do not have the required permissions to view the files attached to this post.

medupriest
SUDO
SUDO
Posts: 423
Joined: Fri Mar 13, 2015 11:59 am

Re: Skipping Features

Post by medupriest » Fri Jun 21, 2019 10:12 am

This absolutely can be done.

We essentially need two things: Some piece of Data and an If/Then statement built on the condition of that data.

If you were to measure a point where the slot is and if the depth of that point can tell you what operation to skip, you can report the Z depth of the point and then use and if the depth is greater than a specified value, we run the operation, else, we skip the operations.

There is a forum post on both of these topics.

To assign a value to a variable based on report data: https://cmmmanager.com/forum/viewtopic.php?f=31&t=497.

To craft an If/Then statement based on the value of a variable: viewtopic.php?f=32&t=182.

In that one, instead of basing the behavior on the answer to a message box, you will have If (your variable) is > (specified value) Then.

mcasey
Frequent User
Frequent User
Posts: 36
Joined: Sat Jan 18, 2014 3:16 am

Re: Skipping Features

Post by mcasey » Fri Jun 21, 2019 12:21 pm

Thank you! It hadn't occurred to me that conditional statements don't need to be fully contained within a particular instance of the "Add VB Script" operation. This just opened up a lot of possibilities for what can be done in terms of programming.

Post Reply