Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

6733 continuous signal output generation.

Hi,

 

I want to use a NI PCI 6733 card for continuous signal output generation.

I downloaded  the NI Measurement Hardaware DDK NI 671x & 673x (PCI & PXI) examples and run some examples.

 

Our goal is to put some samples in the FIFO buffer and use the external update trigger (on PFI5) to send the samples to the output.

Basically a combination of example AOEX4.cpp and AOEX6.cpp should work.

 

However, example 6 uses board->DACDirectData0.writeRegister(..) to set an output value.

To update the output I use the following code to generate a block wave.

 

void
NIPCI6733Card:Smiley SurprisednPoll_Test_T6() // function called at 5 kHz
{
t67xx* const board = &GetNI();
tSTC* const theSTC = &GetSTC();

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
theSTC->Joint_Reset.writeAO_Configuration_Start(1);
theSTC->Joint_Reset.setAO_Configuration_Start(0);
theSTC->Joint_Reset.setAO_Configuration_End(1);
theSTC->Joint_Reset.flush();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

board->DACDirectData0.writeRegister((OutputHigh)?0x0400:0x0);
board->DACDirectData1.writeRegister((OutputHigh)?0x0400:0x0);
board->DACDirectData3.writeRegister((OutputHigh)?0x0100:0x0);

OutputHigh = !OutputHigh;

}

 

My application (On Poll) update frequency is 5 kHz. The output should run on 15 meaning every update I have to set 3 samples ahead. I want to use the FiFo for that.

(Note: The output is triggerd by PFI5 at 15 kHz)

My idea is to set 3 samples in the FiFo buffer every application update and let the external trigger update the output.

Example 4 uses the FiFo. However, this example stops after 5 runs running the same fifo data.

 

How can I set continuous FiFo data?

 

Manual 370735e.pdf describes the following:

 

With non-regeneration, old data will not be repeated. New data must be
continually written to the buffer. If the program does not write new data to
the buffer at a fast enough rate to keep up with the generation, the buffer
will underflow and cause an error.

 

This is what I want. Is there an example available?

 

Regards,

 

Peter

 

 

0 Kudos
Message 1 of 4
(7,463 Views)

Hello Peter,

 

Example 4 can be modified to output a buffer continuously by modifying the  AO_Counting function as follows:

 

void AO_Counting(tSTC *theSTC)
{
    //Loading counter values in DAQ-STC
    theSTC->Joint_Reset.writeAO_Configuration_Start(1);

// Add the following line to your code
theSTC->AO_Mode_1.writeAO_Continuous(theSTC->AO_Mode_1.kAO_ContinuousIgnore_BC_TC);
.
.
.
}

 

The BC_TC signal is what causes the output buffer stream to terminate. By ignoring the signal, the buffer will output continuously.

 

To get your block wave function to work, you will also need modify Example 4 to have 6 points per buffer and then fill the FIFO with your 6 point wave instead of the ramp function provided by the example.

 

Colin H.
National Instruments
DAQ Software Engineer
Message 2 of 4
(7,379 Views)

 

Hello Colin,

 

Thanks for your reply!

I whil try this tomorrow morging. 

 

Regards,

 

Peter

 

 

0 Kudos
Message 3 of 4
(7,372 Views)

Hello Colin,

 

I successfully completed the software example. Even more, I  combined the continuous AO example with a counter example. Now I can trace the number of datapoints that is set on the output. This way I can detect an overflow or underflow.

 

Thanks for your help.

 

Regards,

 

Peter 

0 Kudos
Message 4 of 4
(7,357 Views)