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.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Perform sampling on the host computer

Hi there,

 

I am trying to measure the harmonic power from my cRIO, that is, I would like the 2nd to the 50th harmonic components.

To do this I want to use the Harmonic Power vi, this requires the use of the Harmonics VIs however when I attempt using the FPGA the error code, 363557 is shown - the sample rate is not constant.

 

1. How can I make the FPGA sample rate constant

2. How am I ment to use the Harmonics VIs along with FPGA? The Help section said that I must "use the Resampling for power measurement VI when performing sampling on the host computer" - what does this mean? I do not understand...am I ment to make a VI not on the RT compactRIO target? if so.. how?

 

Thank you for your help

0 Kudos
Message 1 of 6
(4,325 Views)

Hi JanelleTheron,

Could you provide some more details about exactly what VIs you are using? Are they the Harmonics VIs from the LabVIEW Electrical Power Suite, or are you trying to use the Harmonic Distortion Analyzer VI which is included with LabVIEW normally?

To answer your questions: 
1. You can place a Loop Timer in your acquisition loop to create a sample rate for your FPGA code. 
2. Since I'm not sure exactly what VIs you are using, I can't comment on the correct way to use them. However, I can say that it's fairly simple to pass your acquired data from the FPGA to your RT Target. We have a number of examples showing exactly how to do this in the Example Finder which can be found in LabVIEW under Help->Find Examples...
Once you are in the example finder, you should be able to find an example for the module you are using in your cRIO under Hardware Input and Output->CompactRIO->Module Specific I/O. I'd recommend taking some time to understand how that code is passing data from the FPGA target to the RT portion of the cRIO. Once the data has been passed to your RT portion, you can do analysis there if the functions are supported in Real-Time. 

If the functions you are using are not supported in Real-Time or FPGA, you may have to pass your data from the cRIO to a host computer to perform that analysis. I know that the Harmonic Distortion Analyzer VI can be used in Real-Time without problem (we even have another example, Harmonic Distortion Analyzer.vi, which will run on the cRIO RT Target), and I can certainly check on the Electrical Power Suite VIs if those are what you are using.

Also, if you are new to using a cRIO, I would highly recommend working through our cRIO Getting Started Guide, which can be found here: http://www.ni.com/pdf/manuals/372596b.pdf 
It should help answer some of your questions about setting things up at a basic level. We also have a cRIO Developer's Guide which is much more involved/advanced but often helps as a useful reference: http://www.ni.com/compactriodevguide/

Charlie J.
National Instruments
Message 2 of 6
(4,281 Views)

Hi there, thank you for your response.

 

I was originally trying to use the Harmonic Vis found in the advanced part of the electrical power suite. However the help from labview mentioned this would require sending the information to the host computer. - trying this however I find that the sample rate is still a problem.

 

My VI to read the FPGA is based on the power quality example project that I found in labview.

 

I am not certain how to adjust the FPGA VI to make the sample rate constant, I have tried to make each loop in the example a timed loop how ever errors then arise.

 

Would the Harmonic distortion analyzer VI be able to display the 2nd to the 50th harmonics - ie is this the "components level" -

components level contains the array of amplitudes of the measured harmonics in volts if the signal in is in volts. The array index is the harmonic number including 0 (DC), 1 (fundamental), 2 (second harmonic),... n (nth harmonic), up to and including the highest harmonic.

 

What could I then use to obtain the Harmonic power? The advanced VIs have an output: Harmonic power values which returns the harmonic power values of each spectrum. (this VI requires the advanced VI input)

0 Kudos
Message 3 of 6
(4,268 Views)

Hi JanelleTheron,

When you are making the sampling loops a timed loop, what are you using for the timing? I would suggest using a while loop with a loop timer in it instead, and there should be a loop like this in the example you started with. Just to confirm, did you use the "Power Quality Applications (cRIO)" example? 

You are correct, the Harmonic Analyzer would not output the power, just the voltage. Have you looked at the example "Advance Power Measurements - Harmonics (DAQmx)" by any chance? You would still need to acquire the data on your cRIO, but I believe that example contains the analysis you are trying to do. If the LabVIEW help says that you still need to send this information to the host computer, you will likely need to do so before attempting that analysis.

What exactly are you using as the input for the Harmonic Power VI? I'm a bit confused by the fact that the error refers to the sampling rate as that VI does not appear to have any dependence on the sampling rate. The inputs should be two clusters where each cluster contains the order 0, delta order, and an array of the complex harmonic spectrum. Could the error be happening at a different location before the application reaches the Harmonic Power VI? You should be able to debug the issue using the highlight execution function on the block diagram of your main VI in LabVIEW. If you can isolate where the problem is occurring, is it the Harmonic Power VI or a different one? Could you post some screenshots of your code where the error is occurring and a screenshot of the error itself?

Charlie J.
National Instruments
0 Kudos
Message 4 of 6
(4,257 Views)

Hi there,

I do have a loop timer in the while loop however this does not keep the sampling rate constant. And yes I am using the Power Quality Applications (cRIO) example :).

 

I have attempted looking at the DAQmx example however I could not understand how to apply it to the FPGA target, I think I have accomplished the task I set out to do by adding the build data block function and setting the sample rate to constant instead of using the FPGA sample rate.

 

The sample rate error occured when I tried to use the zero crossing for power measurement VI.

0 Kudos
Message 5 of 6
(4,241 Views)

Hi JanelleTheron,

You were able to make it work by adding the build data block function before you calculate the Zero Crossing information? And that made the error go away completely?

If you are still seeing the error, some screenshots of your code would be helpful in trying to recreate the problem. Specifically how you are acquiring the data on the FPGA and then what you do to process it in order to calculate the Harmonic Power. 

Charlie J.
National Instruments
0 Kudos
Message 6 of 6
(4,226 Views)