08-07-2015 10:06 AM
@altenbach wrote:
The sentence "find the only one that is true" implies that there is exactly one that is true, so finding it implies getting its index. We already know the value and that it xists exactly once.
The only complication would be in the case of higher dimensions, but he only gave a single number of elements, so it is probably 1D.
That might be true. (Ha ha, see what I did there)
But how often do people on the forum make a suggestion with what is implied or assumed only to find out they were wrong?
08-07-2015 10:10 AM - edited 08-07-2015 10:16 AM
@Neil_Helsel wrote:
I'm sorry it's a 2D array.
Ok wire the 2D boolean array directly to "boolean to 0,1" followed by "Array min&max". Then get the index of the max (second output from the top). The index is a 1D array with two elements and indicates the location of the TRUE in the 2D array.
If your array is aready numeric (0, or 1), yo can skip the first step.
08-07-2015 10:31 AM
It doesn't seem to want to wire to that. I'll include my code and another forum link to preface what the DAQmx is for. I'm sorry I'm new to LabVIEW and am not too familiar with it yet.
08-07-2015 11:14 AM
I don't see any arrays in the code you attached above. I guess we need more information.
08-07-2015 12:08 PM
In Test 1(2) the Digital 1D Wfm looks like it sends out a boolean array.
08-07-2015 12:12 PM
@Neil_Helsel wrote:
In Test 1(2) the Digital 1D Wfm looks like it sends out a boolean array.
Why do you attach two similarly named VIs with identical size. How do we know where to look?
You have a 1D array of digital waveforms. This has nothing to do with a 1D or 2D boolean array. However you could easily convert to a 2D boolean array, especially of all digital waveflorms have the same lenght (do they?). Use a simple autoidenxing FOR loop. See how far you get.
08-07-2015 12:34 PM
Okay gotcha. So with my 1D array of digital waveforms I have my index on the left column and T/F on the right. I'm trying to use search 1D array to find where it's T. I don't really understand how to use 1D array of digital waveforms constants though to make this happen.
Any tips on that?
08-07-2015 12:54 PM - edited 08-07-2015 12:59 PM
@Neil_Helsel wrote:
Any tips on that?
You can always convert it to a boolean array and the use our earlier advice. Here's one possible solution using this function😞
(Sorry, I never use dynamic or waveform data. Maybe you could even configure your DAQ IO to output boolean arrays directly. (I don't have DAQmx installed, so I cannot tell).
08-07-2015 01:26 PM
Are there any array functions that work with 1D arrays of digital waveforms, because non seem to like being wired to the 1D array of digital waveforms?
08-07-2015 01:28 PM - edited 08-07-2015 01:30 PM
What's wrong with the FOR loop in my example?
(true we get too many dimension, but I cannot check what's actually happening.)