I'm trying to generate a continuous four-bit digital signal (16 samples) from a PCI-6259 that I'm trying to have look like the output of a four-bit counter (0 to 15) from P0.0, P0.1, P0.2, and P0.3. I have no problem creating the task in Measurement and Automation (see attached screenshot).
The issue I'm running into is that I'm not sure what Write function I ought to be using to get my DAQ to go. I've tried using DAQmxWriteDigitalLines and that didn't seem to get me anywhere.
FWIW, here's a snippet of code I've tried to get to work to no avail. My thought is that I could repeat this process for 0 to 15.
index = 0
For i = 1 To highPoints
writearray1(0) = 0
writearray1(1) = 0
writearray1(2) = 0
writearray1(3) = 0
index = index + 1
publicStatus = DAQmxWriteDigitalLines(publicDigitalOut0TaskHandle, DACwaveFormSize, True, 5, DAQmx_Val_GroupByScanNumber, writearray(0), publicSampsPerChanWritten, ByVal 0&)
Am I doing anything wrong? I would greatly appreciate whatever help the community could give.
I noticed that in your code you may referencing the wrong array. You create "writearray1" and then reference writearray. Was this intentional? Also if you go to start>all programs>national instruments>NI-DAQ>Text-Based Code Support you will find the NI-DAQ™mx C Reference Help. You may find this resource useful.