{"id":8544,"date":"2015-08-03T20:00:09","date_gmt":"2015-08-04T03:00:09","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=8544"},"modified":"2021-06-16T16:10:45","modified_gmt":"2021-06-16T23:10:45","slug":"plug-and-play-pmods-with-labview","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/plug-and-play-pmods-with-labview\/","title":{"rendered":"Plug and Play Pmods with LabVIEW"},"content":{"rendered":"<p>In preparation for this year&#8217;s NI Week, and with the help of <a href=\"http:\/\/www.ni.com\/labview\/\" target=\"_blank\" rel=\"noopener\">LabVIEW<\/a>, <a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=libraries:linx:start\" target=\"_blank\" rel=\"noopener\">LabVIEW MakerHub LINX<\/a>, and the <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,892,1193&amp;Prod=CHIPKIT-WF32\" target=\"_blank\" rel=\"noopener\">chipKIT WF32<\/a>, I was able to make a plug and play demo that includes 8 different Pmods: <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,899&amp;Prod=PMOD-ACL\" target=\"_blank\" rel=\"noopener\">PmodACL<\/a>\u00a0(accelerometer), <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,1190&amp;Prod=PMOD-ALS\" target=\"_blank\" rel=\"noopener\">PmodALS<\/a>\u00a0(ambient light sensor), <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,1191&amp;Prod=PMOD-CMPS\" target=\"_blank\" rel=\"noopener\">PmodCMPS<\/a>\u00a0(compass), <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,937&amp;Prod=PMOD-GYRO\" target=\"_blank\" rel=\"noopener\">PmodGYRO<\/a>\u00a0(gyroscope), <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,601&amp;Prod=PMOD-JSTK\" target=\"_blank\" rel=\"noopener\">PmodJSTK<\/a>\u00a0(joystick), <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,1448&amp;Prod=PMOD-MIC3\" target=\"_blank\" rel=\"noopener\">PmodMIC3<\/a>\u00a0(microphone), <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,1449&amp;Prod=PMOD-TC1\" target=\"_blank\" rel=\"noopener\">PmodTC1<\/a>\u00a0(thermocouple), and <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,401,1202&amp;Prod=PMOD-TMP3\" target=\"_blank\" rel=\"noopener\">PmodTMP3<\/a>\u00a0(ambient temperature sensor). \u00a0If you&#8217;re interested in LabVIEW and chipKIT WF32, check out the <a href=\"https:\/\/digilent.com\/shop\/labview-physical-computing-kit-with-chipkit-wf32\/\" target=\"_blank\" rel=\"noopener\">LabVIEW Physical Computing Kit<\/a>, which includes both <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\" target=\"_blank\" rel=\"noopener\">LabVIEW Home Bundle<\/a> and the WF32.<\/p>\n<p>&nbsp;<\/p>\n<p>The idea for this project was to have the user plug either an SPI or an I2C Pmod into the corresponding wire, select the Pmod from the menu on the front panel of LabVIEW, and click run\u00a0to read the values from the Pmod that&#8217;s plugged in. \u00a0See the Instructable for this demo <a href=\"http:\/\/www.instructables.com\/id\/Plug-and-Play-Pmods-Using-LabVIEW\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,892,1193&amp;Prod=CHIPKIT-WF32\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8547 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944-600x338.jpg\" alt=\"20150714_103944\" width=\"600\" height=\"338\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944-600x338.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944-1024x576.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944-225x127.jpg 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944-800x450.jpg 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944-1200x675-cropped.jpg 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The picture above shows how you plug in each Pmod. \u00a0Green bumpers were made for the SPI Pmods (pictured above on the PmodJSTK) and these Pmods were then connected to the corresponding wire. \u00a0The 4 wire bundle on the left is the I2C wire for the I2C Pmods with pink bumpers (not pictured).<\/p>\n<p>&nbsp;<\/p>\n<p>Below is the front panel in LabVIEW. \u00a0Upon opening the program,\u00a0you\u00a0simply select the serial port connected to the chipKIT WF32. \u00a0From here, choose a Pmod and select the corresponding tab on the front panel. \u00a0Some Pmods have extra settings you can change. \u00a0Once you&#8217;re ready, click the run button and then the stop button when you&#8217;re done. \u00a0Now you can select a new Pmod and follow the same steps!<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/Products\/Catalog.cfm?NavPath=2,401&amp;Cat=9\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8548 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/Pmods-600x316.png\" alt=\"Pmods\" width=\"600\" height=\"316\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/Pmods-600x316.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/Pmods-1024x540.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/Pmods-225x119.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/Pmods.png 1184w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>To get the LabVIEW code to work, enum controls were used to select the correct Pmod code to run. \u00a0I made subVIs for each Pmod so users wouldn&#8217;t have to poke through the datasheets for each Pmod to\u00a0see how exactly it works. \u00a0If you&#8217;re interested in what is in the subVI, just double click on the block and the code will appear.<\/p>\n<p>&nbsp;<\/p>\n<p>Interested in learning more about I2C, SPI, and\/or LabVIEW? \u00a0Check out my\u00a0in-depth blog posts about\u00a0SPI and I2C connections and how to code the interface in LabVIEW below. \u00a0Use these two posts\u00a0as guides to write your own interface code in LabVIEW and feel free to share what you make on both the <a href=\"https:\/\/forum.digilent.com\/\" target=\"_blank\" rel=\"noopener\">Digilent forums<\/a> and <a href=\"https:\/\/www.labviewmakerhub.com\/forums\/\" target=\"_blank\" rel=\"noopener\">LabVIEW MakerHub forums<\/a>. \u00a0Also, try using the LabVIEW code I wrote for the Pmods to create your own projects using LabVIEW and the Pmod of your choice.<\/p>\n<p>1) <a href=\"https:\/\/digilent.com\/blog\/index.php\/spi-with-chipkit-wf32-and-labview\/\" target=\"_blank\" rel=\"noopener\">SPI<\/a><\/p>\n<p>2) <a href=\"https:\/\/digilent.com\/blog\/index.php\/i2c-in-labview\/\" target=\"_blank\" rel=\"noopener\">I2C<\/a><\/p>\n<p>&nbsp;<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-8544 jlk' data-task='like' data-post_id='8544' data-nonce='a7290e5e40' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-8544 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-8544 jlk' data-task='unlike' data-post_id='8544' data-nonce='a7290e5e40' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-8544 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-8544 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Looking for a quick electronic fix? Check out one of our awesome NI Week demos!<\/p>\n","protected":false},"author":33,"featured_media":8547,"comment_status":"open","ping_status":"closed","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":[38,1563],"tags":[],"ppma_author":[4481],"class_list":["post-8544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-expansion-modules","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/20150714_103944.jpg","jetpack_sharing_enabled":true,"authors":[{"term_id":4481,"user_id":33,"is_guest":0,"slug":"sudharsan-sukumar","display_name":"Sudharsan Sukumar","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/a14d4c855a4738a3b7d04f48ab9936a38ea5a056ea75b4761a407b53dac5597b?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\/8544","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\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=8544"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/8544\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/8547"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=8544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=8544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=8544"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=8544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}