Write 1d array of cluster with 2 elements to file

HI!
I'm new at LabView so I hope the question is very simple to you:
I am using a waveform graph to display several measurements.
Now I want to save these Measuremens. The data are stored in 1d array of cluster with 2 elements.
What is the easiest way to do this??
Thanks

If you are already using waveforms you can simply wire right up to "Write Waveforms to File.vi" in the Waveform palette under Waveform File I/O.
Daniel L. Press
PrimeTest Corp.
www.primetest.com

Similar Messages

  • Write an 1d-array of cluster with 3 elements

    Hi,
    I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
    thanks

    Hi
    I found some outer Forum entries about this topic.
    Look at this links:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=49553&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=51526&requireLogin=False
    I hope this helps
    Manuel

  • How can I write a 1d array of cluster with 3 elements to a file?

    Hi,
    I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
    thanks

    Hello schloronzo,
    make a for loop feeded with your array. Inside the for loop unbundle
    the cluster, "format into string" the 3 values, adding the result to
    the ones before and collect them in a shift register. Then save the
    resulting string to a txt-file. If you make a good format string then
    Excel is able to read your txt-file (use tab a separator and CR/LF
    after each 3 values aka "csv format").
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • 1D Array of Cluster of 2 Elements Write to Spreadshee​t

    Hi all, first time using LabView in many years.  I am trying to write a VI that will acquire data from our cDAQ (right now just trying to get it to work with a single thermocouple in a NI 9211, but eventually will be 8 X thermocouple, 4 X pressure transducer), display it in realtime on a plot, and then when the acquisition is stopped, output the data to a file for later use.  I am currently using the Base LabView package.
    My problem (as I remember it was 7 years ago when I last used this) is with the data types not working together.  This is my thought process currently on building this VI.  Everything is inside a While Loop with the Wait function at 1000ms.
    - Acquire a point of data using the DAQ assistant
    - Send that point of data into a bundle
    - Send the iteration count into the same bundle (as a timestamp)
    - Send the resulting cluster of 2 elements into a Build Array function
    - Send the resulting 1D array to a shift register in the While Loop, as well as to an XY graph for realtime plotting
    - Wire the incoming point on the shift register back into the Build Array function
    In my mind, this allows the XY graph to plot the complete array every iteration, giving a realtime view of the signal.  Everything works fine up to this point.  My problems are:
    When I stop and restart the program, the shift register is not cleared, so the existing data in the array remains on the graph.  I know I need to initialize the shift register to clear it, but I cannot figure out what to wire to it that will be compatible with the data type (I just get broken wires with everything I tried).
    Similarly, I cannot figure out how to output this data to a spreadsheet after I Stop the While Loop.  I think I should wire the "Write to Spreadsheet File" VI to the outgoing shift register, but again, I can't get compatibility with data types (source is a 1D array of cluster of 2 elements).
    I have attached my current program "Production" to this post.
    I look forward to the help!
    Brad
    Attachments:
    Production.vi ‏46 KB

    Hi Brad,
    I would suggest you change your architecture. First, to answer your questions:
    1.
    In order to ensure that your shift register is not reading the last
    value from it's memory location, you just need to create a constant for
    the shift register. To do this, right-click at the input of the
    'left-placed' shift register and create a constant.
    2. The Write
    to Spreadsheet is expecting a 1-d or 2-d array while you are wiring a
    Dynamic Data Type. Use the Convert from Dynamic Data Type to convert
    the data into the appropriate waveform after which you can get the
    waveform attributes which includes the values and the timestamp data. Or, you can use the Write to Measurement File to write to a .lvm file which can be opened in Excel as well.
    Changes to your architecture:
    Since
    you are using a lot of channels, I would advise you use a
    producer/consumer architecture. You can have a look at this
    architecture by navigating to File -> New.. and searching for the
    Producer/Consumer template. You will notice that this architecture uses
    queues. The way you will design your VI is to use DAQ to acquire the
    data into your producer loop, convert this data into a waveform and
    then send this data to the consumer loop via queues. In your consumer
    loop, you can write this data to a file. At this point, I would
    encourage you to write to a binary file instead of a spreadsheet file. The write will happen faster and you will be using less space on your hard disk when compared to ASCII writes.
    I know this can be real confusing for a beginner, so be sure to post back if you have any questions.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • 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

  • How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers? (history data from a chart)

    Hello,
    in my vi I have a chart with 5 Plots displaying measurement data.
    The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
    I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
    I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
    How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
    I use LabVIEW 7.1
    Johannes
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    Gerd,
    thank you for the quick response and the easy solution.
    Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
    And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
    Johannes
    Message Edited by johanneshoer on 04-28-2009 10:39 AM
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Attachments:
    SaveChartHistory.JPG ‏57 KB
    SaveChartHistory.JPG ‏57 KB

  • Adding an element in an array of cluster of 2 elements

    Hi all,
    I have a 1D array containing a cluster of 2 numeric elements (= 2 rows of 100 values).
    From this array, collecting new data in for loop, I want to create another array containing a cluster with 9 elements: in each for I want to add an element (= like one row).
    After this, I want to compare data from one element with a fixed value, and when the value is find in the element, I want to extract the values of the 8 other elements at this point.
    Thanks
    Dze

    Sorry I didn't understand you well. To use only arrays, you'll need 3D arrays, as you can see in the example attached. I've made two variants, one with your method (don't know if there's an easyer one) and one with the method I think is easyer, after that, you can search in the 3D array easyer that in the array of clusters of arrays (uff...). If I misanderstood you again, please let me know.
    Hope this helps
    Attachments:
    arrayclusterarray.llb ‏50 KB

  • Array of Cluster with event structure

    Hi,
    I am having Array of cluster with cluster having 1 String Control , 1 Combo box, 1 Led control and 2 Numeric control. In the combo box i am having two options to select ('Binary' and 'PWM').Whenever Binary is selected then Led control has be enabled and whenever PWM is selected 2 Numeric control has to be enabled.
    Is there any way to do this??
    Pleas help me...
    Regards
    Meenatchi

    actually in my application, the front panel has to have 16 rows of controls (1 string control, 1 combo box, 1 Led control, 2 numeric control).so i planned to keep all those controls in a cluster and create one array.If i didnt so i will have 16x5 controls in my front panel and i have to put 16 event cases for each combo box to do the enable and disable of controls..
    is there any simple way to do this..i have attached my front panel view
    Attachments:
    Untitled10.vi ‏139 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!!

  • Array to cluster with adjustable cluster size

    Hi all
    Here I have  a dynamic 1D array and I need to convert it into cluster. So I use Array to Cluster function. But I notice that the cluster size is a fix value. How can I adjust the cluster size according to the 1D array size?
    Anyone pls give advise..
    Thanks....

    I won't disagree with any of the previous posters, but would point out a conversion technique I just recently tried and found to work well for my own particular purposes.  I've given the method a pretty good workout and not found any obvious flaws yet, but can't 100% guarantee the behavior in all settings.
    Anyhow, I've got a fairly good sized project that includes quite a few similar but distinct clusters of booleans.  Each has been turned into a typedef, complete with logical names for each cluster element.  For some of the data processing I do, I need to iterate over each boolean element in a cluster, do some evaluations, and generate an output boolean cluster.  I first structured the code to use the "Cluster to Array" primitive, then auto-index over the resulting array of booleans, perform the evaluations and auto-index an output array-of-booleans, then finally convert back using the "Array to Cluster" primitive.  I, too, was kinda bothered by having to hardcode cluster sizes in there...
    I found I could instead use the "Typecast" primitive to convert the output array back to my cluster.  I simply fed the input cluster into the middle terminal to defin! the datatype.  Then the output cluster is automatically the right size and right datatype.
    This still is NOT an adjustable cluster size, but it had the following benefits:
    1. If the size of my typedef'ed cluster changes during development by adding or removing boolean elements, none of the code breaks!  I don't have to go searching through my code for all the "Array to Cluster" primitives, identifying the ones I need to inspect, and then manually changing the cluster size on them one at a time!
    2. Some of my processing functions were quite similar to one another.  This method allowed me to largely reuse code.  I merely had to replace the input and output clusters with the appropriate new typedef.  Again, no hardcoded cluster sizes hidden in "Array to Cluster" primitives, and no broken code.
    Dunno if your situation is similar, but it gave me something similar to auto-sizing at programming time.  (You should test the behavior when you feed arrays of the wrong size into the "Typecast" primitive.  It worked for my app's needs, but you should make sure it's right for yours.)
    -Kevin P.

  • Easier way to convert array to cluster with named variables?

    I have an array of variables, I would like to essentially unbundle that array to named variables.
    I believe the only way of doing this is by converting the array to cluster (besides removing each element one by one)?
    Is what I have done below the best way of doing it? seems a bit weird having to unbundle and rebundle by name.
    comments appreciated.
     

    Your problem code is actually right before the red square. Instead of the "array-to-cluster-unbudle dance", you should simply use a plain index array resized for the same number of outputs. same functionality, less convoluted.
    Your wiring is a bit of a mess and it is hard to tell if the order of elements in the array is the same as in the cluster.  Maybe a simple typecast to the cluster would work.
     

  • Saving data from 1d array of cluster of 2 elements: HP 8752 driver

    I'm using the following driver to communicate with my HP 8720C Network Analyzer
    http://sine.ni.com/apps/utf8/niid_web_display.down​load_page?p_id_guid=E3B19B3E9092659CE034080020E748​...
    ...So far I've easily been able to use the "collect and display data" vi, except for saving data. All I want to be able to do is save the data from a single sweep in spreadsheet format. Displaying the data is no problem, which I can then print, however, the output data file is a mess. The VI is rather complicated, and I can't figure out how to save the data in a nice pair of columns of numerical values.
    The VI's output data is in the format of a 1 dimensional array of clusters of 2 elements (ie the x-y values). I would've thought it would be trivial to do this, since this is the standard format for data for the classic X-Y graph. So far, I haven't been able to come up with anything. Any ideas?
    Thanks,
    Spence

    Feed the array of clusters into a for loop with autoindexing enabled (the default). Inside the loop use the Unbundle primitive to extract X and Y for one point. Use Build Array to make a two-element array from X and Y. Wire this array out of the for loop and you will have a two dimensional array with two columns and as many rows as there are elements in the array of points.
    Lynn

  • Array of cluster with string controll??

    Hello again!
    Now we have another type of problem. We have an array of clusters. The cluster is built by two controlers. One is a string and the other is a menu ring. How can we get a text in the strings that stays there even if one close the program. The text is supposed to be different. Example: B1, B2 and so on. then we want to be able to choos from a menu ring different options that are coupled with B1, B2 and so on. Best regards.

    Using "make current values default" will save a set of default values into all controls on the front panel. If you want the values to not just be default but be saved from run-to-run you need serialization of controls. When initializing controls (usually before the main user loop) you feed your controls data from a stored file and at the end of the program the settings are stored back (overwritten) to the same "preference" file. Reading and writing complex data forms might seem like it would be a pain to implement but Labview has a nice method for such data persistence. Use the Advanced>>Data Manipulation>>XML VI's. Flatten your control to XML using, you guest it, "Flatten to XML" then use write XML to file to save settings. Do the reverse to initialize controls by reading XML file and unflattening XML data. I have had nice results with these VIs in the past and although not the most compact data form (we are in the age of 100+GB hard drives so what's a few bytes between friends?) will give you well formatted data with almost no additional work. If you just want default data settings and not data persistence then ignore this message.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Array of cluster of arbitary type

    Hi all,
    Is it possible to generate an array of cluster with the following characteristic?
    1. each element cluster in the array will be of different type
    2. depending on the code, each element could be a different data type at different time.  For example, the cluster at array[0] will be a string when the user input is one, and array[0] will be a U16 if the user input is two.  The index for a particular datatype is arbitary.
    Let me know.  I am trying to write a subvi that will get an array of U16 convert the array to an array of cluster with string, U16, double, single, U32, etc.
    Yik
    Kudos and Accepted as Solution are welcome!
    Solved!
    Go to Solution.

    That would work great.  Thanks!
    Yik
    Kudos and Accepted as Solution are welcome!

  • How to set multple values in cluster with local variable?

    Hello all,
    Ok, I've made my way through Labview for everyone, and have some basic concepts down. I can see with a cluster, if acting directly upon it, you can unbundle, change values, rebundle, etc.
    I'm trying something a bit more complex...and just not sure how to get started on this.
    I have a drop down menu ring. I have set this up as a typedef, with 4 values.  I have used this typedef 7 times, plus some LED bools, in a cluster. I have made this cluster a typedef.
    So, in my main vi I"m starting to design, I've set up an example posted here....and in it, I have two instantiations of the cluster typedef, Left Selector and Right Selector.
    I have dropped into this vi, a copy of the menu ring typedef (same typedef as in the clusters, same values)....called reset all tubes.
    I'm trying now, to figure out how, with an event on the change of value for 'reset all tubes'....that I can start with the left selector, and change all the tubes (these are the menu ring selector)  to the same value as what has been selected with the 'reset all tubes' menu ring.
    I've created a local variable for the left selector. It is set to read values. (I'll be doing the same with the right one too, but just starting with the left).
    In examples I've seen where directly accessing a cluster, you could unbundle the cluster...loop through and change the values...maybe pull out all of the 'tubes' into an array and move through that to update the values.  And when you bundle or unbundle the cluster...you can see the values, etc, when you stretch them out on the block diagram.
    With the local variable..I can't see to 'stretch' it out like I was expecting..so I can access the values for the 'tubes'...and set them all to the value of the 'reset all tubes' ring menu value.
    Can someone put me on the path on the best way to do this....or is there a structure of component I'm missing here ?  Am I on the right track to begin with here?
    This would seem pretty basic to me, but I'm just missing something here on how to start...
    Thank you in advance,
    cayenne
    Solved!
    Go to Solution.
    Attachments:
    example_select_dropdown.ctl ‏5 KB
    public_selector_cluster.ctl ‏6 KB
    laptop_test_public.vi ‏12 KB

    nathand wrote:
    You can't do this with a for loop the way the cluster is structured, but why make it so complicated?  Just bundle the new value into the cluster as shown below:
    If you do want to use a for loop, consider restructuring your cluster.  Group the ring and a boolean into a cluster, then drop 7 of those into the selector cluster.  Then you can use "cluster to array" and "array to cluster" since all elements in the outer cluster will be of the same type.
    Also, be careful using rings as type definitions.  You probably want to use an enumeration instead.  The items in a ring do not update when you update the type definition because they're considered to be cosmetic; the items in an enumeration type definition do update, because the items in an enumeration are considered part of the data type.
    Oh my goodness!!
    What was MUCH easier than I was trying to make it!!
    I was attempting to do this reset, in an incremental fashion, as that later, I'm going to need to change values in this cluster by individual elements....and was using this as a way to try to understand how to iterate between cluster elements, and change the values of each one.
    This solution works much better for this 'reset' all solution.
    One question on this....with regard to the enum vs the ring menu.
    I was actually going to go with the enum, however, I could not find a way to make it LOOK like the ring menu...with the arrow to the side that a user would know to click to present the menu list of choices.
    I see with the enum, that you can remove the increment/decrement indicator.....and if the user clicks the control, it will indeed pop up a menu of choices...but there is no 'arrow' on that control to indicate to the user that it is a menu choice there.....
    Is there a way to make and enum look like a ring with the "drop down menu" control look?
    Again, thank you !!
    This helps!
    C

Maybe you are looking for

  • Please note, your reply will need to be approved by a moderator before it is posted in the forum.

    That has never happened to me before. Interesting to say the least. I was merely responding to able123 in a discussion about the Creative Cloud's usage in a non-connected environment. Very odd. I look forward to seeing if it is approved or declined.

  • Ntfs 3.0 to 3.1

    I have an external usb hard drive which has ntfs file system. Recently for a wrong reason I downgraded the ntfs version from 3.1 to 3.0 with Partition Magic. I want to upgrade it back to 3.1 since ntfs 3.0 doesn't support sparse files. I want to crea

  • 3rd Gen 40GB iPod losing connection to computer

    I have a 3rd Gen 40GB iPod that I have replaced the battery in (a long time ago) and it has been working fine for a long time. Recently, in the past month, I haven't been able to use my iPod because when I connect it to the computer via Firewire, the

  • CS5 DNxHD QT failures

    I've got CS5 running on Windows 7 on a 12 core system.  Whenever I try to render a comp. with a source item that uses Avid DNxHD codec, the render fails after about 2 to 8 frames.  It doesn't matter what codec I'm rendering too, although I initially

  • Safari stretch not working

    hi everyone. i just bought myself a new macbook pro. as with my previous one i installed stretch to make the safari screen full size. but it's not working like it used to with my older macbook pro. does anyone have recommendations? thank you very muc