hexagon logo

To Script or not to script

Hi
I m new to PC DMIS but have over 15 years in the field of CMM's, I'm in need of some help to do something I believed would be straight forward. I have 5 values which I need to find the mean of and then apply a tolerance to, this I have done by adding all the values together and dividing by 5, now to activate the pass fail on the Report form ( which is a jpg) I need a "0" or "1" output which can be called by the form. so I thought I'd try an if statement like If MEAN_FF > 0.290 and < 0.310 Then V4 = 0 end If Else V4 = 1 , but I cannot seem to get DMIS to accept this , so I tried Script but after get my had around all the little bit that you have to use to like the script to the DMIS program I'm get error which tell my DIM'ed variables have no value I know I've done something wrong can anyone point me in the right direction some code example would help or a suggestion on how to do this.
Parents
  • Try this CODE:

    ' this next line to manually enter a value for MEAN_FF to show if CODE works, can be commented out in program
    MEAN_FF =COMMENT/INPUT,NO,'ENTER A VALUE BETWEEN 0.290 AND 0.310'
    
    
    
    IF/MEAN_FF.INPUT>0.290 AND MEAN_FF.INPUT<0.310
    ASSIGN/V4 = 0 
    END_IF/
    ELSE_IF/MEAN_FF.INPUT<0.290 OR MEAN_FF.INPUT>0.310 
    ASSIGN/V4 = 1
    END_ELSEIF/
    
    
    ' this next line to show value of MEAN_FF and logic test of V4 , can be commented out in program
    
    COMMENT/OPER,NO,"MEAN_FF = "+MEAN_FF.INPUT
    ,"VALUE OF V4 = "+V4
Reply
  • Try this CODE:

    ' this next line to manually enter a value for MEAN_FF to show if CODE works, can be commented out in program
    MEAN_FF =COMMENT/INPUT,NO,'ENTER A VALUE BETWEEN 0.290 AND 0.310'
    
    
    
    IF/MEAN_FF.INPUT>0.290 AND MEAN_FF.INPUT<0.310
    ASSIGN/V4 = 0 
    END_IF/
    ELSE_IF/MEAN_FF.INPUT<0.290 OR MEAN_FF.INPUT>0.310 
    ASSIGN/V4 = 1
    END_ELSEIF/
    
    
    ' this next line to show value of MEAN_FF and logic test of V4 , can be commented out in program
    
    COMMENT/OPER,NO,"MEAN_FF = "+MEAN_FF.INPUT
    ,"VALUE OF V4 = "+V4
Children
No Data