10-11-2012 02:14 AM
hey i did that but still its showing the result between 1 and 2..i mean its fluctuating 1 and 2
10-11-2012 02:25 AM
Can you show some code? It's difficult to say what could be wrong without seeing anything.
10-11-2012 03:17 AM
10-11-2012 03:26 AM
You can do the calculation on the FPGA, but do you really need to? Where do you need the physical voltage value in the end?
If you want to do the I16 to voltage transformation on the FPGA you need to use proper FXP types. I don't see what FXP type you're using in the lower image, but in the upper image you just divide the value by 4096, but leaving it in I16 representation. Integer division of 8160/4096 = 1. If the read value is >=8192 then it is 2. That's why your value fluctuates between 1 and 2.
10-11-2012 03:40 AM
ya actually i need to know the actual voltage that is sensed by the hall sensor . Sensed voltage will keep on fluctuating so i need to do a proper conversion so that i can know the exact voltage. i dont know exactly which FXP type should be used. In my case i pressed ctrl+space and typed fixed point and used the 1st option.
For 1st FXP i used 32 bit word length and 16 bit integer word length and for 2nd FXP i used 16 bit word length and 5 bits integer word length
10-11-2012 03:46 AM
i coudnt devide by 3276.75 because when i keep the value of constant -11.67 it took 12
10-11-2012 04:01 AM
using FXP also i am not able to convert it in actual voltage its showing smthng around 3.99 and 4 please tell me how to proceed
10-11-2012 04:04 AM - edited 10-11-2012 04:05 AM
The power of 2 VI only supports integer powers.
You can use this to divide by 32768 (-15). To do this you will have to convert the I16 to FXP<+-,31,16>, then use 2^-15 on the FXP. This will convert the -32768..32767 value into -1..0.9999. To get the actual voltage you will have to multiply this value with 10.
But again, do you really need the physical value on the FPGA? Why? Normally the FPGA code is not run with the front panel open, so nobody will see the actual value. You will have to transfer the value to another device (RT, Host).
10-11-2012 04:43 AM
hey really thanx value is fluctuating around 2.49 and smtime it comes 2.5.....but actual value is 2.50 so it should fluctuate around 2.50......can we make the solution more accurate......Regarding the use of FPGA it is instructed to us so we are using it can you give sm links about how to transfer the value to RT
10-11-2012 04:49 AM
hey i have one more doubt...if my value changes to sm other value like 3.5 then will the same code work?....because input voltage can vary in b/w 2-3 v