From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Electrical Power Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Adapting signals to FPGA Resampling VI

Solved!
Go to solution

Hello! I'm using  cRIO-9074, NI 9225 <+/-,24,10> and NI 9239 <+/-.24.5> and EPS  to measure some signals. I'm normalizing the signals to <+/-,24,1> and pass to FPGA Resampling VI according to help and this white paper http://www.ni.com/white-paper/52519/en/ but I'm having a trouble with converts it back from the output of resampling.vi to appropriate values. I don't undestand what is going on in Data Communication Loop from the example (a piece of code with feedback node and why there's two write to DMA FIFO method):

 

and how shoud I adapt and simplify this code to my application with 6 channels (3 from NI9225 and 3 from NI 9239).

Thanks in advance for Your help.

0 Kudos
Message 1 of 7
(7,161 Views)

Hi,

 

1. why there's two write to DMA FIFO method

The left FIFO stores frequencies and the right FIFO stores data.

 

2. a piece of code with feedback node

In this example, there are most 7 voltage or current signals (Mod1/AI0--AI2, Mod2/AI0--AI3) be acquired in the Data Acquisition Loop.

So every 7 data from the VI::Resampled Signalswere FIFO can be viewed as a group. And the frequency of each group is same. When a new group arrives, the frequency can be stored into the left AI FIFO.

 

3. how shoud I adapt and simplify this code to my application with 6 channels 

Change the number of channels, reference channel index settings and wiring in front panel.

Change the Data Rate to match your modules in block diagram.

FPGA1_20141125110049.PNG

 

Thanks!

0 Kudos
Message 2 of 7
(7,135 Views)

ThreeLions thanks for your reply.

Can you tell me also how shoud I set up bit precission and types conversion to write signals to the last FIFO in Data Communication Loop in the same type and precission as I read from modules in Data Acquisition Loop (in Volts). Resample VI output is FXP <+/-,32,3> so can I convert it directly to <+/-,32,12> for NI 9225 and to <+/-,32,7> for NI 9239? What about frequency?

0 Kudos
Message 3 of 7
(7,107 Views)

I forgot to ask one more question. I have 3 acquisition channels so reference channel index can be a constant or it should be a variable? 'output valid?' output from FPGA Resampling VI is FALSE all the time in my case (I'm attaching screenshot)

0 Kudos
Message 4 of 7
(7,100 Views)
Solution
Accepted by topic author dnowicki

Hi,

 

1. can I convert it directly to <+/-,32,12> for NI 9225 and to <+/-,32,7> for NI 9239? What about frequency?

In theory, it could do. You can assign the fixed-point type of To Fixed-Point to <+/-,32,XX>. Then use the case structure to choose the different fixed-point type for NI 9225 and NI 9239. It is same as frequency.

 

Capture.JPG

2. reference channel index can be a constant or it should be a variable?

The reference channel index is calculated by fpga_Channel Switch.vi. I don't think it can be changed to a constant.

 

3. output from FPGA Resampling VI is FALSE all the time in my case

How do you know the output invalid is false all the time? If you just observe it by eyes, I suppose you cannot find any changes due to the loop time is so quick. Creating an array to indocate all values is a typical choice.

 

Thanks!

0 Kudos
Message 5 of 7
(7,078 Views)

How do you know the output invalid is false all the time?

I executed this VI on dev computer with simulated I/O and performed highlight execution. 


 

0 Kudos
Message 6 of 7
(7,071 Views)

I've compiled this VI and ran on FPGA and it's working now. On Dev Computer it doesn't work but anyway ThreeLions thank you very much that you've explained me some details.

0 Kudos
Message 7 of 7
(7,057 Views)