LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency and Amplitude measurements with cRIO 9073 and NI 9225 module.

Hi, I am using a cRIO 9073 with a  9225 module and I am trying to acquire a waveform from a signal generator. The sample frequency should be at 12800 Hz. (256 samples/ cycle , 50Hz nominal frequency).

 

I managed to obtain the waveform by using both the "Getting Started with 9225" example and the Sigma_Acquisition. Ivproj example using he VIMP tools. The problem occurs when I try to measure the frequency.

 

While trying to use the analog period measurement vi. on the FPGA. vi by connecting it to the AI0 output, the period (samples) remain 0. I dont know what the threshold and hysterisis values should be as well as how to read the analog period measurement vi from the Host. vi. Can you advise me on which of the two examples  should I follow as well as on how to measure the frequency correctly?

 

I would really appreciate your help. 

0 Kudos
Message 1 of 10
(3,983 Views)

Hi Macarena,

 

Are you getting any values out for the frequency or are you getting values that are incorrect?

 

Kind Regards, 

Sinead B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 10
(3,876 Views)

Hi Sinead,

 

I am getting 0 period (samples) as a result. I am attaching two screenshots of my project that can be helpful.

 

Thanks

Fpga.pngFpga.png

 

 

0 Kudos
Message 3 of 10
(3,871 Views)

Hello Macarena,

 

The screenshots you've provided are far too small to read- could you upload (ideally) the VIs in question or better screen captures?  

 

Also- could you give us an idea of what the waveform you're looking at looks like (not just the frequency)?  You indicated that you've acquired it successfully, so posting some sample data or a screen capture would help quite a bit.

 

Regards,



Notes for Branch AE:
Please reply to This Post within 24 hours
The US AE is expected to reply to all of your posts within 24 hours. Having this expectation will keep the escalation moving quickly and toward a fast resolution.

You can also use other communication channels: Phone, Skype, etc. to discuss the issue with the US AE. This can help with troubleshooting and quick diagnosis of the issue.

Click here to provide kudos for a post on this page
0 Kudos
Message 4 of 10
(3,866 Views)

DC - fr measurement.png


@Branch_Support-NIC wrote:

Hello Macarena,

 

The screenshots you've provided are far too small to read- could you upload (ideally) the VIs in question or better screen captures?  

 

Also- could you give us an idea of what the waveform you're looking at looks like (not just the frequency)?  You indicated that you've acquired it successfully, so posting some sample data or a screen capture would help quite a bit.

 

Regards,



@Branch_Support-NIC wrote:

Hello Macarena,

 

The screenshots you've provided are far too small to read- could you upload (ideally) the VIs in question or better screen captures?  

 

Also- could you give us an idea of what the waveform you're looking at looks like (not just the frequency)?  You indicated that you've acquired it successfully, so posting some sample data or a screen capture would help quite a bit.

 

Regards,


I apologize for the inconvienience. I send both images and the files because in ccase you are not able to open the VIs

 

ThanksWaveform.png

Host.png

0 Kudos
Message 5 of 10
(3,856 Views)

And the FPGA.VI

fpga1.png

0 Kudos
Message 6 of 10
(3,854 Views)

Dear Macarena,

 

I think you may need to change the values you have wired in to the Analog Period Measurement Express VI for the Threshold Level and Hysteresis. The Analog Period Measurement Express VI calculates the period of an evenly sampled periodic signal using threshold crossing detection.

 

The threshold level input specifies the level that, when crossed by input data in the direction you specify, defines a crossing. 


The hysteresis input specifies a band around the threshold level that input data must leave before this Express VI can detect another crossing.  The input data meets the hysteresis condition following a rising crossing only after meeting the following conditions in order:
input data ≥ threshold level + hysteresis, followed by 
input data ≤ threshold level – hysteresis.
For a falling crossing, input data must meet the above conditions in reverse order.

 

You currently have the direction set to Rising and the Level to 0 and the hysteresis to 0, because the values you wire in to the inputs over ride all the values that you input in the dialog box. 

 

If you change the values of these to match the values you expect to get from your measurement, then hopefully you will get a measurement for the period. 

 

If you have any further questions, please let me know. 

 

Kind Regards, 

 

Sinead B.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 10
(3,813 Views)

Hi Sinead,

 

Thank you very much for your detailed answer. Unfortunately I am having complications with LabVIEW 2013 and the NI RIO 13.0 software, thus I can not re-complile the VI at the time.

The reason I installed the 2013 version is that it contains a Xilinx patch needed in order to run the NI 9467 module. 

I would like to share the project I have been assigned with you:

 

I wish to produce a GPS synchronised data acquisition system that outputs its measurements via UDP, but formatted in an XML frame. I work with a testbench of a cRIO 9073, NI 9225 and NI 9467, with a sine wave generator providing an input to the NI 9225 of approximately 5 Vrms , 50 Hz.

 

I wish the NI 9225 to sample the voltage at 12800 Hz, but it is crucial that the sampling process is disciplined by the GPS time source.  Samples should be taken in chunks of 256 samples, occurring at 0 ms, 20 ms, 40 ms, 60 ms ….  960 ms, 980 ms past the transition of the GPS 1-pulse-per-second.

 

The256 samples should then be Base64 encoded so that they are converted from binary to ASCII.

 

The Base64 representation of the samples should be put in a field called <payload> of an XML frame.  The XML frame should additionally include frames for <time> and <date>.

 

The XML frame should be sent via UDP to a specific target.

 

Currently I can not work with the GPS module so I am trying to think of ways to convert my data to Base 64 represantation and then write them in the <payload> of an XML frame. 

 

Any suggestions?

 

Best regards

0 Kudos
Message 8 of 10
(3,784 Views)

To write data to XML, I suggest that transfer the data from your FPGA to your RT host with a DMA FIFO. Then you can use the Write to XML file (string) to write this data to the XML on the hard drive of your cRIO. You could also pass the data from the RT host to the PC using Networks Streams and log the data to the XML there. Just be aware that that is an option.

 

Do you want to convert the data to Base 64 or ASCII? I believe that you would need to write your own subVI to convert it to base 64. I don't believe that LabVIEW has a built-in function for that. To convert to ASCII use the Decimal String to Number VI. I believe that this is actually what you want to do.

 

What target do you want to send this XML data to? If the other target also has LabVIEW, then it would be easier to transfer the data using Network Streams or Network Published Shared Variables rather than using UDP.

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 9 of 10
(3,769 Views)

Hi Jeremy,

 

We don't want to write an XML file because we only want to send the data from the cRIO to another system.  At no point do we want to store the data or present it via a webpage or network share.
 
We do want to format the data in XML and transmit in a UDP datagram.  We use the XML format so that we can add features in the future.  We use UDP so that the system is connectionless (i.e. we plug in the power and the cRIO starts to transmit, will require no configuration).
 
Regarding the Base 64, I thought it was a binary to text encoding that represent binary data in an ASCII string format. Thus will ''Decimal String to Number'' work (the output data comes in a 16 - bit binary format)?
 
For the XML format I am thinking on using the Generate XML String with parser API.vi. Do you think it is suitable?
 
As the 256 samples synchronization (GPS disiplined) is concrned, I am using the FPGA Timekeeper and the "Synchronize to GPS - cRIO" VI in order to synchronize the chassis clock with the one inside the NI 9467 module.    
 
 
What I find the most difficult is how to compine all these different codes together as I am not experienced in LabVIEW. I have to compine at least 5 different pieces of
code if you take in to concideration the DAQ vi (ni 9225) as well as the GPS module (ni 9467). Should I use sub VIs, shared variables or both?
 
Thank you for your time.
 
 
0 Kudos
Message 10 of 10
(3,748 Views)