{"id":19925,"date":"2017-04-12T10:02:36","date_gmt":"2017-04-12T17:02:36","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=19925"},"modified":"2017-04-12T10:02:36","modified_gmt":"2017-04-12T17:02:36","slug":"how-linx-works","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/how-linx-works\/","title":{"rendered":"How LINX Works"},"content":{"rendered":"<p>LINX provides easy to use <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a>\u00a0VI&#8217;s for interacting with common embedded platforms like Arduino, <a href=\"https:\/\/digilent.com\/shop\/search.php?Search=&amp;search_query=chipkit\">chipKIT<\/a>, and <a href=\"https:\/\/digilent.com\/shop\/ni-myrio-student-edition\/\">myRIO<\/a>. With <a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:tutorials:libraries:linx:3-0:beaglebone-black-setup\">LINX 3.0<\/a>, the software has been expanded to support the <a href=\"https:\/\/digilent.com\/shop\/labview-physical-computing-kit-for-raspberry-pi-2-limited-time-see-stand-alone-labview-home-bundle\/\">Raspberry Pi<\/a> and the <a href=\"https:\/\/digilent.com\/shop\/beaglebone-black\/\">BeagleBone Black<\/a>, enabling the boards to run LabVIEW code. LINX allows you to use the built-in sensor VIs to start getting data to your PC in seconds or use the peripheral VIs to access your devices\u00a0digital \u00a0I\/O, analog I\/O, SPI, I2C, UART, PWM and more. In this post, I will give a brief overview of how LINX works.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19937 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/makerhub_large_logo_medium-600x338.png\" alt=\"\" width=\"600\" height=\"338\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/makerhub_large_logo_medium-600x338.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/makerhub_large_logo_medium.png 640w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>At its heart, <a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:tutorials:libraries:linx:3-0:beaglebone-black-setup\">LINX<\/a> is a hardware abstraction layer that allows you to have a single LabVIEW interface to a variety of different hardware devices. Depending on the device, you can access it in one of two ways: Remote or Local I\/O<\/p>\n<h3 id=\"remote_io\">Remote I\/O<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19936 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_remoteio-600x272.png\" alt=\"\" width=\"600\" height=\"272\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_remoteio-600x272.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_remoteio-768x348.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_remoteio-1024x464.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_remoteio-800x363.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_remoteio.png 1149w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>Remote I\/O works by running <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a> VIs on the development PC. In this configuration, the <a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:tutorials:libraries:linx:3-0:beaglebone-black-setup\">LINX<\/a> VIs send commands to LINX firmware running on a device connected to the development computer by a USB, WiFi, or Ethernet connection. These commands tell the firmware to perform pre-defined actions such as reading an analog input or setting a digital output high. Devices that use Remote I\/O are Arduino, <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">chipKITs<\/a>, ESP8266s, and many others. Details on how the protocol works and information on specific commands is available <a class=\"wikilink1\" title=\"learn:libraries:linx:spec:start\" href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:libraries:linx:spec:start\">here<\/a>.<\/p>\n<h3 id=\"local_io\">Local I\/O<img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19935 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio-600x258.png\" alt=\"\" width=\"600\" height=\"258\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio-600x258.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio-768x330.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio-1024x441.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio-800x344.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio.png 1227w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/h3>\n<div class=\"level3\">\n<p>Local I\/O is used on devices that can execute <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a> VIs directly without help from a development PC. Devices that use Local I\/O are Linux-based devices like <a href=\"https:\/\/digilent.com\/shop\/ni-myrio-student-edition\/\">myRIO<\/a>, <a href=\"https:\/\/digilent.com\/shop\/labview-physical-computing-kit-for-raspberry-pi-2-limited-time-see-stand-alone-labview-home-bundle\/\">Raspberry Pi 2\/3<\/a>, and <a href=\"https:\/\/digilent.com\/shop\/beaglebone-black\/\">BeagleBone Black<\/a>.<\/p>\n<p>In this configuration, VIs are written on the development PC, then deployed and run on the target via a TCP connection with the LabVIEW run-time engine running on the target. While the VIs are running on the target, debugging information and front panel values is transferred between the target and the development PC. When a VI is running on the target with live front panel data on the dev PC, this is called Interactive Mode.<\/p>\n<p>The LabVIEW run-time engine on the target runs inside a <a class=\"urlextern\" title=\"https:\/\/en.wikipedia.org\/wiki\/Chroot\" href=\"https:\/\/en.wikipedia.org\/wiki\/Chroot\" rel=\"nofollow\">chroot<\/a>, which is a Linux construct that is similar to a virtual machine. This allows the LV run-time to be installed and run safely on many different Linux operating systems. <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a> VIs running on the target utilize the LINX firmware, compiled as a Linux shared object, in order to access I\/O on the target. The LINX shared object contains the logic necessary to access I\/O on the specific target board.<\/p>\n<\/div>\n<h3 id=\"local_io_with_a_startup_executable\">Local I\/O with a Startup Executable<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19934 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio_startup-600x347.png\" alt=\"\" width=\"600\" height=\"347\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio_startup-600x347.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio_startup-768x444.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio_startup-800x463.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/linx_arch_localio_startup.png 909w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Local I\/O has a final mode it can be used in via a startup executable. As shown in the diagram above, a development PC is no longer needed in this configuration, since the startup executable is run automatically when the target boots.\u00a0The only difference in this mode is that the front panels are no longer visible since the development PC is not controlling the execution of the application&#8217;s VIs. This mode is \u201cheadless\u201d in the sense that there is not a built-in user interface. Note that although startup executables are called \u201cexecutable\u201d they do not function like normal Linux programs and can&#8217;t be invoked from the command line. Creation and deployment of the startup app are controlled from the development PC.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19938 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1-600x338.jpg\" alt=\"\" width=\"600\" height=\"338\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1-600x338.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1-768x432.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1-1024x576.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1-800x450.jpg 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1-1200x675-cropped.jpg 1200w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1.jpg 1920w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Thank you for reading my blog post, and If you want a more technical\u00a0explanation\u00a0for how LINX works check out this <a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:libraries:linx:misc:linx-internals\">post<\/a> from <a href=\"https:\/\/www.labviewmakerhub.com\/\">Labviewmakerhub<\/a>. If you are interested in trying out LabVIEW for yourself, you can purchase a copy of\u00a0<a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW 2014 Home Edition<\/a>\u00a0which includes everything you will need to run\u00a0<a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:tutorials:libraries:linx:3-0:beaglebone-black-setup\">LINX 3.0<\/a>.\u00a0Please comment below with any questions or comments you may have.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-19925 jlk' data-task='like' data-post_id='19925' data-nonce='d8c4d58d14' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-19925 lc'>+1<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-19925 jlk' data-task='unlike' data-post_id='19925' data-nonce='d8c4d58d14' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-19925 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-19925 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Austin takes us through a brief introduction to LINX!<\/p>\n","protected":false},"author":42,"featured_media":19938,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1563],"tags":[],"ppma_author":[4493],"class_list":["post-19925","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/04\/maxresdefault-1.jpg","jetpack_sharing_enabled":true,"authors":[{"term_id":4493,"user_id":42,"is_guest":0,"slug":"astanton","display_name":"Austin Stanton","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/0cc9db2caf6344c8f78ea46c21570f33a954c45596addf479125043e52431de0?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/19925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=19925"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/19925\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/19938"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=19925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=19925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=19925"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=19925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}