09-17-2013 10:25 AM
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.
10-01-2013 10:51 AM
Hi Macarena,
Are you getting any values out for the frequency or are you getting values that are incorrect?
Kind Regards,
10-01-2013 11:08 AM
Hi Sinead,
I am getting 0 period (samples) as a result. I am attaching two screenshots of my project that can be helpful.
Thanks
10-01-2013 11:26 AM
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,
10-01-2013 12:20 PM
@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
Thanks
10-01-2013 12:22 PM
And the FPGA.VI
10-03-2013 04:48 AM
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,
10-07-2013 09:33 AM
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
10-07-2013 02:01 PM
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.
10-08-2013 05:06 AM
Hi Jeremy,