{"id":28,"date":"2008-10-22T00:11:24","date_gmt":"2008-10-22T05:11:24","guid":{"rendered":"http:\/\/chrismeyer.org\/wordpress\/?p=28"},"modified":"2009-05-12T14:10:50","modified_gmt":"2009-05-12T19:10:50","slug":"labview-shared-variable-engine","status":"publish","type":"post","link":"https:\/\/chrismeyer.org\/wordpress\/?p=28","title":{"rendered":"LabVIEW Shared Variable Engine"},"content":{"rendered":"<p>I spent more than 20 minutes trying to figure out the LabVIEW shared variable engine so it&#8217;s worth writing about.\u00a0 My objective was to test the shared variable engine across multiple networked computers, if you are just trying to get the shared variable engine running this post applies to you as well, but you should not follow the steps to configure multiple computers.<\/p>\n<p>The first note, is that they have a good page write up <a href=\"http:\/\/zone.ni.com\/devzone\/cda\/tut\/p\/id\/4679\">regarding shared variables here<\/a>.\u00a0 After reading a little bit about shared variables you should open up LabVIEW, go to:<\/p>\n<p>Help &#8211; Find Examples. . .\u00a0 and search for shared.\u00a0 This will bring up a list of shared variable examples.\u00a0 Open up the &#8220;Shared Variable Client &#8211; Server.lvproj&#8221;.<\/p>\n<p><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-34\" title=\"Step 1\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-1-238x300.jpg\" alt=\"\" width=\"238\" height=\"300\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-1-238x300.jpg 238w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-1.jpg 342w\" sizes=\"auto, (max-width: 238px) 100vw, 238px\" \/><\/a><\/p>\n<p>Now expand the server.lvlib and run &#8220;Variable Server.vi&#8221;.\u00a0 Once you have this up and running, go back to the project explorer and now expand clients.lvlib and run any of the VI&#8217;s from this category &#8211; ie: &#8220;Data Item Binding Client.vi&#8221;.<\/p>\n<p>Now you should have something that looks like:<\/p>\n<div id=\"attachment_35\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-35\" class=\"size-medium wp-image-35\" title=\"Running Server\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-2-300x211.jpg\" alt=\"\" width=\"300\" height=\"211\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-2-300x211.jpg 300w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-2.jpg 632w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-35\" class=\"wp-caption-text\">Running Server<\/p><\/div>\n<div id=\"attachment_36\" style=\"width: 309px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-3.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36\" class=\"size-medium wp-image-36\" title=\"Client Receiving Data\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-3-299x240.jpg\" alt=\"Client Receiving Data\" width=\"299\" height=\"240\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-3-299x240.jpg 299w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-3.jpg 562w\" sizes=\"auto, (max-width: 299px) 100vw, 299px\" \/><\/a><p id=\"caption-attachment-36\" class=\"wp-caption-text\">Client Receiving Data<\/p><\/div>\n<p>What&#8217;s happening is the LabVIEW project is sharing waveform information from the &#8220;server&#8221; in the form of TCP (I had UDP here, it&#8217;s clearly not as this would not have any confirmation of packet receipt &#8211; <a target=\"_Blank\" href=\"http:\/\/www.skullbox.net\/tcpudp.php\">TCP vs. UDP<\/a>) information packets and the &#8220;client&#8221; is listening to the waveform data and initializing communications by sending the server it&#8217;s Client Name.<\/p>\n<p>If you want to get this example running across multiple computers <a href=\"http:\/\/zone.ni.com\/devzone\/cda\/tut\/p\/id\/5715\">you can see some useful information here<\/a>.\u00a0 The idea is that you need to now repeat the above steps on another computer, only this time DON&#8217;T open and run another server, we&#8217;re going to get the Client to read data from the other computer!<\/p>\n<p>First step is to repeat the above and get the example project open on another computer.\u00a0 Once you have the project opened up, let&#8217;s choose to get data from the other computer who is running now as a server.<\/p>\n<p>First double click the &#8220;bound waveform&#8221; variable so we can choose where to get data from.<\/p>\n<div id=\"attachment_37\" style=\"width: 248px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-4.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-37\" class=\"size-medium wp-image-37\" title=\"Double Click Bound Waveform\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-4-238x300.jpg\" alt=\"Double Click Bound Waveform\" width=\"238\" height=\"300\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-4-238x300.jpg 238w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-4.jpg 342w\" sizes=\"auto, (max-width: 238px) 100vw, 238px\" \/><\/a><p id=\"caption-attachment-37\" class=\"wp-caption-text\">Double Click Bound Waveform<\/p><\/div>\n<p>Now check the box &#8220;Bind to Source&#8221;, and click Browse&#8230; and find your other computer who is acting as the server.<\/p>\n<div id=\"attachment_38\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-5.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-38\" class=\"size-medium wp-image-38\" title=\"Bind to Source; Browse. . .\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-5-300x216.jpg\" alt=\"Bind to Source; Browse. . .\" width=\"300\" height=\"216\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-5-300x216.jpg 300w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-5.jpg 661w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-38\" class=\"wp-caption-text\">Bind to Source; Browse. . .<\/p><\/div>\n<div id=\"attachment_39\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-6.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-39\" class=\"size-medium wp-image-39\" title=\"Select Remote Server\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-6-300x243.jpg\" alt=\"Select Remote Server\" width=\"300\" height=\"243\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-6-300x243.jpg 300w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-6.jpg 615w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-39\" class=\"wp-caption-text\">Select Remote Server<\/p><\/div>\n<div id=\"attachment_41\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-7.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-41\" class=\"size-medium wp-image-41\" title=\"Note Change in Binding\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-7-300x216.jpg\" alt=\"Note Change in Binding\" width=\"300\" height=\"216\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-7-300x216.jpg 300w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-7.jpg 661w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-41\" class=\"wp-caption-text\">Note Change in Binding<\/p><\/div>\n<p>Now go back and run any of the client VI&#8217;s and with any luck you should have data running from the server to each of the clients successfully!<\/p>\n<div id=\"attachment_42\" style=\"width: 248px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-8.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42\" class=\"size-medium wp-image-42\" title=\"Open a CLIENT on Another Machine\" src=\"http:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-8-238x300.jpg\" alt=\"Open a CLIENT on Another Machine\" width=\"238\" height=\"300\" srcset=\"https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-8-238x300.jpg 238w, https:\/\/chrismeyer.org\/wordpress\/wp-content\/uploads\/2008\/10\/picture-8.jpg 342w\" sizes=\"auto, (max-width: 238px) 100vw, 238px\" \/><\/a><p id=\"caption-attachment-42\" class=\"wp-caption-text\">Open a CLIENT on Another Machine<\/p><\/div>\n<p>If you create your own VI&#8217;s it&#8217;s very simple to create shared variables, just right click the project, go to new variable and configure it just as you&#8217;ve done above and you should be off and rolling in no time!<\/p>\n<p><input id=\"gwProxy\" type=\"hidden\" \/><\/p>\n<p><!--Session data--><br \/>\n<input id=\"jsProxy\" onclick=\"jsCall();\" type=\"hidden\" \/><\/p>\n<p><input id=\"gwProxy\" type=\"hidden\"><!--Session data--><\/input><input id=\"jsProxy\" onclick=\"jsCall();\" type=\"hidden\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent more than 20 minutes trying to figure out the LabVIEW shared variable engine so it&#8217;s worth writing about.\u00a0 My objective was to test the shared variable engine across multiple networked computers, if you are just trying to get the shared variable engine running this post applies to you as well, but you should [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,21,11],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-college","category-labview","category-mechanical-engineering"],"_links":{"self":[{"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":10,"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chrismeyer.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}