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

Similar Messages

  • 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

  • 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

  • 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

  • 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.
     

  • 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

  • Write 2D data array to spreadsheet with good alignment

    Using "write to spreadsheet file" function to write 2D array,   I always have the problem that headers cannot align well wiith the data. See attached snapshot please (There are 7 column headers.)
    WT
    LV2013sp1
    Solved!
    Go to Solution.

    Plain text display cannot handle tabs very well.
    You can take the spreadsheet file and open it in e.g. excel and it will all look great. Spreadsheet files have no formatting information, just row and column delimiters.
    If you want to create nicely formatted report files in LabVIEW, use the report generation tools and pick an output file format that is suitable for what you want to display (e.g. html).
    If you want to display your data in a plain text indicator, you would need to do two things:
    use a fixed-width font (e.g. courier)
    Format all fields with a fixed widh of padding characters.
    For a tabular front panel indicator, you should use a table. You can write the header strings into the table header.
    LabVIEW Champion . Do more with less code and in less time .

  • 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!

  • 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

  • Use of Write Key VI with an array of cluster

    Hi,
    I wanted to use an array of clusters to define some configuration parameters for an application. Unfortunately, "Write Key VI" doesn't support the cluster type. Has anybody modified this function ("Write Key VI") to support cluster and array of cluster? If not, any clue to keep it as simple as possible?
    My clusters include boolean, path, U32 and string.
    Thank you,
    Olivier 
    Solved!
    Go to Solution.

    OD wrote:
    Couldn't log to this website. Any alternative ?
    Sure see this Nugget.
    I have links for other methods included but the Nugget does exactly what you are asking to do. I wrote th Nugget to entertain other developers, but in the end is serves as an example why you may want to find another approach. You'll understand what I mean once you look at that Nugget.
    Parapharisng from Jurrasic Park "Just because could do something does not mean we should."
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • 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

  • Array of cluster to array of element - or - Cluster of arrays?

    Hi all,
    I have a large cluster (lets call it C_data) containing measured data e.g. 10 Temperatures, Pressure, (Temp_1, ...).....
    All these data are measured once per second. I now collect all data
    measured over a certain time in an array of the aforementioned cluster,
    that is
    an array of C_data. In order to display time series of data in graphs I
    need to extract arrays of elements from this array of C_data.
    In a text based programming language this could look like the following:
    Struct C_data {Temp_1, Temp_2, P_1.....}
    ar_C_data is an array of C_data
    now I want to do something like:
    array_of_Temp_1 = ar_C_data[*].Temp_1
    In some programming languages this works but I cannot unbundle_by_name the array of Temp_1 from ar_data in Labview.
    Since my cluster is large and may change in structure (for this reason I use a typedef) a generic solution would be the best.
    I know that I could: loop over all elements of ar_C_data, unbundle by
    name, index elements into arrays, and use these but this seems very
    inefficient if it is done every second on a large cluster (30 elements) with several thousand array elements....
    Olaf

    You can minimize the overhead of scanning through all elements and extracting if you pre-define the array and use "replace array subset".  This avoide having to re-size the array which is costly.
    Or you can keep an array separately in memory.  When one cluster element is added, the corresponding element is added to the array too.  Causes some memory overhead, but you're going to have that anyway if you generate them "on the fly".
    I don't see a way to do this other than either search through the array and pick the elements you need -or-
    keep a copy of the data in a form you can use.
    It's a common question of how to structure data to best suit two sometimes conflicting needs - efficiency and useability.
    What might be of interest is to change the "Array" - "Cluster" order and have a single cluster C-Data with arrays of each element required.  Might be a bit more difficult to use, it depends on your application.
    This way you have all arrays ready at all times, but generating a single cluster requires bundling the individual units on the fly.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Add element to array of cluster

    I have an array of cluster. Cluster contains two elements. How to add an element in cluster at run time on the second position efficiently? In other words dont want another copy of cluster which contains three elements and copy the original two elements plus the new element. 
    Original array of cluster lets say has two element Temp1 and Pressure 1.
    Need to add another element in cluster and now the array of cluster will be Temp1, Volt1 and Pressure 1. So Volt 1 is added to all cluster elements at second order throughout the array of clusters programatically. 
    CLD,CTD
    Attachments:
    TestAddElementToCluster.vi ‏10 KB

    It is unclear from your original post what the problem you need to solve actually is.  Are you trying to create a user interface?  Do you need to dynamically add arbitrary data to a data set, or is it a fixed set of functionality that can be dynamically changed in predetermined ways?
    Having done it, I will recommend you not try the scripting and subpanels approach.  There are almost always better ways.
    Remember that your data structures do not need to mirror your user interface.  If you were trying to display the temperature, voltage, and pressure data to the user, a multicolumn listbox may be more appropriate than a raw cluster in an array.  Internally, this would allow you to maintain the temperature, voltage, and pressure as separate arrays and only display the ones you want in the listbox.
    Please give us a more information on the problem so we can help you with an easier solution.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

Maybe you are looking for