Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

6552 card not sending all samples

I am trying to use the 6552 card to write a sinewave to a DAC. The sinewave freq is approx 1kHz, the DAC update rate is 500kHz, I have 1048576 samples (20 bit), and the number of cycles to output these samples is 2097. I want to run the waveform continuously and I'm using a script to do this. However approx only 28 cycles (or 14k samples) get sent and then the waveform starts again, resulting in discontinuities in my sinewave. Since the on-board memory is 8M it should not be a memory problem. Any ideas?
0 Kudos
Message 1 of 8
(3,722 Views)

Hi Barry,

 

Can you post your code?

 

Thanks,

 

Keith Shapiro

National Instruments R&D 

0 Kudos
Message 2 of 8
(3,721 Views)

Hi Keith. I'm reading the data from a file as per the following code.

My script is:

 

Script myscript1
repeat forever
generate mywfm
end repeat
end Script

 

Rgds,

  Barry

 

6552_code.JPG

0 Kudos
Message 3 of 8
(3,687 Views)

Hi Barry,

 

It's definitely not a memory issue.  You'd have received an error trying to load the waveform onto the card.

 

 Just to double check - your clock rate is 500kHz, clock source is Onboard Clock?

Do you get any errors when you stop the device from generating?

 

Keith Shapiro

National Instruments R&D 

0 Kudos
Message 4 of 8
(3,678 Views)

Hi Keith,

 

I'm running the clock at 38MHz to give me a DAC update rate of 500KHz (need 76 clocks per DAC word). I have tried both the on-board clock and an external ClkIn.

 

I have also tried a much slower clock, down to a few hundred kHz.

 

I don't get any errors when I stop the device from generating.

 

Regards,

   Barry

 

0 Kudos
Message 5 of 8
(3,671 Views)

Hi Barry,

 

Are you repeating each sample 76 times in the waveform you download to the 6552?  The 6552 outputs one sample per edge of its sample clock.  To get your 500KHz update rate, you'd need to duplicate each sample in the memory 76 times...

 

This would definitely exceed the memory of your device if you have 1M samples. 

 

Keith 

 

 

0 Kudos
Message 6 of 8
(3,655 Views)

Hi Keith,

 

That was my problem. I had created my array of DAC words to be 1M long, when in fact it should have been 1M x76 to accomodate all codes (although this would be too long for the on-board memory).

 

So what was happening was I was writing 1M/76 = 13k words and then starting again so the full sinewave had not completed, which was giving me my discontinuities.

 

When I reduce my number of DAC words to 16384 it works fine (16384 x 76 x 4 bytes/word = 5M).

 

One final question. The default data width for the 6552 is 4 bytes. Can I reduce this to 1 byte? This would allow me to increase my number of codes by a factor of 4.

 

Regards,

  Barry

0 Kudos
Message 7 of 8
(3,636 Views)

Hi Barry,

 

The output engine on the 6552 does not permit changing the data width.  (This can be a bit confusing, since you can use 1-byte, 2-byte and 4-byte acquisition width on input.)

 

Do you need the oversampling?  The 6552 can run at 500KHz, allowing you to output one sample per clock.

 

Also, if you're just doing a single sine wave repeated multiple times, could you make your output only have a single cycle and then use scripting to achieve the same goal?

 

Hope that helps,

 

Keith Shapiro

National Instruments R&D 

0 Kudos
Message 8 of 8
(3,622 Views)