Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DIO with PCI-6534

Chris,

I think we are getting confused with which buffer we are trying to control here. In your original post, we were talking about the on-board buffer and checking to see how many samples are available on the on-board buffer. These new errors that we are getting are dealing with the PC buffer. The number of samples in this new buffer can be easily checked. Here is the property node that will give you exactly how many samples are in the PC buffer.

int32 __CFUNC DAQmxGetWriteSpaceAvail(TaskHandle taskHandle, uInt32 *data);
Data Type: uInt32
Description: Indicates in samples per channel the amount of available space in the buffer.

The PC buffer is the buffer that you need to be monitoring for the error that you are receiving and the onboard buffer is automatically taken care of with the DAQmx driver. You do not need to worry about that, which means that you don't need the DAQmxSetDODataXferReqCond() and DAQmxGetDODataXferReqCond() functions in your code and you can use the DAQmxGetWriteSpaceAvail method instead. The reason that we were getting the error in the first place is because we can use these property nodes only in burst mode. I really hope that answers all your questions and you should be well along your way with this application. Hope there is no confusion regarding this matter anymore.

Regards,

Raajit L
Applications Engineer
National Instruments

Raajit L
National Instruments
Message 11 of 29
(3,010 Views)

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

Message 12 of 29
(2,990 Views)
Hi Chris,

On the output data task, you should set the DAQmxSetWriteRegenMode to DAQmx_Val_DoNotAllowRegen

Jeff

@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 = 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




0 Kudos
Message 13 of 29
(2,957 Views)

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

0 Kudos
Message 14 of 29
(2,948 Views)
hi .
i'm using PCI6534(PCI DIO 32HS),Since i have started recently i have already made data out on port programe,but still iwant some
manuals regarding PCI 6534 SO if u can forword me please send me on mandarrp@tifr.res.in


Thnking you
mandar(mumbai)
0 Kudos
Message 15 of 29
(2,885 Views)
HI Raajit
I'm using PCI DIO 32HS 6534 CARD i want to genrate 32bit data on one line by setting binary or hex data as a input
please help me regarding this application

Regards
Mandar
0 Kudos
Message 16 of 29
(2,886 Views)
The documentation for using the NI PCI-6534 with NI-DAQmx is available at ni.com/manuals or by following this link.
0 Kudos
Message 17 of 29
(2,879 Views)
Hi,
i want to convert Hex value to binary array
please help me regarding  this application

Regards
MANDAR -Mumbai
0 Kudos
Message 18 of 29
(2,871 Views)
Hi,
 
You can change your Hex integer into a boolean array by using the Number to Boolean Array.vi. If you want an array of 1's and 0's, you're going to have to go old school and convert it by dividing the number by 2, and putting the remainder in an array. You could also take the boolean array, and for each index value if it's true, insert a 1, if false, insert a 0.
Something like this:
 
Hope this helps,
Andrew S
 

Message Edited by stilly32 on 04-09-2007 04:36 PM

Message Edited by stilly32 on 04-09-2007 04:36 PM

0 Kudos
Message 19 of 29
(2,861 Views)
Hi,
i'm using DAQmax  to genrate finite pulses  (no.of pulses-controllable),but am unable to control pulses it gives continously pulses
i have used one case structure once applied true it gives me limited pulses (depend on no of samples)since it's mechanical action is latch when pressed if i increased no.of pulses more than 130 it gives me limited pulses please mechanical action since  tell  me solution on this application


Regards
Mandar



0 Kudos
Message 20 of 29
(2,838 Views)