03-06-2007 06:52 PM
03-08-2007 05:39 PM
Thanks Raajit. Everything works now. That was the information I was looking for in my first post.
For those who are as ignorant as me, I am posting the sequence of DAQmx commands I now use to stream data out of and in to the PCI-6534. They 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", IP_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:
Read block of data from file into cOutputBuffer for 1st DAQmxWriteDigitalU8() // Amount read = dwOutputAmount
DAQmxWriteDigitalU8(hOutput, dwOutputAmount, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
DAQmxStartTask(hOutput)
Read new data from file into cOutputBuffer for 2nd DAQmxWriteDigitalU8() // Amount read = dwOutputAmount
To Continue the Output Data Task I repeatedly execute the following:
DAQmxGetWriteSpaceAvail(hOutput, &lSpaceAvailable)
if(lSpaceAvailable >= dwOutputAmount)
{
DAQmxWriteDigitalU8(hOutput, dwOutputAmount, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
Read new data from file into cOutputBuffer for next DAQmxWriteDigitalU8() // Amount read = dwOutputAmount
}
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:
DAQmxReadDigitalU8(hInput, DAQmx_Val_Auto, 1.0, DAQmx_Val_GroupByChannel, cInputBuffer, BLOCK_SIZE, &lInput, NULL)
Transfer data from cInputBuffer and save to file for next DAQmxReadDigitalU8() // Amount transferred = lInput
It is all very simple if you know the commands.
Thanks again for your help,
Chris
03-13-2007 04:09 PM
@Chris Houlberg wrote:
Thanks Raajit. Everything works now. That was the information I was looking for in my first post.
For those who are as ignorant as me, I am posting the sequence of DAQmx commands I now use to stream data out of and in to the PCI-6534. They 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", IP_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:
Read block of data from file into cOutputBuffer for 1st DAQmxWriteDigitalU8() // Amount read = dwOutputAmount
DAQmxWriteDigitalU8(hOutput, dwOutputAmount, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
DAQmxStartTask(hOutput)
Read new data from file into cOutputBuffer for 2nd DAQmxWriteDigitalU8() // Amount read = dwOutputAmountTo Continue the Output Data Task I repeatedly execute the following:
DAQmxGetWriteSpaceAvail(hOutput, &lSpaceAvailable)
if(lSpaceAvailable >= dwOutputAmount)
{
DAQmxWriteDigitalU8(hOutput, dwOutputAmount, 0, 1.0, DAQmx_Val_GroupByChannel, cOutputBuffer, &lSamplesWritten, NULL)
Read new data from file into cOutputBuffer for next DAQmxWriteDigitalU8() // Amount read = dwOutputAmount
}
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:
DAQmxReadDigitalU8(hInput, DAQmx_Val_Auto, 1.0, DAQmx_Val_GroupByChannel, cInputBuffer, BLOCK_SIZE, &lInput, NULL)
Transfer data from cInputBuffer and save to file for next DAQmxReadDigitalU8() // Amount transferred = lInputIt is all very simple if you know the commands.
Thanks again for your help,
Chris
03-14-2007 03:26 PM
Hi Jeff,
I included that command in the output configuration. That allowed me to clean up the code I used to stop the task.
Thanks for the information,
Chris
04-05-2007 01:24 AM
04-05-2007 07:22 AM
04-05-2007 09:54 AM
04-09-2007 01:01 AM
04-09-2007 04:35 PM - edited 04-09-2007 04:35 PM
Message Edited by stilly32 on 04-09-2007 04:36 PM
Message Edited by stilly32 on 04-09-2007 04:36 PM
04-12-2007 07:03 AM