using variables in a STRING, and pulling worst case deviation, and average.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • using variables in a STRING, and pulling worst case deviation, and average.

    hey yall, silly question but some reason I cannot remember how to do this. I have a bunch of deviations all in variables already. I need to know how to put them into a string, and pull the worst case deviation in absolute form, and pull the average or mean from them as well. Anyone assist with this? I posted an image or where im at with it now.
    Attached Files
    -riley Lawlor
    Southern California
    Aerospace CNC Machinery

  • #2
    If you put all of your variables that represent deviation into an array, you can then interrogate the array to obtain the MAX, MIN and AVERAGE. The range would then be MAX-MIN.

    Code:
     ASSIGN/MY_VALS=ARRAY(V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16)
    ASSIGN/MY_RANGE=MAX(MY_VALS)-MIN(MY_VALS)
    ASSIGN/V6=AVERAGE(MY_VALS)
    If you want the absolute value, use ABS(expression). For example to get the largest deviation in absolute form you'd probably need to follow this with something like...

    Code:
    ASSIGN/MY_DEV=MAX(ARRAY(ABS(MAX(MY_VALS)),ABS(MIN(MY_VALS))))
    Once you have the values you can build your string (use STR(expression) to explicitly convert different variable types into strings).
    Neil Challinor
    PC-DMIS Product Owner

    T: +44 870 446 2667 (Hexagon UK office)
    E: [email protected]

    Comment


    • JEFMAN
      JEFMAN commented
      Editing a comment
      Too fast for me !!!!!
      Average doesn't exists in old versions...

  • #3
    I would
    Code:
    V1 =LOOP/START,ID=YES,NUMBER=8,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/V2="LOC"+[V1+1]
    ASSIGN/V3[V1]=V2.X.DEV
    ASSIGN/V4[V1]=V2.Y.DEV
    LOOP/END
    ASSIGN/AVER_X=SUM(V3)/8
    ASSIGN/AVER_Y=SUM(V4)/8
    ASSIGN/MAX_DEV_X=MIN(V3)
    IF ABS(MAX(V3))>ABS(MIN(V3)
    ASSIGN/MAX_DEV_X=MAX(V3)
    END IF
    ASSIGN/MAX_DEV_Y=MIN(V4)
    IF ABS(MAX(V4))>ABS(MIN(V4)
    ASSIGN/MAX_DEV_X=MAX(V4)
    END IF
    Then report them as variables, like you do with P1, P2...

    Comment


    • #4
      Thank yall SOO MUCH!!! Going to go through them now.
      -riley Lawlor
      Southern California
      Aerospace CNC Machinery

      Comment

      Related Topics

      Collapse

      Working...
      X