Looping the Alignment

Post Reply
JohnK
Frequent User
Frequent User
Posts: 48
Joined: Thu Jun 27, 2013 10:28 am

Looping the Alignment

Post by JohnK » Thu Jun 27, 2013 10:41 am

TL;DR: Can you?

Basically we are trying to use a loop to control the rotational alignment for following operations

Not_aligned:

--Measure feature
--Report feature's location from center or angel to previous alignment

Prompt: Program will ask if part needs re-measure on alignment or is within tolerance, Hit 'yes' to re-measure or 'no' to continue


' aligned?
x=MsgBox("Does the alignment need re-measured?",3)
If x = 6 Then
GoTo Not_aligned
ElseIf x = 7 Then
GoTo Aligned
Else
GoTo ENDSTEP
end IF
Aligned:

~

ENDSTEP:


which generates a -C- feature on first attempt, then -C-...1, -C-...2, ...
and a report line for each feature when it reports them.

This can bloat the report alittle which isnt a major issue, but when I go to use -C- later on in operations which -C- is it going to use for MMC or if I want a position of -C- to a refence frame?
Can I remove the -C- I create in the loop, or overwrite it instead of appending?

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

Re: Looping the Alignment

Post by US_Helpdesk » Thu Jun 27, 2013 12:57 pm

See the attached sample program

I looped the Alignment steps and used a simple VB Script to assign names instep of relying on the default name, name...1, name...2, etc.

At the end of the loop where the user decides to continue with the program (via MsgBox - "Do you want to re-align?") I re-construct the Datum features and give them proper names - i.e. Datum_A, Datum_B, etc. The reconstruction is done by Extracting Raw data and then Best Fitting the same feature with a unique name.

The Program looks like this...

Code: Select all

Align = 6
i = 1

Do Until Align = 7

'Create Feature Labels / Names
PlnNm = "Plane1_" + CStr(i)
LnNm = "Line1_" + CStr(i)
CirNm = "Circle1_" + CStr(i)
Measure Plane, Line, Circle
Level, Align, Origin
Report some characteristics for the Alignment

Code: Select all

Align = MsgBox("Is re-alignment required?",3)
If Align = 7 Then
If no re-alignment - reconstruct the features and Level, Align, Origin
Otherwise run the previous steps

Code: Select all

ElseIf Align = 2 Then
GoTo MyEnd
End If

i = i +1

Loop
Continue with program...

Code: Select all

MyEnd:
...End...

You can filter all the duplicate Report items from the looped alignment by creating a second report and deleting the report items from the initial alignment.
report.jpg
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

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

Re: Looping the Alignment

Post by US_Helpdesk » Thu Jun 27, 2013 1:12 pm

Note: Instead of prompted the operator to re-run the alignment you could determine this programatically by looking at the deviation of the report item(s) inside the loop.

See Forum Post - https://cmmmanager.com/forum/viewtopic.php?f=32&t=386
I've migrated to a new user account, see my other posts here

Post Reply