LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga

Solved!
Go to solution

hey i did that but still its showing the result between 1 and 2..i mean its fluctuating 1 and 2

0 Kudos
Message 11 of 26
(1,558 Views)

Can you show some code? It's difficult to say what could be wrong without seeing anything.

 

0 Kudos
Message 12 of 26
(1,554 Views)

scshot.png

 

scshot1.png

 

 

 

0 Kudos
Message 13 of 26
(1,548 Views)

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.

 

0 Kudos
Message 14 of 26
(1,543 Views)

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

0 Kudos
Message 15 of 26
(1,541 Views)

i coudnt devide by 3276.75 because when i keep the value of constant -11.67 it took 12

0 Kudos
Message 16 of 26
(1,540 Views)

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

0 Kudos
Message 17 of 26
(1,536 Views)

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).

 

Message 18 of 26
(1,535 Views)

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

0 Kudos
Message 19 of 26
(1,520 Views)

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

0 Kudos
Message 20 of 26
(1,518 Views)