Chris Houlberg
2007-02-14 02:10:14 UTC
I am attempting to use a PCI-6534 to continuously stream data out of a port and into another port. I am having trouble figuring out how to control the data flow. The DAQmx commands I am using are as follows:
To Configure the Output Data Task I execute the following:
DAQmxCreateTask("OutputTask", &hOutput)
DAQmxCreateDOChan(hOutput, "Dev0/Port0", "OutputPort", DAQmx_Val_ChanForAllLines)
DAQmxCfgSampClkTiming(hOutput, "/Dev0/Dig0/SampleClockTimebase", IO_RATE, DAQmx_Val_Rising, DAQmx_Val_ContSamps, OUTPUT_BUFFER_SIZE)
DAQmxExportSignal(hOutput, DAQmx_Val_SampleClock, "/Dev0/PFI6")
DAQmxCfgOutputBuffer(hOutput, OUTPUT_BUFFER_SIZE)
To Start the Output Data Task I execute the following:
DAQmxWriteDigitalU8(hOutput, BLOCK_SIZE, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
DAQmxStartTask(hOutput)
To Continue the Output Data Task I repeatedly execute the following:
DAQmxGetDODataXferReqCond(hOutput, "OutputPort", &lXferCondition)
if(lXferCondition == DAQmx_Val_OnBrdMemHalfFullOrLess)
{
DAQmxWriteDigitalU8(hOutput, dwOutput, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
Put new data into cOutputBuffer for next DAQmxWriteDigitalU8()
}
To Configure the Input Data Task I execute the following:
DAQmxCreateTask("InputTask", &hInput)
DAQmxCreateDIChan(hInput, "Dev0/Port2", "InputPort", DAQmx_Val_ChanForAllLines)
DAQmxCfgSampClkTiming(hInput, "/Dev0/PFI3", IO_RATE, DAQmx_Val_Rising, DAQmx_Val_ContSamps, INPUT_BUFFER_SIZE)
To Start the Input Data Task I execute the following:
DAQmxStartTask(hInput)
To Continue the Input Data Task I repeatedly execute the following:
DAQmxGetDIDataXferReqCond(hInput, "InputPort", &lXferCondition)
if(lXferCondition == DAQmx_Val_OnBrdMemNotEmpty)
{
DAQmxReadDigitalU8(hInput, DAQmx_Val_Auto, 1.0, DAQmx_Val_GroupByChannel, cInputBuffer, BLOCK_SIZE, &lInput, NULL)
Transfer data from cInputBuffer and save for next DAQmxReadDigitalU8()
}
I am getting errors indicating the specified property in the DAQmxGetDODataXferReqCond() function and the DAQmxGetDIDataXferReqCond() are not supported. I am at a loss on how to correct this. Any help is much appreciated.
To Configure the Output Data Task I execute the following:
DAQmxCreateTask("OutputTask", &hOutput)
DAQmxCreateDOChan(hOutput, "Dev0/Port0", "OutputPort", DAQmx_Val_ChanForAllLines)
DAQmxCfgSampClkTiming(hOutput, "/Dev0/Dig0/SampleClockTimebase", IO_RATE, DAQmx_Val_Rising, DAQmx_Val_ContSamps, OUTPUT_BUFFER_SIZE)
DAQmxExportSignal(hOutput, DAQmx_Val_SampleClock, "/Dev0/PFI6")
DAQmxCfgOutputBuffer(hOutput, OUTPUT_BUFFER_SIZE)
To Start the Output Data Task I execute the following:
DAQmxWriteDigitalU8(hOutput, BLOCK_SIZE, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
DAQmxStartTask(hOutput)
To Continue the Output Data Task I repeatedly execute the following:
DAQmxGetDODataXferReqCond(hOutput, "OutputPort", &lXferCondition)
if(lXferCondition == DAQmx_Val_OnBrdMemHalfFullOrLess)
{
DAQmxWriteDigitalU8(hOutput, dwOutput, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
Put new data into cOutputBuffer for next DAQmxWriteDigitalU8()
}
To Configure the Input Data Task I execute the following:
DAQmxCreateTask("InputTask", &hInput)
DAQmxCreateDIChan(hInput, "Dev0/Port2", "InputPort", DAQmx_Val_ChanForAllLines)
DAQmxCfgSampClkTiming(hInput, "/Dev0/PFI3", IO_RATE, DAQmx_Val_Rising, DAQmx_Val_ContSamps, INPUT_BUFFER_SIZE)
To Start the Input Data Task I execute the following:
DAQmxStartTask(hInput)
To Continue the Input Data Task I repeatedly execute the following:
DAQmxGetDIDataXferReqCond(hInput, "InputPort", &lXferCondition)
if(lXferCondition == DAQmx_Val_OnBrdMemNotEmpty)
{
DAQmxReadDigitalU8(hInput, DAQmx_Val_Auto, 1.0, DAQmx_Val_GroupByChannel, cInputBuffer, BLOCK_SIZE, &lInput, NULL)
Transfer data from cInputBuffer and save for next DAQmxReadDigitalU8()
}
I am getting errors indicating the specified property in the DAQmxGetDODataXferReqCond() function and the DAQmxGetDIDataXferReqCond() are not supported. I am at a loss on how to correct this. Any help is much appreciated.