Discussion:
Visual Basic 6 VB6 NI-DAQmx digital output 24 bits
(too old to reply)
nyc
2006-06-07 14:40:11 UTC
Permalink
I downloaded the example program for Digital Output in NI-DAQmx using Visual Basic 6 located here
<a href="http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DA5E173717EF0F8DE034080020E74861&amp;p_node=201196&amp;p_source=external" target="_blank">http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DA5E173717EF0F8DE034080020E74861&amp;p_node=201196&amp;p_source=external</a>
&nbsp;
&nbsp;
The example is for 8 bits using DAQmxWriteDigitalLines().
What should I do if I want to control 24 bits at once. I am using PCI-6503.
&nbsp;
Jesse O
2006-06-08 17:10:13 UTC
Permalink
Hello nyc,
I have opened this example, and it writes to 8 digital lines because the array
called writeArray is only of size 8, and the textbox on the form has line0:7
inside it.&nbsp; To make this application work for 24 lines you need to first
make the writeArray of size 24 and write 24 values inside it.&nbsp; You then
need to change the channel string specified in the textbox.&nbsp; This textbox
string could be either:
DevX/port0/line0:7, DevX/port1/line0:7, DevX/port2/line0:7
or
DevX/port0:2
where X is your device number.&nbsp; The reason why you cannot specify
DevX/port0/line0:23 is because this device has 3 ports (0, 1, and 2) each with
8 lines.
I hope this clarifies things.
Jesse O.
Applications Engineering
National Instruments
nyc
2006-06-08 18:40:12 UTC
Permalink
Jesse,
Thanks.
The size of&nbsp;writeArray cannot be changed to something other than 8.
The&nbsp;function&nbsp;&nbsp;&nbsp;&nbsp;DAQmxWriteDigitalLines(taskHandle, 1, 1, 10#, DAQmx_Val_GroupByChannel, writeArray(0), sampsPerChanWritten, 0) requires that writeArray be a byte in size.
So, is my only choice to use DAQmxWriteRaw( ) ?&nbsp; &nbsp;If so, how do I use it?
&nbsp;

Loading...