<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to initialize typedef array without loosing the typedef in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202780#M928811</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for the input! I see that this could be achieved a lot easier in my example, but I have to use the given application for now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking for a solution like the one mentioned in (B) but I am missing the preallocated array, because I am transferring data from one larger tyepef to a smaller one (only certain elements). So my inputs are a typedef array narrowed down to the elements I need, the size of this array and a constant of the typedef where the data should go. I thought it would be easiest to somehow initialize the smaller typedef array and then pass the cluster elements I need over in a for loop. The result is then passed to a shared variable of the smaller typedef (Thats why I dont want to loose the typedef).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I go for something like mentioned in (A), would it be good practice to typecast the resulting array into the typedef format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I will look into changing the typedefs as it makes sense what you all say with the arrays. For now I would need a simpler solution though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2015 18:32:20 GMT</pubDate>
    <dc:creator>LukasW</dc:creator>
    <dc:date>2015-10-12T18:32:20Z</dc:date>
    <item>
      <title>How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202762#M928801</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running into problems with initializing a typedef that containts an array of clusters. The attached example updates the Clusters and outputs the new array.&lt;/P&gt;
&lt;P&gt;It works fine but I would rather preallocate the memory for the whole array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I came up with indexing the typedef and using the element for the initialize array vi but with this approach I loose the typedef.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a good way to initialize the typef?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 17:29:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202762#M928801</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-12T17:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202766#M928802</link>
      <description>&lt;P&gt;Why not just define the cluster's type?&amp;nbsp; You don't gain anything by type-def-ing the array.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 17:42:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202766#M928802</guid>
      <dc:creator>jcarmody</dc:creator>
      <dc:date>2015-10-12T17:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202773#M928806</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your fast reply, I forgot to mention that I'm working on some sub VIs in a bigger application that already exists. I will check how much work it would be to change the definitions and everything that relys on them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any solution that works with the typedef array would be welcome!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 18:10:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202773#M928806</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-12T18:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202774#M928807</link>
      <description>&lt;P&gt;Rule of thumb: Never type define an array.&amp;nbsp; Type define the data type of the array.&amp;nbsp; Why?&amp;nbsp; So that you can do whatever it is you need to on a single element of the array and keep your type defs in order.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 18:13:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202774#M928807</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2015-10-12T18:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202776#M928809</link>
      <description>&lt;P&gt;Yes, as Jim already said, you should typedef the array element, not the array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, your code is overly complicated and potentially nullifies certain compiler optimizations. Unconditionally building an array in a loop is best done using autoindexing, because it is much easier to determine the final array size, esepcially if the code is a bit more complicated. Now the output array is guaranteed to be allocated at the correct size at the start of the loop. (case A in picture).&lt;EM&gt; (Yes, the compiler will probably recognize your code construct and create the same output. Still, it helps to keep the diagram simple. Fewer places where bugs can hide ;))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to work with a pre-allocated array (e.g. it it already exists but some elements need to be updated), you would use something similar to case (B). OF course you would replace "initialize array" with the wire from the existing array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="https://ni.lithium.com/ni/attachments/ni/170/928809/1/TypedefElement.png" border="0" alt="" title="" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 18:18:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202776#M928809</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-12T18:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202780#M928811</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for the input! I see that this could be achieved a lot easier in my example, but I have to use the given application for now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking for a solution like the one mentioned in (B) but I am missing the preallocated array, because I am transferring data from one larger tyepef to a smaller one (only certain elements). So my inputs are a typedef array narrowed down to the elements I need, the size of this array and a constant of the typedef where the data should go. I thought it would be easiest to somehow initialize the smaller typedef array and then pass the cluster elements I need over in a for loop. The result is then passed to a shared variable of the smaller typedef (Thats why I dont want to loose the typedef).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I go for something like mentioned in (A), would it be good practice to typecast the resulting array into the typedef format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I will look into changing the typedefs as it makes sense what you all say with the arrays. For now I would need a simpler solution though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 18:32:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202780#M928811</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-12T18:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202784#M928814</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@LukasWörle wrote:&lt;BR /&gt;
&lt;P&gt;If I go for something like mentioned in (A), would it be good practice to typecast the resulting array into the typedef format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, probably not. The elements of the output array are still typedefd, because that's how we define them at the bundle node.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@LukasWörle wrote:&lt;BR /&gt;
&lt;P&gt;I am looking for a solution like the one mentioned in (B) but I am missing the preallocated array, because I am transferring data from one larger tyepef to a smaller one (only certain elements). So my inputs are a typedef array narrowed down to the elements I need, the size of this array and a constant of the typedef where the data should go. I thought it would be easiest to somehow initialize the smaller typedef array and then pass the cluster elements I need over in a for loop. The result is then passed to a shared variable of the smaller typedef (Thats why I dont want to loose the typedef).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If I understand you right, you probably want to do A, autoindexing on an array of indices of the elements you want to retain and using index array inside the loop, autoindexing at the output tunnel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise please provide more detail, maybe with some example data and expected result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 18:45:40 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3202784#M928814</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-12T18:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203000#M928900</link>
      <description>&lt;P&gt;I just made a new example with a bit more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see I have a config cluster that is mainly used to setup daqmx channels and an output cluster that should hold some of the config information and the measurement values. Both of them are typedefed and unfortunately already contain the array in the typedef.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A: This code works but I do not really like how the array has to be indexed and then put into another array plus the typedef gets lost on the way.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/t5/image/serverpage/image-id/173419i9B44E547E27E34FC/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="TD_Array_wo_typedef.PNG" title="TD_Array_wo_typedef.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B: Looks better to me, but now I can not initialize the array before passing it to the loop. While posting this I just came up with a new question: Is the shift register already preallocated because of the for loop?&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/t5/image/serverpage/image-id/173420iADF0AAB012032B38/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="TD_Array_wo_allocation.PNG" title="TD_Array_wo_allocation.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also attached both VIs plus the typedefs. Btw I couldn't find a guideline to which LV version to use for examples, is 10 alright? (I'm using 14)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 07:58:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203000#M928900</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-13T07:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203110#M928959</link>
      <description>&lt;P&gt;Again, you are doing this way too convoluted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are still not typedefing the array element instead of the array, so change that!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I said, all you need is autoindexing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In A,, you don't need to initialize the upper array, just get the element and don't autoindex on top. Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simplfy! Here's how it could look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/ni/attachments/ni/170/928959/1/ClusterArray.png" border="0" alt="" title="" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 12:38:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203110#M928959</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-13T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203565#M929118</link>
      <description>&lt;P&gt;&amp;gt;You are still not typedefing the array element instead of the array, so change that!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I said that's just not possible at the moment. I would have to change an application with 100+ VIs. I will look into that as it is the best solution but that will take some time (first I have to understand the whole application).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;In A,, you don't need to initialize the upper array, just get the element and don't autoindex on top. Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good point, I didn't realize that!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In (B) will the shift register be preallocated because of the autoindexed for loop? If yes this could be my workaround for now.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 07:36:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203565#M929118</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-14T07:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203827#M929227</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/331641"&gt;@LukasW&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;In (B) will the shift register be preallocated because of the autoindexed for loop? If yes this could be my workaround for now.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you autoindex at the output tunnel of a FOR loop as in my case, the output array gets preallocated automatically at the correct size, no need to initialize, shift registers, and such.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 16:40:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3203827#M929227</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-14T16:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204123#M929332</link>
      <description>&lt;P&gt;I just found a solution: With reshape array I can change the dimension of the typedefed array and keep the typedef.&lt;/P&gt;
&lt;P&gt;It looks like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/t5/image/serverpage/image-id/173518i03374BAEBE7BDA27/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="td_array_prealloc_td.PNG" title="td_array_prealloc_td.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Autoindexing instead of using the shift register would be a lot nicer but looses the typedef. If I manage to get rid of the array in the typedef I will use the autoindexed tunnel as you suggested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tested a few versions regarding loop times. The test generates 1000 entries for the typedefed array, for a typedef without array and doubles. Those are then passed to the different VIs, which execute 100 times to get some sort of a mean loop time. The VIs output the total time taken to execute the for loop in µs.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/t5/image/serverpage/image-id/173521i9FAE2031E260103C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="td_speetest.PNG" title="td_speetest.PNG" width="992" height="207" /&gt;&lt;/P&gt;
&lt;P&gt;I tested the following approaches:&lt;/P&gt;
&lt;P&gt;- Typedef without array, autoindexed loop&lt;/P&gt;
&lt;P&gt;- Typedef without array, shift register with preallocated array&lt;/P&gt;
&lt;P&gt;- Typedef with array, shift register with preallocated array (respahe array function)&lt;/P&gt;
&lt;P&gt;- Typedef with array, shift register with no preallocation (empty array)&lt;/P&gt;
&lt;P&gt;- Typedef with array, autoindexed loop, no typedefed output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those are the times for processing 1000 entries per array:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/t5/image/serverpage/image-id/173523i204085C8EE73DCBD/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="td_array_looptimes.PNG" title="td_array_looptimes.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the shiftregister without an initialized array is the only version that is noticeably slower I think that even though the for loop has a fixed number of iterations the shift register does not get preallocated in the right size.&lt;/P&gt;
&lt;P&gt;I just did this out of couriosity because the reshape array method allows to initialize the shift register while keeping the typedef anyway. I though I might share this, maybe it is interesting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 09:33:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204123#M929332</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-15T09:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204293#M929394</link>
      <description>&lt;P&gt;I don't see the timing code. What's in the subVI? Can you attach your benchmarking code?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 15:09:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204293#M929394</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-15T15:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204350#M929424</link>
      <description>&lt;P&gt;Sorry I forgot to attach the project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The subVIs contain the different approaches as discussed here, the timing code is also inside the subVI (only measuring the for loop).&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 16:44:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204350#M929424</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-15T16:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204382#M929437</link>
      <description>&lt;P&gt;Just to muddy the waters a little... make a "Strings and Values" property node (for something that has strings and values, of course).&amp;nbsp; What is it?&amp;nbsp; A typedef'd array, of course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still against it, though.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 17:50:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204382#M929437</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2015-10-15T17:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204391#M929438</link>
      <description>&lt;P&gt;Not bad, but not enough. &amp;nbsp;In LabVIEW, you&amp;nbsp;&lt;U&gt;can&lt;/U&gt; have your Cake and Eat It, Too. &amp;nbsp;I made the following minor change to your code, which mimics a technique I use, myself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have two base Cluster TypeDefs, Config and Output. &amp;nbsp;If you look at my version of these clusters (you can see an example in the Snippet), you'll notice that I made an Icon for it. &amp;nbsp;Turns out there's a poorly-known feature that NI introduced around LabVIEW 2012 (maybe 2011?) that lets you right-click on a Cluster constant having a TypeDef and replace the Cluster (which can be huge, by the way -- I've got one with 160 elements) with its Icon. &amp;nbsp;Pretty self-documenting, I'd say.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now look at your Array TypeDefs. &amp;nbsp;I remade them as follows -- I dropped down an Array container, then into it I put one of the Cluster TypeDefs. &amp;nbsp;So Config Array is an Array of Config (TypeDef). &amp;nbsp;This is where you Have Your Cake, as you have now consistent TypeDefs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I modified only two of your tests (one shown here). &amp;nbsp;The changes were simple -- where your Front Panel control was your "old-style" array, I just right-clicked it, chose "Replace", "Choose a Control", and substituted my new TypeDef. &amp;nbsp;If you are a fan of QuickDrop, it's even easier -- click-select, Ctrl-space, start typing the new Typedef name until it appears, P (replace).&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/f53d238f674f81d194aa24ac7dc1d0c5c2067b19/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373335353169383138374132364435333146323045372f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Neuer und Besser.png" title="Neuer und Besser.png" /&gt;&lt;/P&gt;
&lt;P&gt;Bob Schor&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 18:15:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204391#M929438</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2015-10-15T18:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204413#M929447</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/95728"&gt;@Bob_Schor&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Not bad, but not enough. &amp;nbsp;In LabVIEW, you&amp;nbsp;&lt;U&gt;can&lt;/U&gt; have your Cake and Eat It, Too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But your VI has a &lt;U&gt;coercion dot&lt;/U&gt; at the output array, which the OP was trying to avoid (thus this entire discussion). Of course we need to remind us that this is probably a &lt;U&gt;painless coercion&lt;/U&gt;, which does not involve any significant effort for the compiler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(You only have typedef'd array elements while he has a typedef'd array of the same structure)&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 18:46:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204413#M929447</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-15T18:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204472#M929472</link>
      <description>&lt;P&gt;Yep, there is a coercion dot. &amp;nbsp;If you look at the type of the Wire, it is 1D Array of Output (TypeDef Output.ctl), while the Indicator is of type Output Array (TypeDef Output Array.ctl), which is a 1D Array of Output (TypeDef Output.ctl).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While TypeDefs are definitely a Good Thing, one needs to recognize that sometimes wiring a value that is the very definition of the TypeDef into an indicator that explicitly&amp;nbsp;&lt;U&gt;is&lt;/U&gt; the TypeDef will cause such a coercion dot, which as you note, has no real meaning (as the only thing being "coerced" is what you call the collection, no data-changing takes place, and it would be interesting if any significant code (= CPU cycles) is generated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was&amp;nbsp;&lt;U&gt;going&lt;/U&gt; to conclude that if this really bothers you, you can always do a TypeCast, but that doesn't seem to work for compound types. &amp;nbsp;I've "loosened" my "No Coercion Dots!" stance a bit in favor of "Use TypeDefs to Organize and Document Data!", and accept the occasional exceptions (which tend to be easy to spot). &amp;nbsp;After all, if the coder knows that the Output Array indicator is of type "Output Array", and sees that it is being created from an array built of type Output, he (or she) should be able to shrug and say "OK, LabVIEW has given me a "technical" Coercion Dot, I'll live with it ...".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bob Schor&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 21:02:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204472#M929472</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2015-10-15T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204644#M929508</link>
      <description>&lt;P&gt;I was thought to avoid coercion dots but I'll keep in mind that in this case it probably doesn't really do anything.&lt;/P&gt;
&lt;P&gt;A bit off the original topic but interesting now: If I need to calculate something out of say a Double and an Int32 is there any benefit in using the conversion functions to avoid the coercion dot or will it do just the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The cluster icon is definitely a really useful feature I'm using a lot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any benefit in having e.g. a Control typedef plus an Array of Control typedef? I see the point of going from the Array typedef to just the cluster and then put in into an array if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 07:06:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204644#M929508</guid>
      <dc:creator>LukasW</dc:creator>
      <dc:date>2015-10-16T07:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize typedef array without loosing the typedef</title>
      <link>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204652#M929511</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/331641"&gt;@LukasW&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I was thought to avoid coercion dots but I'll keep in mind that in this case it probably doesn't really do anything.&lt;/P&gt;
&lt;P&gt;A bit off the original topic but interesting now: If I need to calculate something out of say a Double and an Int32 is there any benefit in using the conversion functions to avoid the coercion dot or will it do just the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://ni.lithium.com/t5/LabVIEW/Dealing-with-Coercion-Dots/m-p/926925#M416411" target="_blank"&gt;Here is some easy reading from a few years ago&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/331641"&gt;@LukasW&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any benefit in having e.g. a Control typedef plus an Array of Control typedef? I see the point of going from the Array typedef to just the cluster and then put in into an array if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would just typedef the element. Especially if it is a cluster (as in your case) it defines&amp;nbsp;the unique and important data structure. Going to an array just repeats that same structure N time and you are not really adding any useful information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 07:35:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/How-to-initialize-typedef-array-without-loosing-the-typedef/m-p/3204652#M929511</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-10-16T07:35:24Z</dc:date>
    </item>
  </channel>
</rss>

