LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search 1 d array of dynamic data

Hi,
 
Is there a reason why the 'Search 1 D Array' function doesn't give the expected results when working on Dynamic data?
 
I am trying to use one where it's input array comes from a Comparison VI inside a For loop, and so is an array of 0's & 1's.
The element that I have set it to look for is 0, a Numeric Constant converted to Dynamic Data Type using the Convert to Dynamic Data function.
 
It appears to me that regardless of whether the array contains a 0, the output is always -1, which indicates that a 0 was not present.
 
Any assistance much appreciated
 
Thanks
 
Lama
0 Kudos
Message 1 of 5
(3,137 Views)
I have a question, Why are you feeding in a dynamic data type?  Why not the scalar array... LabVIEW 8.2.1+ will not allow me to wire the dynamic data of type 1D scalar to the search array, it will however allow a waveform.  It does allow me to put in a single scalar value (converted to dynamic data) for the value to be searched for.  Can you shoot a screen shot or post some code?

Paul
0 Kudos
Message 2 of 5
(3,124 Views)

Stradis,

Thanks for your reply.

I am also using LabVIEW 8.2.1

The reason that I am using Dynamic Data types is because this is what the Comparison VI require as input, and produce as output.

I am using one Comparison VI to compare some DMM readings against a spreadsheet of expected values, with it set to equal within tolerance and outputting one result per datapoint. This will put a 0 against any DMM reading that falls outside of range.

I am using a second Comparison VI in a similar way, but set to output one result for all channels to produce an overall pass or fail result (1 or 0) for each sweep of the DMM.

The DMM is set to measure resistance, 2 wire mode and the two wires are routed through two switching matrixes. I am connecting one of the DMM inputs to the first wire and measuring between it and the remainig wires in turn, via the second switching matrix. This is what I am calling one sweep. I am then moving the first DMM input to the second wire and repeating the sweep, etc.

Consequently I get a 1 D Array of dynamic data out of my For loop, and I want to search it to see if it contains any 0's, which would indicate an overall fail. I had hoped to use the 'Search 1 D Array' function to do this, and if it returned a -1, to use this as an indication that the equipment under test passed all sweeps of the DMM, but as I said earlier I also get -1 for what should be fail conditions.

I hope you will forgive the spralling mess that is my code, I know that I need to reduce it to a number of sub VI's etc, but I just wanted to see it work first. Hopefully it is attached,

 

Thanks

 

Lama

0 Kudos
Message 3 of 5
(3,110 Views)
Hi Lama,

your vi is quite big - ever thought about making subvis or using left-to-right wiring?

See the changes I made to the testing routine. Why don't you stick with simple operations and simple datatypes? Surely express-vis are easy to configure, but sooner or later you get into trouble because of dynamic datatype - you simply don't know whats inside... And express-vis eat a lot of disk space!
Best regards,
GerdW


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

GerdW,

I take your points about using simpler functions, and not knowing what is inside a dynamic datastream, I will try replacing the Compair Express VI's with basic functions.

Thanks for the example,

 

Lama

0 Kudos
Message 5 of 5
(3,083 Views)