hexagon logo

code for checking an exception

Need to calculate these from a set of 8 results
[Spacing error not to exceed 0.005,
spacing between adjacent slot 0.003, 1 place may be 0.005 max]

I am using following code to calculate spacing error within 0.005, but I'm not sure how to find " 1 place may be 0.005 max"
I would highly appreciate any guidance as I need to create similar program for 60 set of slots as well.


LOC_ADJ1, 2, 3... is the spacing between adjacent slots

ASSIGN/ZERO=0

ASSIGN/V1=LOC_ADJ1.X.MEAS
ASSIGN/V2=LOC_ADJ2.X.MEAS
ASSIGN/V3=LOC_ADJ3.X.MEAS
ASSIGN/V4=LOC_ADJ4.X.MEAS
ASSIGN/V5=LOC_ADJ5.X.MEAS
ASSIGN/V6=LOC_ADJ6.X.MEAS
ASSIGN/V7=LOC_ADJ7.X.MEAS
ASSIGN/V8=LOC_ADJ8.X.MEAS

ASSIGN/VR=ARRAY(V1,V2,V3,V4,V5,V6,V7,V8)
ASSIGN/VMAX=MAX(VR)
ASSIGN/VMIN=MIN(VR)
ASSIGN/AVG=VMAX-VMIN

F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<ZERO,ZERO,ZERO>,$
MEAS/XYZ,<AVG,AVG,AVG>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>

DIM LOC_ADJ9= LOCATION OF POINT F1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 0.00000 0.00500 0.00500 0.00001 0.00001 0.00000 --#--
END OF DIMENSION LOC_ADJ9
Parents
  • hello there,

    I don't quite understand your question, but you want to know whether more than one measurement result is greater than or equal to 0.005?

    "MAXINDICES" sorts an array according to size. In this sorted array, the two largest values ​​should not exceed 0.003. but only the 1st
    Maybe that will help.


    ASSIGN/V1=ARRAY(0.002,0.003,0.005)
    ASSIGN/V2=MAXINDICES(V1)
    
    IF/(V1[V2[1]] > 0.003) AND (V1[V2[2]] > 0.003)
      $$ NO,
      more than one measurement result is greater than 0.003
    END_IF/
    
    IF/(V1[V2[1]] > 0.003) AND (V1[V2[2]] <= 0.003)
      $$ NO,
      only one measurement result is greater than 0.003
    END_IF/
    
    IF/V1[V2[1]] <= 0.003
      $$ NO,
      no measurement result is greater than 0.003
    END_IF/
    
  • Hi Henniger123,
    Thanks for replying, this should do.
    But there 8 values that needs to be considered, can i use the same code for 8 values?
Reply Children
No Data