We have similar issues on our equipment, i.e. operators not able to think in decimal. On a new machine we built, they take measurements with a ruler graduated in 16ths and enter them in the HMI during setup. Decimal entry was not an option so I had to figure out the best way to enter fractions.
I ended up storing the value as a whole number representing 16ths of an inch, so for example 3-1/4" would be stored as 52. The arrow buttons simply increment or decrement the value by 1 (1/16"). In the PLC it's easy, just multiply the value by 0.0625 to get decimal inches. The field on the HMI displays a text string which is determined by the following code:
Code:
int q := value / 16; // quotient
int r := value % 16; // remainder
cstring result;
if(q==0 && r==0) result := "0";
if(q>0){
result := IntToText(q,10,1);
if(r>0) result += "-";
}
switch(r){
case 0: break;
case 1: result += "1/16"; break;
case 2: result += "1/8"; break;
case 3: result += "3/16"; break;
case 4: result += "1/4"; break;
case 5: result += "5/16"; break;
case 6: result += "3/8"; break;
case 7: result += "7/16"; break;
case 8: result += "1/2"; break;
case 9: result += "9/16"; break;
case 10: result += "5/8"; break;
case 11: result += "11/16"; break;
case 12: result += "3/4"; break;
case 13: result += "13/16"; break;
case 14: result += "7/8"; break;
case 15: result += "15/16"; break;
}
return result;
This was done on a Red Lion G3 but I would assume it could be translated to a PV. In our case the entries were always 4" or less so it was reasonable to use the arrow buttons for entry. In the case of a larger range you could probably split it up and use a numeric entry field for the whole part of the fraction.