Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

MHDDK Manual

Hi Stephanie-

 

The problem is not with the way that you generate your voltage array; it is actually an issue inherent to the way the example is layed out.

 

We define PointsPerBuffer at the top to be 2047.  However, we use this constant throughout the code for the number of total samples to be generated between all channels.  Since 2047 does not evenly divide two channels, one extra sample is generated on one of the AO channels.  This throws the waveforms for both channels off once the output pointer wraps to the second run of the buffer.

 

As a quick fix for this, you can simply change PointsPerBuffer to an even number for two channel output.. say 2046. However, this will quickly break down if you change the number of channels in your generation to four or five.

 

A better approach would be to calculate numberOfSamples as numChans multiplied by numSamplesPerChan.  This variable should be used in  place of the PointsPerBuffer constant when determining how many times to call FIFOData.write(). PointsPerBuffer can be used in error checking to determine if the number of samples you're trying to generate across all samples is larger than the FIFO size of your device (2047 samples). 

 

I hope this helps.  By changing the number of samples you're writing to the FIFO to a number that evenly divides the number of channels, you should see these problems go away.

 

Thanks-

 

Ed

0 Kudos
Message 21 of 24
(4,595 Views)

Thanks you very much Ed !

 

I have a other question. Can I write some channel with waveform for example on channel 0, 1,5,8 and write other channel directly with board->DirectData_xx.write(value); ?

 

 Best Regards,

 

Stephanie

 

 

0 Kudos
Message 22 of 24
(4,591 Views)

Hi Stephanie-

 

That is actually not possible with these devices.  You can switch between waveform mode and immediate mode through the update mode field of the AO_Misc register.  This is not set on a per channel basis - the setting holds true for all channels on the device.  The analog outputs are multiplexed and so they must all be receiving their data from a common place - either directly or through the FIFO.

 

Thanks-

 

Ed

0 Kudos
Message 23 of 24
(4,581 Views)
Hi,

I have a problem to implement the encoder function for PCI6601 card. You will find enclosed my source code.

I don't understand why my counter value is always 0. Could you tell me where is the problem in my code ?

For information, I connected PFI 39 to source A and PFI 37 to sourceB. 

Thanks for your answer.
0 Kudos
Message 24 of 24
(4,381 Views)