LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Perform an "OR" boolean function on multiple digital waveform signals?

I have multiple digital waveforms in a waveform array. I need to get certain waveforms by name (no control over this or the order of the waveforms) and check if any of their values are 1. If any value is one then I need to output a 1 into an array. The waveforms will always have the same number of elements and always have just one bit.

 

If my waveforms look like this going in:

 

Waveform A

0

1

0

0

0

 

Waveform B

0

0

0

0

0

 

Waveform C

0

0

0

0

1

 

I need an array like this coming out:

 

Resulting array:

0

1

0

0

1

 

I am an old text based programmer and sometimes do manual steps that LabVIEW takes care of automatically. The best way I have come up with is the following. 

 

Can this be faster or better? VI attached. This seems to take about 0.001 seconds on average to execute on my machine.

flycast_1-1624977866887.png

 

Also, I know I need to do a better job of error handling, I am focusing on logic right now.

 

0 Kudos
Message 1 of 3
(1,236 Views)

I think this is what you are after.  You need to do some hoop jumping to convert your waveforms into boolean arrays and then you can just OR the arrays together.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(1,223 Views)

Thank you!

 

That takes about the same amount of time but it is a bit more "organic". It takes advantage of how LabVIEW already handles looping.

0 Kudos
Message 3 of 3
(1,188 Views)