LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx-Write Digital Output data

Solved!
Go to solution

I have an array of booleans the length is 30.  I want to write each of these booleans to the same port0/line0 of an Digital I/O module as shown below:

RFeng_1-1589414140105.png

 

Basically I want to write to port0/line0 one bool at a time so that at the port0/line0 i get a graph like:

RFeng_2-1589414370351.png

 

But I'm not able to find an option for the DAQmx Write vi where you can select this option. As shown below.  Is that possible?

 

 

 

RFeng_0-1589414041684.png

 

0 Kudos
Message 1 of 6
(5,148 Views)

You are connecting and indicator to an input of the DAQmx subVI.  You have two data sinks and no data source.  Thus a broken wire.

 

Change the indicator into a control or constant.

0 Kudos
Message 2 of 6
(5,101 Views)

Looks like the rest of the diagram was not copied.  This is what I have

 

RFeng_1-1589462375125.png

and when I change the write vi to  

RFeng_2-1589462518644.png

The broken wire is fixed but then an error shows up about lines in channel and lines in data.

 

0 Kudos
Message 3 of 6
(5,075 Views)

Read what the error message says.

Somewhere you have a quantity mismatch.

 

Since we still can't see all of your code, we don't know how many lines you configured in your task.

Or how many boolean elements are in that 1D boolean array.

 

If you've read any messages on the forum before, I'm sure you've read many of us write that it is impossible to debug screenshots, particularly partial images of screenshots.  You need to attach an actual VI.

Message 4 of 6
(5,052 Views)

Hi RavensFan,

 

Got the issue resolved.  I converted the boolean array into a waveform which I'm feeding directly to the DAQmx Write Vi.  Looks like I'm not getting any more errors.  The only question now is will this write the same waveform continuously to the output (since I'm selecting the Continuous Samples) if yes does it stop once it exits or when does it stop?

RFeng_1-1589489273192.png

 

 

0 Kudos
Message 5 of 6
(5,044 Views)
Solution
Accepted by RFeng

Hi R,

 


@RFeng wrote:

The only question now is will this write the same waveform continuously to the output (since I'm selecting the Continuous Samples) if yes does it stop once it exits or when does it stop?


"It" stops outputting data on this DO pin when the DAQmx task is stopped (or an error occurs)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(5,025 Views)