From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a simple closed loop control

Solved!
Go to solution

Hi everyone,

 

I need a bit of help creating a (very) simple closed loop control.

 

Note: I am using 3 Measurement Computing boards: one USB-2416, and two USB-TC's. Since Measurement Computing has their own driver (called ULx), it might be a bit more difficult to understand than the NI drivers, but keep in mind ULx is the equivalent to DAQmx.

 

I need to be able output a 0 or 1 binary value based on measurements from 4 voltage input channels compared to constants. Ie. if voltage measurement < 3.5 (constant), send a boolean value (see a, b, c, d in attached photo) which in turn gets sent to the ULx Write VI, and that outputs the binary value of 0 or 1. The problem I've run into is that I need to "compare" single chanels from different boards, which gives me single boolean values for each channel. The ULx Write VI only accepts boolean arrays. Is there a way (and there probably is, I just haven't been able to find it) of arranging these lone boolean values into a boolean array?

 

(see attached file for what I have so far)

 

PS. I am a COMPLETE rookie, only been using LV for a week or so, so please explain everything as if I have no clue what's going on.

Thanks in advance! 🙂

0 Kudos
Message 1 of 4
(2,411 Views)

Here is my work so far.

0 Kudos
Message 2 of 4
(2,410 Views)
Solution
Accepted by topic author lauraalkhoury

Hi,

 

the attached example I've made should demonstrate what you need to do.

 

Some things to think about:

1. It seems that the ULx vis return arrays of signals. If so you can select signals with "index array" as done in my example. That consumes less space and does not change the type of the signals to variant.

2. If you compare the signals to your constants you will receive boolean arrays because every element of the measured signal is compared to the constant (see my example). You may then decide how to process that info - another hooray for signals 🙂

 

Regards

Florian

Message 3 of 4
(2,392 Views)

Florian,

Thank you so much!

You are the first person who's been able to help me with this problem.

Many thanks again.

0 Kudos
Message 4 of 4
(2,335 Views)