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

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
Attachments:
DMM & 2 Switch Synchronous Scanning 18.vi ‏646 KB

Similar Messages

  • Convert "1D array of dynamic data" to "Dynamic data" after auto-indexing with loop

    Hi -
    I have a question about how exaclty auto-indexing works with the Dynamic Data type when exiting a while loop. I'd like to use the DAQ assistant to record data through an analog input (on the MyDAQ) and then replay that data through an analog output. This works fine if I use the DAQ Assistant to record data for a set amount of time:
    However, I run into trouble when I try to use a While loop with a stop button to record data for an arbitrary amount of time. I set the dynamic data tunnel out of the While loop to "Indexing", but then when it exits the loop, it becomes "1-D Array of Dynamic Data" instead of just "Dynamic Data", and get a broken wire when I try to connect it to the input of the DAQ Assistant. I've also tried converting the dynamic data to Array and Waveform data types inside the loop, but have the same issue (they become 2D Array and 2D Array of Waveform respectively when leaving the loop). Try as I might using blocks like Convert to/from Dynamic Data Type, or Array Subset, I'm unable to get them back down to just Dynamic Data or Waveform, which will be accepted by the DAQ Assistant:
    One other small note - I'm not sure if using the "Build Array" function with a shift register accomplishes exactly the same thing as just auto-indexing an array out of the loop - so I've tried both, but still have the broken wire issue.
    I'm assuming this is just a simple issue of using the right block to convert "1D Array of [Something]" to just plain [Something]. Any help appreciated.
    Attachments:
    PWM_FlatSequence.vi ‏101 KB
    PWM_FlatSequence_While.vi ‏129 KB

    I have been facing problem for all temperature values placing the Write to Measurement File outside the Loop. 
    In Error message it says" Source: 1D array of dynamic data and Sink: Dynamic data".
    Is there any means of convering 1D array of dynamic data to dynamic data?
    I would highly appreciate any help.
    Attachments:
    Temperature Logger.vi ‏110 KB

  • How to use a queue with dynamic data

    When using a collector I have found that it significantly slows down my loop times. I am using LabView7.1 on a Dell PC with Windows XP.  If I use a queue with dynamic data do you think that will require less of my processor and allow for faster loop speeds?
    I have created a queue using dynamic data in one loop and I want to retrieve all available samples each iteration in a slower loop. If I use the flush queue I get a 1d array of dynamic data. What is the best way to convert the 1d array of dynamic data so that the array of dynamic data is consolidated back into a single dynamic data type? Any help would be much appreciated.

    Hi Dennis,
    You could for instance wire the array to an auto-indexed for loop. I attach an example. I assume you wish to concatenate the arrays a singel waveform.
    Hope it helps,
    Pelle S
    District Sales Manager
    National Instruments Sweden
    Attachments:
    Dynamic queue.vi ‏245 KB

  • How to realign elements of an array? Working with old Dynamic Data consumers

    Hello,
    I've got some code which was written with DAQ assistants years ago.  I'm trying to use tasks and arrays for my producer now for speed and efficiency, but I'm stumped on one thing.
    The consumers were written to have the data in a certain order - there's even a VI in there that selects certain elements and sends them to specific outputs.  I previously took care of this with a simple VI that split the dynamic data, wired them to different order terminals, and then set it back to dynamic;  Screenshot attached.
    Is there a structure like this for array where you can break out all the array elements, reorder them and insert constants, and then put them back into the array?  What this ends up feeding is a subvi that's an array builder which converts the DD to array and then reroutes it.  Seems almost like what I'm trying to do could be done there, but it's a bit confusing to me.
    Thanks in advance.
    Still confused after 8 years.
    Attachments:
    realign.jpg ‏166 KB

    Hi Ralph@NES,
    One thing I have done before for this is create a mapping array and a for loop to reorder the elements in your data array. Take a look at the example VI I've attached. If you know exactly where you want everything, you just need to go into the mapping array and set the index destination for the corresponding data. Hope this helps.
    Paul C
    Paul C
    Applications Engineer
    National Instruments
    Attachments:
    Reorder Array.vi ‏9 KB

  • How to convert a dynamic data type to array of strings

        I want to perform a serial communication between two
    computers that I´ll call them A and B. The computer A (transmitter)
    will send a signal (sinusoidal) to computer B (receiver). I´m using a
    VISA Serial Communications Set (VISA Configure Serial Port.vi, VISA
    Write.vi, VISA Read.vi and VISA Close.vi).  VISA Write accepts
    only string data type and VISA Read reads only string data type, but
    the signal that I generated (on transmitter) is dynamic data and I need
    to perform this conversion to run my program sucessfully. How can I
    perform this conversion?!

    Hi Rafael,
    You can configure the From DDT Express VI to convert your dynamic data to any number of different types.  By default, the Express VI will convert to a 1D array of numerics...however, you can configure it (either when you first drop it, or by double-clicking it) to convert to a 2D array of numerics...additionally, you can configure it to convert based on channel data being in columns or rows.  I have attached another screenshot that shows converting the dynamic data into a 2D numeric array. 
    I hope this helps.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    FromDDT2D.jpg ‏164 KB

  • Connect an 1-D array of cluster of 3 elements with dynamic data

    hi everybody.
    I am trying to wire an 1-D array which consists of a cluster of 3 elements with dynamic data. The error that appears says that I'm trying to "connect two terminals of different types". Actually, what I want to do is write to a file the FFT data produced by the Spectral Measurements vi. In order to write to a file, I am using the Write to Measurement File vi, but I don't know if this is the right way to do this. Has anyone any idea about this problem, because I'm out of ideas....
    Thanks a lot!!

    ok! This works really good! thanks a lot! now i'm facing an other problem...The output file does not contain the right data. I want to collect the FFT (frequency vs. amplitude) of a time signal and it gives me the record length and the sampling rate instead.
    For example, if I use a sampling rate of 300 ksamples/sec and a record length of 1000 sampling points, the file to be created has one column containing the record length e.g.
    0
    1
    2
    3
    498
    499
    and on more column containing almost zero values and the value of the sample rate. Do you have any idea why this is happening?
    Thank you!!

  • Connect 1 D array of cluster of 2 elements with dynamic data

    Hello
    The type of source is 1D array of cluster of 2 elements and the type of sink is dyanamic data. Can any one guide me how to connect these 2 elements together. Any response would be highly appreciated. 
    Thanks 

    First, this question would more appropriately be posted to the LabVIEW Board. It is not a signal conditioning issue.
    The dynamic data type (DDT), sometimes referred to as the "evil dynamic data type," completely obscures the internal data structure. The only way someone could help is if you tell us what the source is expecting the internal data structure to be. The only objects which want DDT inputs are Express VIs, which are also good at obscuring thier contents. Implementing the sampe funcitonality with standard VIs might be a better approach.
    You also have not completely specified the source. What are the data types of the cluster elements? 
    Lynn

  • Exporting Dynamic data to a formatted excel-readable array

    Hi all,
    I am trying to export some data into an excel sheet (csv) by creating a new file in which the data is stored. With the current set up that i have, i keep on running into the following problems:
    1. After every iteration in a single run, a dialogue box pops up and asks me  where to save the data, after i have already specified a file name
    2. The data format in the excel file is not what i wasnt. The data is all displayed as one string while i would like it to store the data in different columns.
    Some background: In the section of the vi that i have attached, i use 2 DAQ assistants. The first is used to obtain the initial voltage value at the 2 piezos which is then fed into the rest of the vi, this needs to be done just once, at the beginning of the vi run. The second DAQ asst is used to monitor and save the voltage as it is gradually increased and applied to the piezos.
    A picture of the section of the vi im having trouble with is attached, along with the entire vi.
    I would appreciate any help you can give me on these problems.
    Thanks!
    Attachments:
    errorvi.JPG ‏50 KB
    Coordinate Writing V2.vi ‏166 KB

    I Cant run your vi at the moment but from what i can see.
    - use the file open vi from the file I/O pallette rather than the Express file open VI you have and supply it with a proper path, not a string.
    - I prefer to use .csv (Commas Seperated) instead of tab seperated as i find it easier to read in a string indicator or similar and is just as easy to open in excell.
    - How many Samples is your 2nd Express DAQ function doing?  If it is multiple you will need to seperate the samples by comma also (or average them out etc).
    - I rarely use dynamic data but i think you would be best to extract the actual data values out from the data type at least to get you up and running (It is coerced at the moment and may not be doing what you expect it to do).
    craigc
    Message Edited by craigc on 05-19-2009 03:24 AM
    LabVIEW 2012

  • Waveform vs. Dynamic data

    Can anyone tell me what is the main difference between the Waveform data type and the Dynamic data type?
    I am streaming multi-channel data to file using the datalog format and I want to know if there is a difference if I store it as Dynamic data or if I should convert it to waveform first. Also if I should do the reverse when reading it back. Thanks.

    The more I look into DDT, the more it seems like a hassle, especially if you want to perform any operations on the data. For example, after doing a search in NI Support, nearly all responses recommend converting from DDT to an array/waveform/scalar/etc. before you can effectively manipulate the data. Here's a sample of some responses:
    DDT Response 1
    DDT Response 2
    DDT Response 3
    The picture I'm forming is that DDT may be useful for simple Express VIs--and this may serve the purposes of a lot of the LabVIEW population in the easiest fashion. But performing any operations on DDT data appears to always require conversion to waveform/array/scalar/etc. This will add a bit of overhead to your code. You may find that you will answer your question(s) only after doing some coding with DDT and comparing it to the code required to do the same task but using waveform data types instead. Having looked into it a bit, I think I'll avoid DDTs.

  • How to add dynamic data type as one of the terminals of a Custom VI

    Hello,
    Can anybody tell me if it's possible and how to add a dynamic data type as one of the terminals of a sub-VI? I would like to have a terminal that I can connect signal from DAQmx to my sub-VI.  Thanks.

    Here is one of the coolest things about LV, and one of its major advantages over languages like VB - it has automatic memory management and it compiles whenever you make a change. This allows you to be very free in the way you handle data and change your code. In this case, you should note the small gray dot that appears when you wire the dynamic data into the Array of Waveforms input. This gray dot means that LV coerces the source data type (DDT, in this case) to the target data type (Array of waveforms). If it wouldn't match, you would get a broken wire, the VI couldn't run, and if you hover over the wire or press the broken run button you would get an exact description of the error. Cool, eh?
    This can also be seen in other things. For example, you can change an array's data type or number of dimensions by simply doing it. This will automatically be reflected anywhere the array is called in the program, and if anything won't match, the VI will be broken. If you change the # of dimensions of an array, any array function which that array is wired to will adapt. This allows you to be very safe in the way you write code, because you have LV watching all that annoying stuff for you. You don't have to worry about misspelling a variable here (for the most part).
    One important point about coercion - it does take processor power. This will usually only be evident in large arrays or loops, but it is an important point. Another thing is that coercing numeric types can cause you to lose data - coercing a DBL to a U16, for example, will cause you to lose all the fractional data.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • Using htp.p for print dynamic data in apex region make my page slow?

    Hi, everyone!!! My name is Rafael, and...
    I search in the web and in this forum but i can´t find a answer for my doubt.
    Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
    Example:
    For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
    I notice that this practice causes slow to load the data on the page.
    This is it...
    If someone help me, thanks...
    bye and Happy new Year!!!
    Edited by: user9518141 on 26/12/2009 17:19

    Hi,
    Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
    I think the function call is probably taking a lot of time .. not htp.p.
    I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
    Thanks,
    Rajesh.

  • How do you save dynamic data type, from the DAQ assistant, for use in Excel or matlab?

    Currently, I have the following basic VI setup to save Data from my PCI6221 Data Aquisition Card.  The problem I'm having is I keep getting the last iteration of the while loop in the measurement file and that's pretty much it.  When I try to index the data leaving the loop it gives me a 2D array of Data which cannot be input into the "Write to Measurement File" VI.  How would I save this to a useful Data/time step format?  I was wondering of a way to continuously collect the Data and then save it in a large measurement file that I would manipulate in Matlab/excel?  Am I using the wrong type of loop for this application?  I also noticed my Dynamic Data array consists of data, time, timestep and then a vector of the data taken.  Is it possible to just get a vector of the time change per sample alongside the data?    Sorry for the barrage of questions but any help would be greatly appreciated, and thanks in advance!
    -Bryan
    Attachments:
    basic DAQ.vi ‏120 KB

    There is a VI in the Express > Signal Manipulation palette called "From DDT" that lets you convert from the Dynamic Data Type to other data types that are more compatible with operations like File I/O....for instance, you could convert your DDT into a 2D array and use the Write To Spreadsheet File.vi.  Just a thought...
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • What's wrong with dynamic data?

    I am starting this thread to showcase what I might call "dynamic data abuse": The use of dynamic data where it has no business to be used (does it ever?).
    Everybody is invited to contribute with their own examples!
    One of the problems when operating on dynamic data is its opacity. We can never really tell what's going on by looking at the code. It also seems to hide serious programming mistakes by adapting in ways to mask horrendous code and making it seemingly functional, glossing over the glaring programming errors.
    To get it all started, here are a few recent sightings:
    (A)
    (Seen here). No Kidding! The users joins a scalar with a waveform, then wires the resulting dynamic data to the index input of "replace array subset". He cannot see anything wrong, because the program actually works (coercing the dynamic data to a scalar will, by a happy coincidence, return the value of the scalar joined earlier. I have no idea what thought process led to this code in the first place (maybe just randomly connecting functions until the result is as expected? ).
    (B)
    (seen here)
    What's wrong with simply branching the wire???
    (C)
    I don't remember the link, but here's how somebody transposed a 2D array a while ago (bottom part of image). No way to tell from looking at the code picture! (The "FromDDT" and "ToDDT" need to be configured just right ...).
    ARRRRGH!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    join.png ‏2 KB
    split.png ‏3 KB
    DynamicTranspose.png ‏18 KB

    Here's another one for you.  Found here:http://forums.ni.com/t5/LabVIEW/Program-unresponsive-after-a-dialog-box-input/m-p/2447608#U2447608
    Put a bunch of booleans into a Combine Signals and then do a Dynamic Data to Boolean Array.
    I supplied the much more cleaned up version of the code below.
    EDIT:  I just realized I needed to subtract 1 frm the power before using the Scale by Power of 2.  Oops.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Button Press Decoder_BD.png ‏41 KB

  • How to queue two waveforms in dynamic data

    I am collecting two waveforms for voltage data via DAQ assistant. The output is dynamic data which I can view as two waveforms via a chart. 
    I am sending the retrived data to a queue for storage until a seperate loop can flush the queue and write the data to a measurement file via the Write to Measurement File vi.
    When I retrive my measurement file only one of the two waveforms have been stored.
    I have troubleshot the issue and have determined the correct data is going into the queue

    I'd recommend posting some code.  Are you passing in the two waveforms to the queue as an array of waveforms, or a cluster of waveforms?  Without seeing the code, it is just a guess as to what is going on.

  • Event Handling in labview with arrays as event data

    Hey folks,
    I have a Labview Application which uses a dll to read Ethernet data. The setup is such that, when the dll has fresh data it sends out an event to the Labview Application so that the fresh data can be displayed.
    However i have only managed to get this event based mechanism to send out a single structure at a time. Hence if there are 10 fresh data values, i need to send out 10 events (each event structure contains the parameter name, parameter value, unit and time stamp). It would be more efficient to send out an array of structures in a sigle shot.
    I have tried this but Labview keeps crashing saying that an error was encountered and Labview needs to close along with an access violation message. I did a lot of online searching and found some LV code for event handling but not come accross any implementation which uses arrays as evend data. Is this supoorted? And if so is there any example vi that can be shared so that i get some knowledge about this.
    Many Thanks in adavance,
    Abel. 

    I also gave a try by using a variant as the event data type instead of the cluster which contains the array of floats. I converted the cluster into a variant and used that to create the user event reference. Followed the same logic while decoding the dats.
    But still the crash.... Here is the windbg output...
    ModLoad: 07580000 075b7000 C:\Program Files\National Instruments\LabVIEW 2012\resource\lvalarms.dll
    ModLoad: 0ca90000 0cb72000 C:\Program Files\National Instruments\LabVIEW 2012\resource\mesa.dll
    ModLoad: 0c7f0000 0c7f9000 C:\Program Files\National Instruments\LabVIEW 2012\resource\lvuste.dll
    ModLoad: 35000000 3509b000 C:\Program Files\National Instruments\Shared\TDMS\tdms.dll
    ModLoad: 0c860000 0c87c000 D:\SapphireViewer\dll\SapphireClientDll.dll
    ModLoad: 0e240000 0e2c7000 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\MSVCP80.dll
    ModLoad: 0e2d0000 0e36b000 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\MSVCR80.dll
    (1cb0.1a34): Access violation - code c0000005 (first chance)
    First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=0e47f8b4 ebx=051f0040 ecx=051f0040 edx=061e5764 esi=22820840 edi=07b10040
    eip=03c2050c esp=0e47f5cc ebp=0e47f810 iopl=0 nv up ei pl nz na po nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
    *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files\National Instruments\LabVIEW 2012\resource\tdcore_12_0.dll -
    tdcore_12_0!LvVariant:etContents+0xac:
    03c2050c 837e3100 cmp dword ptr [esi+31h],0 ds:0023:22820871=????????
    I cannot really tell whats going on. Looking for some pointers.
    Regards,
    Abel.

Maybe you are looking for