03-11-2011 02:13 PM
Hi guys,
I am writing an application where I will have an array of temperatures in FXP (from an FPGA Read) which I would like to change to a symbollic representation ('HIGH', 'MED', etc.) depending upon the range in which the value lies.
ie;
I have implemented this in the following way;
This works for this simple example but if I had more than 3 states in my Enum the code would start to get pretty messy.
I would like the code to be able to handle;
Can anyone point me in the right direction?
Many thanks,
Pete
Solved! Go to Solution.
03-11-2011 04:11 PM - edited 03-11-2011 04:16 PM
03-11-2011 07:11 PM
03-12-2011 07:05 AM
03-12-2011 10:49 AM
One additional comment - you may want to insert a "Round toward +Infinity" before converting to U16, otherwise the ranges won't work quite the way you expect.
03-13-2011 04:46 PM