Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

5441 streaming

Hi,
 
I want to configure the 5441 for streaming.  I'm using the niFgen_Arb_Waveform_Streaming_Example.vi as a starting guide.  But how can I set the frequencey of my waveform?  I understand from the niFgen_Arbitrary_Waveform_Example.vi that the  (Sample Rate)/(# of points) will be my resulted normalized freqency.
 
So how do I set it for streaming.  I want to generate a 25MHz signal.
 
Thanks.
Jieyi
0 Kudos
Message 1 of 9
(8,455 Views)
Hi Jieyi,

You are correct that the resulting frequency, using the niFgen_Arbitrary_Waveform_Example.vi, is the (Sample rate)/(# of points).  So, to generate a 25MHz sine wave you would need to set the sample rate to the max (100MHz) and the # of samples to 4.  I would like to note that this makes a very poor signal in terms of a sine wave.   The streaming example essentially does the same thing just sending the data in chunks to the function generator instead of all at once to be regenerated.  The frequency is determined by two inputs: the Onboard Streaming Waveform Size (Samples) is simply divided by the Write to Streaming Waveform in N Blocks first.  This number is the number of points used by the sine wave.vi (located inside the niFgen Util Create Bin16 Waveform Data.vi).  This number of points is applied to the following function: 1/(#of points) to determine the frequency input for the sine wave.vi (Note: This input is in terms of (cycles/sample)).  This should allow you to calculate the frequency of the output by using the same method described for the niFgen_Arbitrary_Waveform_Example.vi example. 

For example, I set the sample rate to 750KS/s, the Onboard Streaming Waveform Size (Samples) to 64000, and the Write to Streaming Waveform in N Blocks to 10.  I took 64000 / 10 = 6400 # of points.  750,000 / 6400 = 117.1875 Hz. 

I hope this information helps,
Paul C.
Message 2 of 9
(8,441 Views)

So in order for me to obtain 25MHz, I set my sampling rate to 100M S/s.

Therefore, # of points = 100M/25M = 4

I read from the help file that by having more blocks, it will be more effective.  Am I right?  So I use N = 100 for now.

This will give me a Onboard Streaming Waveform Size = 4*100 = 400.

The error I get is "

Driver Status:  (Hex 0xBFFA408A) The size of the streaming waveform is too small.

Waveform Name: www10000
Allocated Waveform Length: 800

Status Code: -219104"

If I change it to Onboard Streaming Waveform Size = 800,

The error I get is"

Driver Status:  (Hex 0xBFFA49B7) DAQmx Error -200584 occurred:
Write failed, because the number of samples to write per channel is invalid.

The number of samples to write per channel must be an integer multiple of the samples to write per channel increment.

Number of Samples to Write: 8
Samples Per Channel Increment: 64

Status Code: -200584"

I would like to know, what determines my value of N and the number of samples.  I am using the 512MB version of 5441.  According to the spec sheet, the Arbitrary Waveform Mode, Maximum Waveform Memory is 268,435,328 Samples.

Lastly, am i heading the wrong direction in all my calculation above?

Jieyi
0 Kudos
Message 3 of 9
(8,426 Views)
The NI PXI-5441 by default loops on the arbitrary waveform data. To generate a sine wave, it would suffice if one cycle of the waveform is downloaded onto generator's memory.
 
In the case of generating 25MHz sine wave @ 100MS/s. You would have to download one cycle of the waveform which has 4 points. However, the minimum waveform size on NI PXI-5441 is 16 samples for continuous trigger in Arbitrary Waveform Generation Mode.This means that for generating 25MHz, we would have download atleast 4 cycles of the waveform (=16 samples). I have attached picture of modified example code where 4 cycles of waveform concatenated (concatenating cycles of waveform.bmp)
 
Standard Function Generation Mode:
Alternatively, you can use Standard Function Generator Mode of PXI-5441 to generate the waveform using example "C:\Program Files\National Instruments\LabVIEW 8.2\examples\instr\niFgen\Fgen Basic Standard Function.vi"
 
Streaming:
You are getting error when performing Streaming is because the Write Quantum is 64 samples. The niFGen Write function requires that the data is written chunks it has to be multiple of 64 samples, except for the last niFGen Write Function before the start of the generation. From the error, it seems that the data chunks were written as 8 samples at a time.  If the program is modified to write data in multiple of 64 sample chunks, we shouldn't see the error.
 
Let me know if I am not clear on anything.
 
Thanks,
Kalyan
 

 
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 4 of 9
(8,418 Views)
oops..forgot to attach the picture
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 5 of 9
(8,404 Views)
Hi Kalyan
 
I don't seems to be able to edit the program as shown in your diagram.  I have attached it.  The error says that I have connected two arrays of different dimensions.
 
So am I suppose to use 'Bulid Array' to obtain my 64 samples for the streaming? 
Jieyi
0 Kudos
Message 6 of 9
(8,387 Views)

Hi Jieyi,

niFGen Write Function in the above function requires the input waveform to be a 1D Array. The Output of the Build Array function is defaulted to build a 2D Array. To force the Build Array function to create 1D Array instead of 2D Array, Right Click on Build Array function and select "Concatenate Inputs".

Attached picture shows snapshot of the above description.

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 7 of 9
(8,374 Views)
Thanks for your great help.
 
But do I apply the same concept of adding the array builder for my streaming program?  (refer to problem stated)
 
 
Jieyi
0 Kudos
Message 8 of 9
(8,341 Views)
Hi Jieyi,

Yes, you should be able apply the same concept of concatenating the array of 4 points four times to obtain 16 points (the minimum).  This would allow you to obtain a signal at the frequency of 25MHz.  However, this is still going to be represented by four points per period.  If this is enough for you application, it should work.

Regards,
Paul C.
Message 9 of 9
(8,320 Views)