LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting 10 Boolean Buttons with Digital Output

Solved!
Go to solution

Hi,

 

we want to use a NI cDAQ-9188 with 3 NI-9482 modules (and some other modules) to control a pump test rig. We are using LabVIEW 2019. Connecting all the analog inputs, analog outputs and digital inputs was no big matter. 

 

But up to now I could not find a way to connect the digital outputs. The idea was to use a boolean button for every pump to run/stop it. I think the problem occurs somewhere in converting the signal. The error code is: error -200524. Copying the original message does not make much sense because I am using the german version of Labview.

 

image.png

I would be very thankful for receiving any help. THANKS!

 

Tobias

0 Kudos
Message 1 of 6
(3,053 Views)
Solution
Accepted by tobiasle93

Hi Tobias,

 

sometimes it is much easier when you DON'T use ExpressVIs…

 

Use a boolean array with plain DAQmx functions:

check.png

You need to define the DO task with the same number of channels as are elements in the array (or vice versa)…

 

I think the problem occurs somewhere in converting the signal.

Yes.

Why do yo need to Merge all those booleans into a DDT?

Why do you convert that DDT into a boolean array?

Why do you convert that array back to DDT?

Why do you convert that DDT into a 2D float array?

Why do you convert that float array into a digital waveform?

And why build an array of one element of that waveform???

 

All you need is a single BuildArray node - or use a boolean array instead of 10 buttons…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,038 Views)

Learn DAQmx (there are excellent Tutorials out there -- a particularly good one can be found by doing a Web Search for "Learn 10 Functions in NI-DAQmx and Handle 80 Percent ...".

 

Do Not use the DAQ Assistant for this simple problem.  Especially do Not use the Dynamic Data Wire (the black and white checkered wire) for anything -- it almost always creates problems except when used for the most trivial things (like an NI Sales Rep who doesn't know LabVIEW setting up a Demo for student to show "how simple LabVIEW is to use").

 

Bob Schor

Message 3 of 6
(3,028 Views)

And when you get past the button mashing example and have to act on different Booleans from different parts of your code....

 

Look at the example I wrote about in post #2 of this thread on Action Engines.

 

It will save you a lot of headaches and frustration trying to figure out why your Booleans are acting wonky.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(3,014 Views)
Solution
Accepted by tobiasle93

I would also recommend to use a cluster (can even be transparent) of pumps, convert it to a boolean array, and use Gerd's suggestion.

 

pumps.png

Message 5 of 6
(2,966 Views)

Thank you all for helping me finding an easy solution!

 

@GerdW: I needed all the conversions because I wanted to find a way to connect the booleans to the ExpressVI. Your  solution was ways easier and comfortable. Thanks a lot! I maybe gonna restructure my whole program now.

 

@Bob_Schor: I read many tutorials in the last couple of weeks. So I think it was impossible to memorize all the information. Thank you for reminding me of this tutorial.

 

@Ben: Thank you for your example. This can be very useful in my following work.

 

@altenbach: At last thank you for giving me the clue of using a cluster. This was the final tip I needed.

0 Kudos
Message 6 of 6
(2,912 Views)