Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

6259 Analog Output On-Board Memory Usage Question

Hi,
   I've a 6259 DAQ card that I create 4 analog output with on-board regeneration. At least I think it is using on-board memory to regenerate the signals.
Even though that it works, I would like to get a better understanding on what is going on. The following are the questions:
1) The 6259 specification states that "the Analog Ouput FIFO size is 8191 samples shared among channels used".
  Since I'm using 4 channels, is that mean each channel only have a FIFO size of 2046?
2) I've defined the sample per buffer size to be 16000. That means the minimum FIFO size needs to be 16000 in order to hold
  the waveform. If the totol FIFO size is 8191, hold is that work?
3) Can I configure timing sample clock rate for each channel? The current implementation use a single sample clock rate,
  which forces me to use the cyclePerBuffer value to get the frequency from 100 to 1 hz. Is there a better way to implement this?
4) On the " m_Task->Timing.ConfigureSampleClock" function call, the last parameter for buffer size is set to 1000, how is this value
 related to the actual FIFO size used in the signal generation?
 
Thanks in advance
 
Ray
 

 m_CyclesPerBuffer = 100;
 m_DesiredFrequency = 100;
 m_SamplesPerBuffer = 16000;

   m_Task = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask(m_TaskName));
   m_Task->AOChannels.CreateVoltageChannel(m_HrztChannel0Name, _T("HorizontalChannel0"),
     m_Minimum, m_Maximum, DAQmxAOVoltageUnitsVolts);
   m_Task->AOChannels.CreateVoltageChannel(m_VrtlChannel0Name, _T("VerticalChannel0"),
     m_Minimum, m_Maximum, DAQmxAOVoltageUnitsVolts);
   m_Task->AOChannels.CreateVoltageChannel(m_HrztChannel1Name, _T("HorizontalChannel1"),
     m_Minimum, m_Maximum, DAQmxAOVoltageUnitsVolts);
   m_Task->AOChannels.CreateVoltageChannel(m_VrtlChannel1Name, _T("VerticalChannel1"),
     m_Minimum, m_Maximum, DAQmxAOVoltageUnitsVolts);

   // Verify the task before doing the waveform calculations
   m_Task->Control(DAQmxTaskVerify);
   // First configure the Task timing parameters
   if(m_Task->Timing.SampleTimingType == DAQmxSampleTimingTypeOnDemand)
    m_Task->Timing.SampleTimingType = DAQmxSampleTimingTypeSampleClock;
   m_DesiredSampleClockRate = (m_DesiredFrequency * m_SamplesPerBuffer) / m_CyclesPerBuffer;
   m_SamplesPerCycle = m_SamplesPerBuffer / m_CyclesPerBuffer;
   // Determine the actual sample clock rate
   m_Task->Timing.SampleClockRate = m_DesiredSampleClockRate;
   m_ResultingSampleClockRate = m_Task->Timing.SampleClockRate;
   m_ResultingFrequency = m_ResultingSampleClockRate / (m_SamplesPerBuffer / m_CyclesPerBuffer);
   CNiReal64Vector waveForm1, waveForm2;
   // Create waveforms, waveForm1 is at 100Hz, waveForm2 is at 1Hz
   GenerateSawtoothWave(waveForm1, m_ResultingFrequency, m_Amplitude,
      m_ResultingSampleClockRate, m_SamplesPerBuffer, m_CyclesPerBuffer);
   GenerateSawtoothWave(waveForm2, 1, m_Amplitude, m_ResultingSampleClockRate,
      m_SamplesPerBuffer, 1);
   // Configure the sample clock with the calculated rate
   m_Task->Timing.ConfigureSampleClock(
    _T(""), 
    m_ResultingSampleClockRate,
    DAQmxSampleClockActiveEdgeRising,
    DAQmxSampleQuantityModeContinuousSamples, 1000);
   CNiReal64Matrix combinedMatrix;
   combinedMatrix.SetSize(4, waveForm1.GetSize(), CNiMatrix::NiMatrixDoNotInit);
   CNiDAQmxAnalogMultiChannelWriter writer(m_Task->Stream);
   combinedMatrix.AssignRow(0, waveForm1);
   combinedMatrix.AssignRow(1, waveForm2);
   combinedMatrix.AssignRow(2, waveForm1);
   combinedMatrix.AssignRow(3, waveForm2);

   writer.WriteMultiSample(false, combinedMatrix);
   m_Task->Start();

 
0 Kudos
Message 1 of 4
(4,040 Views)

Dear Ray,

1. You are correct. A total FIFO size of 8191 split among 4 channels is 2046.

2. The minimum FIFO size should be the same as the sample per buffer size. However, if you are using on-board regeneration it will only use the total FIFO size (8191), the other points will not be used.

3. You cannot configure timing sample clock rates for each channel.

4. The PC FIFO is not taken into account, so it should ignore that number and use the hardware clock.

Have a great day!

Marni S.

0 Kudos
Message 2 of 4
(4,021 Views)

I would like to ask about input FIFO size of PXI-6254 device, which is 4095 samples according to specs.

Is that for single channel or split into number of channels used?

For examaple, for 8- channel AI,  how many samples maximum per channel  ?

 

Thanks.

Lev

 

 

0 Kudos
Message 3 of 4
(3,951 Views)

The samples are divided amongst the channels used.  So, you can get 4095 samples one channel, or 2048 samples on each of two channels, or 1365 samples on each of three channels, etc..

-Jeff P.

0 Kudos
Message 4 of 4
(3,943 Views)