Hello,
You can achieve this by using the DAQmxWriteDigitalU16. Details on this function can be found in the DAQmx C Reference Help. One of the parameters for this function are writeArray which is a uInt16[]. This is an array of 16-bit integer samples to write to the task. You can also use the DAQmx_Val_GroupByChannel, which makes the samples non-interleaved. Non-interleaved samples prioritize channels before samples, such
that the array lists all samples from the first channel in the task, then all
samples from the second channel, up to all samples from the last channel.
In the configuration for the DAQmx channel you can use the DAQmxCreateDOChan. For the "lines" parameter, you can select a channel range to cover all the lines in your port. You can do something like Dev0/port0:1 to include two ports. You can also specify a range of lines such as Dev0/port0/line0:4.
Regards,
Raajit L
Raajit L
National Instruments