LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fix point to FPGA

Solved!
Go to solution

So for what I need to do in the FPGA is send fixed point numbers ±,20,5 to a NI 9146 ethernet chassis with a NI 9264 analog Voltage output as modual 2, it sends -10 to 10m Volts out into a wire.  I was creating a FPGA VI and having problems, so I stated devolving my code into the simplist componets, and ended up with the code in the picture attached.  The problem is that sending the information to the Mod2/AO4, the channel I am sending it to, takes an infinite amount of time and the signal does not get sent (I have a wire to test if the voltage is set through).  From what I have found this is the correct way to send information  to the chassis, it works with booleans.  Is there something special that I must do for fixed point?

 

Thank you for your time

 

Mitchell Worner

Download All
0 Kudos
Message 1 of 13
(3,397 Views)

Why do you think it takes an infinite amount of time to execute?  Put an indicator on the iteration terminal and recompile.  You should see the values going up.  Have you tried changing the value of the control from the front panel of the FPGA VI instead of sending it from the host?  Your code looks fine and should work.

0 Kudos
Message 2 of 13
(3,390 Views)

I believed it took infinite time because of previous codes I had.  This was just the simplest code I could think of to test.  I created a indicator for the iteration and it has not moved from 0 for about 5 minutes.

0 Kudos
Message 3 of 13
(3,329 Views)

Did you compile the FPGA code? Check for errors from Open FPGA VI Reference in the host code. Or, maybe you're loading the FPGA, but not running it? Can you show the host code? Do you have Open FPGA VI Reference configured to run the FPGA VI after loading, or are you using the Run FPGA method? What about running the FPGA on its own, without the host - open the FPGA VI and click the Run arrow. Does it run? You should be able to type in values and see the output, and also see the iteration indicator update.

0 Kudos
Message 4 of 13
(3,289 Views)

I am running the FPGA VI alone, no host code.  I am just opening the code that you see and hitting run when the correct chassis is connected.  This works with NI 9476 (Digital Output) and NI 9205 (Analog Input), which also works when using a host VI.  This problem seems to be connected to NI 9264

0 Kudos
Message 5 of 13
(3,280 Views)

I would create a very simple host VI to poll your 'time(ms)' output- that will tell you if the loop is spinning. While you're at it, you can poll the fixed point value control.

0 Kudos
Message 6 of 13
(3,256 Views)

The value for the control is tranfering correctly (used a indicator, I think this is what you wanted?)

 

I know the loop is not spinning, I have tested this several different ways.  I have used a sequence structure to know that once it starts to try and output the data to the modual, it gets stopped.

 

Thank you for your time and help

 

Mitchell

0 Kudos
Message 7 of 13
(3,228 Views)

I wonder if there's some problem with your analog output module - have you tried transferring the fixed-point value, doing some simple math on it, and writing it to an indicator, instead of writing to the analog output (removing the analog output entirely from the block diagram)?

 

What happens if you put another while loop parallel to the one containing the analog output - does that loop run?

0 Kudos
Message 8 of 13
(3,224 Views)

I have done simple math, and it works correctly.

 

If there is another while loop besides it, the other while loop still works, which is why this problem took me awhile to notice.

 

Sorry for the late response, I was out of the lab for awhile.

 

Mitchell Worner

0 Kudos
Message 9 of 13
(3,173 Views)

Well, that's pretty weird. Given that the simple math works, it sounds like you're able to transfer fixed-point values from the host to the FPGA normally. How about wiring a constant to the analog output, and seeing if the loop still fails to run? If so, I'd suspect something wrong with your analog output module, or possibly with the backplane (have you tried moving the module to a different slot?).  You might need to contact NI directly.

0 Kudos
Message 10 of 13
(3,153 Views)