06-02-2016 10:27 AM - last edited on 07-17-2024 10:34 PM by Content Cleaner
Hi,
I would like to measure voltage using a NI 9239 with my CompactRIO 9074 in LabVIEW FPGA. While everything works perfectly when I'm using LabVIEW in Scan Interface mode, the indicators always show '0' when the VI is loaded and running in LabVIEW FPGA. However, I can generate a voltage using NI 9264, use the digital I/O, and run a VHDL program without issue.
I followed this example, but the output is always '0' instead of 3.28 in my case. (fixed point data)
http://www.ni.com/tutorial/14532/fr/#toc3
Sam
06-02-2016 12:28 PM
There should be a "Start" signal that you set to TRUE. I had the same issue with the 9234.
06-02-2016 08:29 PM
Oh, so these modules require the use of the START and STOP properties in LabVIEW FPGA. I'll try this solution in a few hours.
Thanks for the quick reply.
06-03-2016 04:02 AM
Not exactly properties. They are actually IO for the module (just like the Analog Inputs).
06-08-2016 11:37 AM
Thanks a lot. I used the example VI present in LabVIEW, and I now understand how does the module works. I've adapted the VI to measure the voltage of two of the four outputs available with the NI 9239. I have 2 VI. The FPGA VI, which reads the values of the Analog Inputs and stores them into a FPGA FIFO, and the Host VI, which reads these values and presents them in a graph.
I would like to use a VHDL code in order to multiply these inputs in the FPGA VI. Let's take A (AI0) and B (AI1) for inputs, and S as the ouput. I already wrote the VHDL program, but I'm not sure how to integrate my program as I'm not familiar with the use of the Single-Cycle Timed Loop [SCTL]. If I use the "IP Integration" method, can the VHDL program access the values of the FPGA I/O inside the SCTL? How do I store the value of S (result of the multiplication) in a FIFO (like I did with the analog inputs) if the program, thus the output is in a SCTL? If the loop is running without interuption, I can't access the output value outside of the loop.
Is the CLIP a better method in this case?
Thanks for helping me.
06-22-2016 09:37 AM
Hi
I managed to solve my issue by using the CLIP method instead of the IP Integration one. CLIP seems to be the best option for accessing FPGA I/O. My VHDL code is runnig, but I have one issue. Like I said, I wanted to do a multiplication in VHDL between 2 inputs of the NI 9239.
If AI0 equals 3.2465 and AI1 equals 10.121, the result should be 32.8578. In my case, the result is 30, which means that my code doesn't take into account what's after the dot. Is this something related to my VHDL code? Am I missing something? I tried modifying the indicators properties to display the number under the right format (fixed point), but the result is always 30. Does LabVIEW support fixed point when you use a VHDL code? I read that fixed point data are read as a vector (std_logic_vector).