Jump to content

Segment tolerance with PCM


---
 Share

Recommended Posts

.

Hello everyone!

I have a 2d curve with segment tolerance (see screenshot below)
Can anyone tell me how to pick up the deviation and the actual tolerance that appear on the protocol? I have tried many PCM formulas, but nothing seems to work.

I guess if PiWeb is able to get it, it should also be possible with PCM... ๐Ÿ™‚


. 667_1511bcef734d5c83b32ae1052e8c1612.png

.
Link to comment
Share on other sites

Hello Henrik,

nice try... Unfortunately doesnยดt work. ๐Ÿ™„
I already tried things like:

.tolerance.findValues
.tolerance.lowerLimit
.tolerance.lowerTolerance
.tolerance.upperLimit
.tolerance.upperTolerance
.tolerance.lowTolValue
.tolerance.nominal
.tolerance.nomValue
.tolerance.toleranceRange
.tolerance.tolLower
.tolerance.tolUpper
.toleranceupperLimit
.toleranceupperTolerance


None of them brings me the value that I need... ๐Ÿ™
Link to comment
Share on other sites

There's a couple if is here, but as long as your tolerance is defined totally non-uniform. So that the number of tolerance segments are the same as the number of nominal points. Then this example should push you forward.
for i = 1 to getActual("2D Curve1").actualPointsForExternalInterface.size
	if getParameterNamed(getActual("2D Curve1").pointDistance,i) == getActual("Curve Form1").actual
		display("Dev:")
		display(getParameterNamed(getActual("2D Curve1").pointDistance,i))
		display("Tol")
		display(getParameterNamed(getActual("2D Curve1").formToleranceSegments,i).uTol)
		display(getParameterNamed(getActual("2D Curve1").formToleranceSegments,i).lTol)
		i = getActual("2D Curve1").actualPointsForExternalInterface.size
	endif
next i
If you have mixed non-uniform and uniform tolerances, then you'll have to check start and stop point of the tolerance segments. Eg: You can't use point index together with loop index.

Oh, if you are on 6.8 or above, this should also work:
for i = 1 to getActual("2D Curve1").actualPointsForExternalInterface.size
	if getActualCurvePointDev("2D Curve1",i) == getActual("Curve Form1").actual
		display(getActualCurvePointUppTol("2D Curve1",i))
		display(getActualCurvePointLowTol("2D Curve1",i))
	endif
next i
Link to comment
Share on other sites

Hi Eric,

First of all I have to thank you for your support. You are definitely the best at PCM! ๐Ÿ˜‰
I tried your suggestions but unfortunately it doesn't work, and I think I know why:
unless I'm mistaken, with getActual("Curve Form1").actual you get the total deviation (from Min to Max, i.e. 0.0720 in my example). But no single point reaches this value...
Moreover, what I want to get is the measured value that appears in the PiWeb protocol (0.059 in my example).
But thanks to your help, I found a way to achieve what I need.
Thank you!
RatioMax=0
DevMax=0
TolMax=0
PointNo=0
for i = 1 to getActual("2D Curve1").actualPointsForExternalInterface.size
Dev=abs(getParameterNamed(getActual("2D Curve1").pointDistance,i))
Tol=getActualCurvePointUppTol("2D Curve1",i)
Ratio=Dev/Tol
	if Ratio>RatioMax then
	DevMax=Dev
	TolMax=Tol
	RatioMax=Ratio
	PointNo=i
	endif
next i
message("Max Deviation: ",round(DevMax,3),cr(),"Tolerance: ยยฑ",round(TolMax,3),cr(),"at Point No: ",PointNo,cr(),"Percentage of tolerance used :",round(100*RatioMax),"%")
Link to comment
Share on other sites

 Share

×
×
  • Create New...