{"id":345,"date":"2012-06-12T09:15:00","date_gmt":"2012-06-12T14:15:00","guid":{"rendered":"http:\/\/labviewjournal.com\/?p=345"},"modified":"2019-07-30T17:35:07","modified_gmt":"2019-07-30T22:35:07","slug":"maintaining-state-5","status":"publish","type":"post","link":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/","title":{"rendered":"Maintaining State Information in LabVIEW Applications, Part 5"},"content":{"rendered":"<p>In my <a href=\"http:\/\/labviewjournal.com\/2012\/06\/maintaining-state-4\/\" target=\"_blank\" rel=\"noopener noreferrer\">last post<\/a>, I showed one of the big downsides of using preallocated clones\u2014when you have a large hierarchy of preallocated reentrant VIs, the number of clones in memory can get big fast.<\/p>\n<p>In this post, I want to clarify one thing about reentrant hierarchies, and then start talking about how to work our way out of these programming problems.<\/p>\n<p><!--more--><\/p>\n<p>From the last post, recall this hierarchy\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/05\/ABC-Big.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-321 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/05\/ABC-Big.png?resize=817%2C209&#038;ssl=1\" alt=\"\" width=\"817\" height=\"209\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/05\/ABC-Big.png?w=817&amp;ssl=1 817w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/05\/ABC-Big.png?resize=300%2C77&amp;ssl=1 300w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/05\/ABC-Big.png?resize=768%2C196&amp;ssl=1 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/a><\/p>\n<p>One of the things I wasn\u2019t clear about is that I chose to make both B and C reentrant.\u00a0 But I didn\u2019t have to.\u00a0 I could have, for example, made C non-reentrant\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/ABC-C-not-reentrant.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-330 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/ABC-C-not-reentrant.png?resize=229%2C194&#038;ssl=1\" alt=\"\" width=\"229\" height=\"194\" \/><\/a><\/p>\n<p>What this means, though, is that even though we have three clones of B, they all have to share a single clone of C.\u00a0 This means that only one copy of C can run at a time, which might obviate the benefits of making B reentrant.\u00a0 (As always, it depends on your application.\u00a0 If C is called only occasionally, then it may not affect performance of the rest of B\u2019s diagram.)<\/p>\n<p>The main takeaway is that if you want the entire hierarchy to be reentrant, you have to set it on each VI in the hierarchy; it\u2019s not automatically inherited from the caller.\u00a0 This gives you some flexibility on the time vs. space tradeoff.<\/p>\n<hr \/>\n<p>Okay, so this series of blog posts is supposed to be about maintaining state, though we\u2019ve made a big but important detour through reentrancy.<\/p>\n<p>When we want a VI to maintain state, as well as be reentrant, what do we do?\u00a0 I never showed you the diagram for the running average VI\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Mean-PtByPt-Diagram.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-332 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Mean-PtByPt-Diagram.png?resize=924%2C735&#038;ssl=1\" alt=\"\" width=\"924\" height=\"735\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Mean-PtByPt-Diagram.png?w=924&amp;ssl=1 924w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Mean-PtByPt-Diagram.png?resize=300%2C239&amp;ssl=1 300w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Mean-PtByPt-Diagram.png?resize=768%2C611&amp;ssl=1 768w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/a><\/p>\n<p>I won\u2019t get into the details of how it works; it\u2019s not as easy as you might have expected.\u00a0 (It\u2019s also not as well-commented as I would have expected. <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-334\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/wlEmoticon-surprisedsmile.png?resize=19%2C19&#038;ssl=1\" alt=\"\" width=\"19\" height=\"19\" \/>\u00a0)\u00a0 What I want to point out is the set of eight uninitialized shift registers on the left hand side of the loop.\u00a0 That\u2019s where the state information is kept.<\/p>\n<p>The state needed for this VI includes the running sum of data, the array of values that the VI remembers, the length of that array, the state of the internal state machine, error information, etc.<\/p>\n<p>To let this VI use shared clones (and thus use less memory if this VI is called a lot), we need to move the state information out of this VI.\u00a0 How do we do that?\u00a0 Here\u2019s one proposal: move the while loop up to the caller.\u00a0 It only runs once; it only exists to give the uninitialized shift registers a place to live.<\/p>\n<p>In my first attempt to change this VI, I selected everything inside the loop and chose the \u201cEdit \u2013&gt; Create SubVI\u201d menu item.\u00a0 Definitely a first attempt that needs some refinement. Here\u2019s the new subVI\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CreateSubVI.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-335 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CreateSubVI.png?resize=740%2C557&#038;ssl=1\" alt=\"\" width=\"740\" height=\"557\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CreateSubVI.png?w=740&amp;ssl=1 740w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CreateSubVI.png?resize=300%2C226&amp;ssl=1 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<p>And here\u2019s what the caller now looks like\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CallerAfterCreateSubVI.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-337 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CallerAfterCreateSubVI.png?resize=688%2C334&#038;ssl=1\" alt=\"\" width=\"688\" height=\"334\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CallerAfterCreateSubVI.png?w=688&amp;ssl=1 688w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/CallerAfterCreateSubVI.png?resize=300%2C146&amp;ssl=1 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/a><\/p>\n<p>It\u2019s kind of ugly, but it actually does solve the problem.\u00a0 The new subVI no longer has any state information in it. The state is all maintained at a higher level.<\/p>\n<p>How can I improve this?<\/p>\n<p>First, the new subVI doesn\u2019t actually compute the average; that part was kept at the higher level VI.\u00a0 To be useful as a subVI, we should also move this code into the new subVI, so that it doesn\u2019t have to exist in the caller.<\/p>\n<p>Second, the caller\u2019s code is clearly overwhelming with eight different inputs and outputs that it now has to keep track of somehow.\u00a0 These aren\u2019t formally part of the API; they\u2019re just needed to store state information for the VI to operate.\u00a0 My next attempt would be to put all of those in a cluster and make it a single cluster of state information (with eight elements inside the cluster) for the caller to maintain.\u00a0 In computer science terms, this is called an \u201copaque\u201d data structure.\u00a0 The caller doesn\u2019t have to know what\u2019s inside; they just have to hang on to it for us from one call to the next.<\/p>\n<p>Here\u2019s a cleaner version\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Avg-with-State.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-339 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Avg-with-State.png?resize=1828%2C542&#038;ssl=1\" alt=\"\" width=\"1828\" height=\"542\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Avg-with-State.png?w=1828&amp;ssl=1 1828w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Avg-with-State.png?resize=300%2C89&amp;ssl=1 300w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Avg-with-State.png?resize=768%2C228&amp;ssl=1 768w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Avg-with-State.png?resize=1024%2C304&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p>And by the way, since I\u2019m changing the connector pane, another change I would probably make would be to use an error cluster instead of an error code.<\/p>\n<p>Here\u2019s the before and after of the calling diagram.\u00a0 Here\u2019s the original VI, where the state was maintained inside the subVI\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/twochan-diagram.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-341 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/twochan-diagram.png?resize=737%2C259&#038;ssl=1\" alt=\"\" width=\"737\" height=\"259\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/twochan-diagram.png?w=737&amp;ssl=1 737w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/twochan-diagram.png?resize=300%2C105&amp;ssl=1 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/p>\n<p>Here\u2019s the after.\u00a0 This one uses shift registers to maintain the state cluster\u2026<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Running-Average-with-State.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-343 size-full\" src=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Running-Average-with-State.png?resize=797%2C327&#038;ssl=1\" alt=\"\" width=\"797\" height=\"327\" srcset=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Running-Average-with-State.png?w=797&amp;ssl=1 797w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Running-Average-with-State.png?resize=300%2C123&amp;ssl=1 300w, https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2012\/06\/Running-Average-with-State.png?resize=768%2C315&amp;ssl=1 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/a><\/p>\n<p>Other than the addition of the pink wires, nothing else changes much for the caller.\u00a0 The big benefit, of course, is that the \u201cRunning Average\u201d subVI can now be made into a shared-clone reentrant VI, which can save memory.<\/p>\n<p>Can this be further improved?\u00a0 You tell me.\u00a0 What are your suggestions?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last post, I showed one of the big downsides of using preallocated clones\u2014when you have a large hierarchy of preallocated reentrant VIs, the number of clones in memory can get big fast. In this post, I want to clarify one thing about reentrant hierarchies, and then start talking about how to work our [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":128,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[20,34,41,59,65],"class_list":["post-345","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-clones","tag-fgv","tag-labview","tag-reentrancy","tag-state"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Maintaining State Information in LabVIEW Applications, Part 5 - LabVIEW Field Journal Archives<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maintaining State Information in LabVIEW Applications, Part 5 - LabVIEW Field Journal Archives\" \/>\n<meta property=\"og:description\" content=\"In my last post, I showed one of the big downsides of using preallocated clones\u2014when you have a large hierarchy of preallocated reentrant VIs, the number of clones in memory can get big fast. In this post, I want to clarify one thing about reentrant hierarchies, and then start talking about how to work our [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/\" \/>\n<meta property=\"og:site_name\" content=\"LabVIEW Field Journal Archives\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-12T14:15:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-30T22:35:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"100\" \/>\n\t<meta property=\"og:image:height\" content=\"100\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Brian\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brian\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/\"},\"author\":{\"name\":\"Brian\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#\\\/schema\\\/person\\\/5a7979adfffe497f72353515e7e4698b\"},\"headline\":\"Maintaining State Information in LabVIEW Applications, Part 5\",\"datePublished\":\"2012-06-12T14:15:00+00:00\",\"dateModified\":\"2019-07-30T22:35:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/\"},\"wordCount\":804,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/stravaro.com\\\/lvjournal\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2011\\\/07\\\/brian_square.png?fit=100%2C100&ssl=1\",\"keywords\":[\"clones\",\"FGV\",\"LabVIEW\",\"reentrancy\",\"state\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/\",\"url\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/\",\"name\":\"Maintaining State Information in LabVIEW Applications, Part 5 - LabVIEW Field Journal Archives\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/stravaro.com\\\/lvjournal\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2011\\\/07\\\/brian_square.png?fit=100%2C100&ssl=1\",\"datePublished\":\"2012-06-12T14:15:00+00:00\",\"dateModified\":\"2019-07-30T22:35:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/stravaro.com\\\/lvjournal\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2011\\\/07\\\/brian_square.png?fit=100%2C100&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/stravaro.com\\\/lvjournal\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2011\\\/07\\\/brian_square.png?fit=100%2C100&ssl=1\",\"width\":100,\"height\":100,\"caption\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/2012\\\/06\\\/maintaining-state-5\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Maintaining State Information in LabVIEW Applications, Part 5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#website\",\"url\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/\",\"name\":\"LabVIEW Field Journal Archives\",\"description\":\"Advanced LabVIEW with the NI Field Architects\",\"publisher\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#organization\",\"name\":\"Stravaro, LLC\",\"url\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/stravaro.com\\\/lvjournal\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2014\\\/10\\\/Twitter_Logo_512-54543176_site_icon.png?fit=512%2C512&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/stravaro.com\\\/lvjournal\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2014\\\/10\\\/Twitter_Logo_512-54543176_site_icon.png?fit=512%2C512&ssl=1\",\"width\":512,\"height\":512,\"caption\":\"Stravaro, LLC\"},\"image\":{\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/#\\\/schema\\\/person\\\/5a7979adfffe497f72353515e7e4698b\",\"name\":\"Brian\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b65e73e808770fb97191694e008a472c044ef97914aa71f86b7ce1987dd0bf3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b65e73e808770fb97191694e008a472c044ef97914aa71f86b7ce1987dd0bf3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b65e73e808770fb97191694e008a472c044ef97914aa71f86b7ce1987dd0bf3?s=96&d=mm&r=g\",\"caption\":\"Brian\"},\"sameAs\":[\"https:\\\/\\\/stravaro.com\\\/\"],\"url\":\"https:\\\/\\\/stravaro.com\\\/lvjournal\\\/author\\\/brian\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Maintaining State Information in LabVIEW Applications, Part 5 - LabVIEW Field Journal Archives","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/","og_locale":"en_US","og_type":"article","og_title":"Maintaining State Information in LabVIEW Applications, Part 5 - LabVIEW Field Journal Archives","og_description":"In my last post, I showed one of the big downsides of using preallocated clones\u2014when you have a large hierarchy of preallocated reentrant VIs, the number of clones in memory can get big fast. In this post, I want to clarify one thing about reentrant hierarchies, and then start talking about how to work our [&hellip;]","og_url":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/","og_site_name":"LabVIEW Field Journal Archives","article_published_time":"2012-06-12T14:15:00+00:00","article_modified_time":"2019-07-30T22:35:07+00:00","og_image":[{"width":100,"height":100,"url":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1","type":"image\/png"}],"author":"Brian","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Brian","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#article","isPartOf":{"@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/"},"author":{"name":"Brian","@id":"https:\/\/stravaro.com\/lvjournal\/#\/schema\/person\/5a7979adfffe497f72353515e7e4698b"},"headline":"Maintaining State Information in LabVIEW Applications, Part 5","datePublished":"2012-06-12T14:15:00+00:00","dateModified":"2019-07-30T22:35:07+00:00","mainEntityOfPage":{"@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/"},"wordCount":804,"commentCount":8,"publisher":{"@id":"https:\/\/stravaro.com\/lvjournal\/#organization"},"image":{"@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1","keywords":["clones","FGV","LabVIEW","reentrancy","state"],"articleSection":["Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/","url":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/","name":"Maintaining State Information in LabVIEW Applications, Part 5 - LabVIEW Field Journal Archives","isPartOf":{"@id":"https:\/\/stravaro.com\/lvjournal\/#website"},"primaryImageOfPage":{"@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#primaryimage"},"image":{"@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1","datePublished":"2012-06-12T14:15:00+00:00","dateModified":"2019-07-30T22:35:07+00:00","breadcrumb":{"@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#primaryimage","url":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1","contentUrl":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1","width":100,"height":100,"caption":""},{"@type":"BreadcrumbList","@id":"https:\/\/stravaro.com\/lvjournal\/2012\/06\/maintaining-state-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/stravaro.com\/lvjournal\/"},{"@type":"ListItem","position":2,"name":"Maintaining State Information in LabVIEW Applications, Part 5"}]},{"@type":"WebSite","@id":"https:\/\/stravaro.com\/lvjournal\/#website","url":"https:\/\/stravaro.com\/lvjournal\/","name":"LabVIEW Field Journal Archives","description":"Advanced LabVIEW with the NI Field Architects","publisher":{"@id":"https:\/\/stravaro.com\/lvjournal\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stravaro.com\/lvjournal\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/stravaro.com\/lvjournal\/#organization","name":"Stravaro, LLC","url":"https:\/\/stravaro.com\/lvjournal\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stravaro.com\/lvjournal\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2014\/10\/Twitter_Logo_512-54543176_site_icon.png?fit=512%2C512&ssl=1","contentUrl":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2014\/10\/Twitter_Logo_512-54543176_site_icon.png?fit=512%2C512&ssl=1","width":512,"height":512,"caption":"Stravaro, LLC"},"image":{"@id":"https:\/\/stravaro.com\/lvjournal\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/stravaro.com\/lvjournal\/#\/schema\/person\/5a7979adfffe497f72353515e7e4698b","name":"Brian","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1b65e73e808770fb97191694e008a472c044ef97914aa71f86b7ce1987dd0bf3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1b65e73e808770fb97191694e008a472c044ef97914aa71f86b7ce1987dd0bf3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b65e73e808770fb97191694e008a472c044ef97914aa71f86b7ce1987dd0bf3?s=96&d=mm&r=g","caption":"Brian"},"sameAs":["https:\/\/stravaro.com\/"],"url":"https:\/\/stravaro.com\/lvjournal\/author\/brian\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/stravaro.com\/lvjournal\/wp-content\/uploads\/sites\/2\/2011\/07\/brian_square.png?fit=100%2C100&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":3,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"predecessor-version":[{"id":643,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/posts\/345\/revisions\/643"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/media\/128"}],"wp:attachment":[{"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stravaro.com\/lvjournal\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}