tag:blogger.com,1999:blog-13719843085051893362024-03-19T02:51:05.606+00:00Etching Pathways"Think like a bumblebee"Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.comBlogger53125tag:blogger.com,1999:blog-1371984308505189336.post-44534555309194689132014-04-23T18:59:00.000+01:002014-04-23T18:59:20.321+01:00Online Tools<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
I have come across two online tools over the last few weeks which I have found really useful. I normally use offline programs to edit images, create images with transparent backgrounds and create diagrams and flow charts.</div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<br /></div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<img alt="Online Developer Tools" class="aligncenter wp-image-265 size-medium" data-mce-src="http://www.labvolution.com/wp-content/uploads/2014/04/Online-Developer-Tools-300x201.png" height="201" src="http://www.labvolution.com/wp-content/uploads/2014/04/Online-Developer-Tools-300x201.png" style="display: block; margin-left: auto; margin-right: auto;" width="300" /></div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<br /></div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
There are some times that using an offline, installed program is not possible. Some companies restrict the type of programs that are installed, especially if they are free and open source. The reason for this list that I am going to build, is to help point people to websites that work, and also as a reminder to me when I need them again and don’t have access to my browser bookmarks.</div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<br /></div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
I have also listed some of the offline tools that I use which offer a lot more functionality.</div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<br /></div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<span data-mce-style="text-decoration: underline;" style="text-decoration: underline;"><strong>UML Diagrams and flowcharts (online):</strong></span></div>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<li><strong>draw.io</strong> is a free online diagram drawing application for workflow, BPM, org charts, UML, ER, network diagrams. There is also an addon for Google Chrome which can be found <a data-mce-href="https://chrome.google.com/webstore/detail/drawio/plgmlhohecdddhbmmkncjdmlhcmaachm" href="https://chrome.google.com/webstore/detail/drawio/plgmlhohecdddhbmmkncjdmlhcmaachm" target="_blank">here</a>. <a data-mce-href="https://www.draw.io/" href="https://www.draw.io/" target="_blank">https://www.draw.io/</a></li>
</ul>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<span data-mce-style="text-decoration: underline;" style="text-decoration: underline;"><strong>Image Creators and Editors (online):</strong></span></div>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<li><strong>Free Online Image Editor</strong> is an editor where you can create your own animated gifs, resize and crop images, create images with transparent backgrounds and many other image manipulation tools. <a data-mce-href="http://www.online-image-editor.com/" href="http://www.online-image-editor.com/" target="_blank">http://www.online-image-editor.com/</a></li>
</ul>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<span data-mce-style="text-decoration: underline;" style="text-decoration: underline;"><strong>Image Creators and Editors (offline):</strong></span></div>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<li><strong>Inkscape</strong> is an open-source vector graphics editor similar to Adobe Illustrator, Corel Draw, Freehand, or Xara X. What sets Inkscape apart is its use of Scalable Vector Graphics (SVG), an open XML-based W3C standard, as the native format. <a data-mce-href="http://www.inkscape.org/en/" href="http://www.inkscape.org/en/" target="_blank">http://www.inkscape.org/en/</a></li>
<li><strong data-mce-style="text-align: justify;">GIMP</strong><span data-mce-style="text-align: justify;"> is a raster graphics editor used for image retouching and editing, free-form drawing, resizing, cropping, photo-montages, converting between different image formats, and more specialized tasks. <a data-mce-href="http://www.gimp.org/" href="http://www.gimp.org/" target="_blank">http://www.gimp.org/</a></span></li>
</ul>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<span data-mce-style="text-decoration: underline;" style="text-decoration: underline;"><strong>Project Management:</strong></span></div>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<li><strong>Trello</strong> is the fastest, easiest way to organize anything, from your day-to-day work, to a favourite side project, to your greatest life plans. <a data-mce-href="https://trello.com/" href="https://trello.com/" target="_blank">https://trello.com/</a></li>
</ul>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<span data-mce-style="text-decoration: underline;" style="text-decoration: underline;"><strong>LabVIEW:</strong></span></div>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<li><strong>Revert</strong> by <a data-mce-href="https://www.labviewhacker.com/" href="https://www.labviewhacker.com/" target="_blank">LabVIEW Hacker</a> is an online tool that can be used to convert vi's to previous versions of LabVIEW. This tool is still in Beta form, but works and is really useful when you don't have access to the latest version of LabVIEW. <a data-mce-href="https://www.labviewhacker.com/revert/" href="https://www.labviewhacker.com/revert/" target="_blank">https://www.labviewhacker.com/revert/</a></li>
</ul>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
These are the ones that I have been using and have found to be really helpful lately. Please feel free to add others to the comments and I will then update the list above.</div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
<br /></div>
<div data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13.333333969116211px; line-height: 19px; text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-39639213772974429002014-04-22T18:48:00.000+01:002014-04-22T18:48:44.680+01:00This blog is moving…<div style="text-align: justify;">
<span style="font-family: inherit;">After running Etching Pathways for a few years, I have decided to move it to my own domain. The idea will be the same, where I post about topics that interest me and projects that I have worked on. I have been a bit quiet over the last few months, this is due to me changing jobs and trying to find a new path for my career, where I can accomplish the goals that I have set out for myself.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNd9J_QqK9UjJSiI_3MPOSz3TP_Zwene33EYRUpdm_R8CaevGfHz0Y6lRavAwWgjflEFpKsBIQ9DYbL-L-faMqtLmcRJVmUL_0lm6_maNwuYFyIEmsDvQChQi71amJscaw_Y1bwi30xX0/s1600/g3029.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNd9J_QqK9UjJSiI_3MPOSz3TP_Zwene33EYRUpdm_R8CaevGfHz0Y6lRavAwWgjflEFpKsBIQ9DYbL-L-faMqtLmcRJVmUL_0lm6_maNwuYFyIEmsDvQChQi71amJscaw_Y1bwi30xX0/s1600/g3029.png" height="255" width="320" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">One of the reasons for the move, is that I am starting to venture out of permanent employment and into contracting, specifically National Instruments LabVIEW Automated Test Development. This is an area of electronics that I enjoy, where I can use tools that I believe in and support and where I think I can make a difference.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I am half way through my first contract doing test development for an RF company, and so far it is going really well. I am enjoying the work, enjoying the industry as well as enjoying the flexibility that contracting offers. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Another area that has been taking up my time is putting together a presentation for the UK CLD Summit to be hosted at the NI UK and Ireland headquarters during May. It is a project that I have been thinking about for some time and am making some good progress. The current goal is to do angular measurements of a mirror using LabVIEW Vision Development Module. Once I have everything working and my presentation complete, I will do a more in-depth post about it.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.labvolution.com/" target="_blank"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg3s4Csi4MSA4hNE6O7K3gJOAbvBp7U83b7PmdRsx3p60dOZR2kNH37_hbwCgwJ0IORA8XhW9E7C3KPPJMtPjNfCaWpIyrKIAePufzT2eGAsAiXwUw6x_F4GF50FWze4QaahR8KysmNjQ/s1600/Labvolution+619x80.png" height="51" width="400" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I also have a few other ideas to write about which I hope I can put together soon. To get to my new website and blog, please head over to <a href="http://www.labvolution.com/">www.labvolution.com</a>.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Greg</span></div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-75857590065236135132014-01-13T18:17:00.000+00:002014-01-13T18:17:08.964+00:00LabVIEW: Web Services Part 3<div style="text-align: justify;">
In <a href="http://etchingpathways.blogspot.co.uk/2014/01/labview-web-services-part-2.html" target="_blank">Part 2</a> we had a look at connecting hardware and toggling the state on two LED’s using a form and a method VI.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Moving to the next stage of my project, I added a DS18B20 temperature sensor to log the temperature at set intervals. This interval is defined by using a<a href="http://etchingpathways.blogspot.co.uk/2013/11/labview-looking-at-constants-differently.html" target="_blank"> variable constant</a>. The temperature is logged to an <a href="http://www.sqlite.org/" target="_blank">SQLite3 </a>database and when queried, displays the temperature profile in a <a href="http://www.highcharts.com/" target="_blank">Highcharts </a>chart in the browser. Dates to display are chosen using a <a href="http://jqueryui.com/datepicker/" target="_blank">jQueryUI</a> datepicker.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP_rzsjX7ufVyr_XssPvV79DTtFvuN22KWhQkaJ288H_tkAyLQxHeC_jRwP3edvs4sbj3L5-sOOIHDkBXB0JXeJfa7JRG1x3etYM2dqK7IFDb5C-aeKndek7l-qUAmIB7wVOwKD6wNZnc/s1600/Chart+page.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP_rzsjX7ufVyr_XssPvV79DTtFvuN22KWhQkaJ288H_tkAyLQxHeC_jRwP3edvs4sbj3L5-sOOIHDkBXB0JXeJfa7JRG1x3etYM2dqK7IFDb5C-aeKndek7l-qUAmIB7wVOwKD6wNZnc/s400/Chart+page.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Logging temperature:</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Temperature is logged every 60 seconds as set by Constants.lvlib:TemperatureLogDelay.vi. This VI is opened and run by reference from within Startup.vi when the server is started. It continues to run in the background as long as the server is running. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWaDrHdv3ty9P5EahgR4Ne4YcbN9Mml6uj67UA5M4V5sdwr3h7MjvXLUvo-7AYNbT4N7rNXg1i8MocPMCHLxkcFaR7e8mAjSWmaasyFesAAT7If91fT3XSH1ASOyqx0M8fGF_ayAkgzJY/s1600/Log+Temperature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="353" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWaDrHdv3ty9P5EahgR4Ne4YcbN9Mml6uj67UA5M4V5sdwr3h7MjvXLUvo-7AYNbT4N7rNXg1i8MocPMCHLxkcFaR7e8mAjSWmaasyFesAAT7If91fT3XSH1ASOyqx0M8fGF_ayAkgzJY/s400/Log+Temperature.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Once the temperature has been read from the LaunchPad, it is logged in an SQLite3 database. I used a library written by Dr James Powell which can be downloaded from the <a href="http://lavag.org/files/file/212-sqlite-labview/" target="_blank">LAVA Code Repository</a>. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOV_o-Jkg1k6nxzZSThyphenhyphenVk6RnHrrWm5uCkvo_idhpXUkMNJS7tFUDbuPPeXXBtsvBGV7EyhiDVkMYMM-Gfl6goEcOWm8aBBb4zljFOcMGeED5Qr02iQWHejxSn24CDSaXw9xDKC_NBryw/s1600/Set+Temperature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOV_o-Jkg1k6nxzZSThyphenhyphenVk6RnHrrWm5uCkvo_idhpXUkMNJS7tFUDbuPPeXXBtsvBGV7EyhiDVkMYMM-Gfl6goEcOWm8aBBb4zljFOcMGeED5Qr02iQWHejxSn24CDSaXw9xDKC_NBryw/s400/Set+Temperature.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The temperature is logged alongside the current date and time. The data and time string is used to choose what date range to display in the chart.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Query the temperature:</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To query the database for the temperature range that we want to display, I use a jQueryUI datepicker. This gives me the dates that I want to look at and then I add the time in LabVIEW. I use a form with another GET method to pass the dates into LabVIEW and then I run the query there. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirshgCj4w-voErp9fq2TY4MyQlV1BUp5I-rxkPboowLfyuJ97WfsdmbiywR8xNshCxC_B85zprHp3vj2Kom6NCM0es2MLeZ6uzZon8y3rUY28HA_SBNvyGq6wdUCWo_f5Hy357c1BIlSM/s1600/Query+Temperature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirshgCj4w-voErp9fq2TY4MyQlV1BUp5I-rxkPboowLfyuJ97WfsdmbiywR8xNshCxC_B85zprHp3vj2Kom6NCM0es2MLeZ6uzZon8y3rUY28HA_SBNvyGq6wdUCWo_f5Hy357c1BIlSM/s400/Query+Temperature.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The data gets returned from the query in the form or arrays.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Create JSON file:</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Once I have an array of dates and temperatures, I need to reformat the arrays into a JSON string which Highcharts can understand. I start off my formatting each array into the correct format string and then create the complete JSON string. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjniE6S2cqrDsiLjHTd35RFbBmWQ6u1umX7t69wxPGIuWrEmEt97R2n_Rl1rmcI8cPsjgFNYAZLdlaE6M6ErsG00M5gV9QED-yWFz7GoiQQpA6QmkhTiY_RDE-p6zaXW_UwbjyNvxjjt3s/s1600/Create+JSON+string.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjniE6S2cqrDsiLjHTd35RFbBmWQ6u1umX7t69wxPGIuWrEmEt97R2n_Rl1rmcI8cPsjgFNYAZLdlaE6M6ErsG00M5gV9QED-yWFz7GoiQQpA6QmkhTiY_RDE-p6zaXW_UwbjyNvxjjt3s/s400/Create+JSON+string.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This string is then written to a .json file which is read by the javascript to display the chart.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Adding static files:</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As we are using more API’s, we need to add these files to the static directories. To the static/css directory, add the jQuery datapicker theme. To the static/js directory, add the Highcharts, jQuery and jQuery datapicker js files. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2Gk-EE3IQxxfysTMkdwkUt-hXgeZ4zgfe9i0kP6g50A2DGz6xB8WqI9GTjW-SJBeV8P4ryaSDLlDuTNX6PGzlaFNoYZuGq6_z9wOzMVjfnI7ZuInYD1oDQaGy6ZxzcSDaiT_GuVa8BKw/s1600/Static+files.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2Gk-EE3IQxxfysTMkdwkUt-hXgeZ4zgfe9i0kP6g50A2DGz6xB8WqI9GTjW-SJBeV8P4ryaSDLlDuTNX6PGzlaFNoYZuGq6_z9wOzMVjfnI7ZuInYD1oDQaGy6ZxzcSDaiT_GuVa8BKw/s400/Static+files.png" width="238" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Editing chart.html:</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The last thing to do is to add the <script> and html code to display the datepicker and chart. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yOyAa0SdB8tOGEByk7yVe51FDM9wLgX-Hf5xRes_RVcysYoXdA4fcV8VHmkjhf-8uuQSRKSf7cPGwfuTehSrFjOGmCp1L3d1aBwaN4R77wPqKm56X18PCqe2GY9_Km_Ms1q5yOxq_W8/s1600/Html+forms.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="98" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yOyAa0SdB8tOGEByk7yVe51FDM9wLgX-Hf5xRes_RVcysYoXdA4fcV8VHmkjhf-8uuQSRKSf7cPGwfuTehSrFjOGmCp1L3d1aBwaN4R77wPqKm56X18PCqe2GY9_Km_Ms1q5yOxq_W8/s400/Html+forms.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If no dates are selected, the today’s dates will be chosen by default.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
A JSON file is then created from the query results. This file is saved into the static/json directory where it is read from within the script.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The webpage is then updated with the chart showing the temperatures for the dates selected. The settings of the chart and also the type of chart can be changed to whatever you like. Have a look at the <a href="http://api.highcharts.com/highcharts" target="_blank">Highcharts API</a> for all the options. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
That is all for Part 3. You can find Part 2 <a href="http://etchingpathways.blogspot.co.uk/2014/01/labview-web-services-part-2.html" target="_blank">here</a> and Part 1 <a href="http://etchingpathways.blogspot.co.uk/2014/01/labview-web-services-with-twitter.html" target="_blank">here</a>. The completed project so far can be downloaded from <a href="https://drive.google.com/file/d/0ByzG2Ps_dpjcM1Z6STdBQnpWTGM/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As always, comments and tips are always appreciated. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-84164975746764203712014-01-08T17:38:00.000+00:002014-01-08T17:38:39.065+00:00LabVIEW: Web Services Part 2After making a basic webpage in my <a href="http://etchingpathways.blogspot.co.uk/2014/01/labview-web-services-with-twitter.html" target="_blank">previous post</a>, I wanted to expand on it by adding some control. I have used a <a href="http://www.ti.com/tool/msp-exp430g2" target="_blank">TI MSP430 LaunchPad</a> as my connected hardware.<br />
<br />
To start off, you can download the updated project from <a href="https://drive.google.com/file/d/0ByzG2Ps_dpjcXzktRURLRkRmZVk/edit?usp=sharing" target="_blank">here</a>. You can also get the LaunchPad code <a href="https://drive.google.com/file/d/0ByzG2Ps_dpjcYmZfSmVkZ0pOSE0/edit?usp=sharing" target="_blank">here </a>which has been compiled in CCS 5.5.<br />
<br />
In this version, I added two radio buttons to the main page and two normal buttons to submit the selection. I then used an html form with a GET method to pass the selection from the webpage into LabVIEW. Depending on the selection made, LabVIEW controlled the state change of the LaunchPad LED’s through VISA functions.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOAhyphenhyphenbjbv1VhoCdrKTlhCUBK2vR2D2N9YNpDU0zuk4Cc-iuK7qK9CeSzZwxJX0a4Z2X41Dc8fLobVEnKC_BT5i2NApilXEqcqrXnIdLq67LYXXA3BjV9H4Xe6mrinYntn_e-iS9y0jeuM/s1600/Webpage+with+radio+buttons.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOAhyphenhyphenbjbv1VhoCdrKTlhCUBK2vR2D2N9YNpDU0zuk4Cc-iuK7qK9CeSzZwxJX0a4Z2X41Dc8fLobVEnKC_BT5i2NApilXEqcqrXnIdLq67LYXXA3BjV9H4Xe6mrinYntn_e-iS9y0jeuM/s1600/Webpage+with+radio+buttons.png" height="267" width="400" /></a></div>
<br />
The following instructions add on from the project in <a href="http://etchingpathways.blogspot.co.uk/2014/01/labview-web-services-with-twitter.html" target="_blank">Part 1</a>.<br />
<br />
<b>Editing the html page:</b><br />
<br />
Start off by adding the <form></form> code to index.html. This will allow you to send data from the webpage back into LabVIEW at the press of a button. The method being used is GET and the action points to a VI which will handle the data.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0_EZI6TQoOlp1STZSGJvwylUSRusyNNByRU2SnROqZUgtw0t0XLnOtabc05tQqcyUMjZFybSrr2t7XqXh0EVnYqsy1cJ9Owtnj7j-XN8k71_2amnVlNlDs3mj6rPW7mN0BgegiFJk330/s1600/Form+code.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0_EZI6TQoOlp1STZSGJvwylUSRusyNNByRU2SnROqZUgtw0t0XLnOtabc05tQqcyUMjZFybSrr2t7XqXh0EVnYqsy1cJ9Owtnj7j-XN8k71_2amnVlNlDs3mj6rPW7mN0BgegiFJk330/s1600/Form+code.png" height="82" width="400" /></a></div>
<br />
This code will create two radio buttons and two normal buttons. When a button is pressed, the status of the radio button selected and which button pressed will be sent to the VI called ToggleLED in the WebService folder.<br />
<br />
<b>Creating the Web Resource:</b><br />
<br />
We need to create a VI which will receive the data from the form. Right click on the Web Resources folder in the LabVIEW project and select New VI.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_BzvADnNpzWunRVeYxasTMTBp5K4bzGGcEMiwI2oGZp-fRkRX03VYmaD6a0Tik6MR6Muzg0tTymUpXtBk3rX1xVKilnsXkgYj8c1SeixbXSl-S_zKTT8O1ZgTn8Ic7XRmfuyffEDuVzo/s1600/New+Web+Resource.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_BzvADnNpzWunRVeYxasTMTBp5K4bzGGcEMiwI2oGZp-fRkRX03VYmaD6a0Tik6MR6Muzg0tTymUpXtBk3rX1xVKilnsXkgYj8c1SeixbXSl-S_zKTT8O1ZgTn8Ic7XRmfuyffEDuVzo/s1600/New+Web+Resource.png" height="400" width="345" /></a></div>
<br />
Save this file as ToggleLED.vi in a folder called ‘Web Resources’ in the root directory and close it. We will come back to it later.<br />
<br />
<b>Adding Private Content:</b><br />
<br />
The private content that we need to add are the VI’s that communicate with the external hardware. Make a folder called ‘private content’ in the root directory. Right click on WebService in the project and select Add Private Content Folder. Navigate into the created folder and select Select Folder.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqNlE2xffuMQ5qFkU-yTd-1-JMdt6E_MILdkds6Ok_CVZMiQZ5AB6dPQ0Z1jmhPNJt0P0TUR_noDCejT8HwtaLvr_g7RgmtztMWgHUaAAjye8cqLiviMyNWKM2MczmCz-uiTEHrhrPEs/s1600/Add+Private+Content.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqNlE2xffuMQ5qFkU-yTd-1-JMdt6E_MILdkds6Ok_CVZMiQZ5AB6dPQ0Z1jmhPNJt0P0TUR_noDCejT8HwtaLvr_g7RgmtztMWgHUaAAjye8cqLiviMyNWKM2MczmCz-uiTEHrhrPEs/s1600/Add+Private+Content.png" height="400" width="345" /></a></div>
<br />
Copy over the VI’s from my download project into this Private Folder. These VI’s include the library to communicate with the LaunchPad, a <a href="http://etchingpathways.blogspot.co.uk/2013/11/labview-looking-at-constants-differently.html" target="_blank">Variable Constants</a> library and the VI that sends the commands.<br />
<br />
<b>Adding a Startup VI:</b><br />
<br />
A Startup VI will run when the server is started and continue to run until the server is stopped. We will be using this VI to open and close the connection to the LaunchPad as the server is started and stopped.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwRGNSDBlT9xhpagHEET35IKabKdz3biJhc_Iu0-liryqX_XQ7gULiLkk7JFJ36YeUesOVma8pE81BBxI31HIv6NHA9nBzUL3kNlJOJvryz8pNBensk8JrqqkbrpmbYP3VENvThMFCRck/s1600/New+Startup+VI.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwRGNSDBlT9xhpagHEET35IKabKdz3biJhc_Iu0-liryqX_XQ7gULiLkk7JFJ36YeUesOVma8pE81BBxI31HIv6NHA9nBzUL3kNlJOJvryz8pNBensk8JrqqkbrpmbYP3VENvThMFCRck/s1600/New+Startup+VI.png" height="400" width="345" /></a></div>
<br />
Save the VI in a ‘Startup VI’ folder. Either create a new VI or copy mine and add it in the project. The VI should look like this.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvyOwosA0Ny_Q6idrhUPeeSvwXqCPfredRTPkETMnIYI-zUXirW8jcAbmT7pSNqvjEBHNIit2nZ_xXNqI-Xah9UJ7cjrU0ZEcXtMlwgThv7kPwPHYxy2QRCWmBgE_TOAPxbdOWihHa6EI/s1600/Startup+VI.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvyOwosA0Ny_Q6idrhUPeeSvwXqCPfredRTPkETMnIYI-zUXirW8jcAbmT7pSNqvjEBHNIit2nZ_xXNqI-Xah9UJ7cjrU0ZEcXtMlwgThv7kPwPHYxy2QRCWmBgE_TOAPxbdOWihHa6EI/s1600/Startup+VI.png" height="178" width="400" /></a></div>
<br />
<b>Create the GET VI:</b><br />
<br />
Now that we have added all the dependencies, we can go back and complete ToggleLED.vi. This VI needs to read the form data, pass the data to CommunicateToLaunchPad.vi and then redirect back to the main page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2hbAWAOHEHqwbZnWMOmKL5tcJAwL9P076GURvG1Q9juOinjY8l8jTI1ujCVwBIHPY1r5BE_LC9IOCXxiCp2ywhyphenhyphenFVxGLbuoKFofkODg804dPZCeT7BIXt5n_VFAJPv9N2ajbk5lVAAr4/s1600/toggleLED.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2hbAWAOHEHqwbZnWMOmKL5tcJAwL9P076GURvG1Q9juOinjY8l8jTI1ujCVwBIHPY1r5BE_LC9IOCXxiCp2ywhyphenhyphenFVxGLbuoKFofkODg804dPZCeT7BIXt5n_VFAJPv9N2ajbk5lVAAr4/s1600/toggleLED.png" height="195" width="400" /></a></div>
<br />
We use the function Read Form Data.vi located in Functions>>Connectivity>>Web Services. The data is then passed into a subVI where the decision is made on what command to send to the LaunchPad. Notice that I have used a Variable Constant for the VISA Resource Name.<br />
<br />
Once the hardware communication is complete, I redirect back to the index page. To get the original URL, use the Read Request Variable.vi function with the variable name REFERER. This will return the URL which can be passed into Set HTTP Redirect.vi.<br />
<br />
<b>Complete project:</b><br />
<br />
Now that we have added all the files, we should have a complete project that looks like this.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSb7fbolwKc7H2T9oZ_uQ4SiWvBniOitExTK7rSDo-LMO4OHANKCJjNQgtXQB3meVhyphenhyphen1mAoCKJDTixGB9aijP05xcscEdPK9Ti4jWxptcOiTwybUurL7tCl2epSPldoGb2Xyw2ipvObS0/s1600/Complete+project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSb7fbolwKc7H2T9oZ_uQ4SiWvBniOitExTK7rSDo-LMO4OHANKCJjNQgtXQB3meVhyphenhyphen1mAoCKJDTixGB9aijP05xcscEdPK9Ti4jWxptcOiTwybUurL7tCl2epSPldoGb2Xyw2ipvObS0/s1600/Complete+project.png" height="400" width="236" /></a></div>
<br />
We should now be ready to test our website. Save the entire project and Start the server. Navigate to the URL and you should see the following page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOAhyphenhyphenbjbv1VhoCdrKTlhCUBK2vR2D2N9YNpDU0zuk4Cc-iuK7qK9CeSzZwxJX0a4Z2X41Dc8fLobVEnKC_BT5i2NApilXEqcqrXnIdLq67LYXXA3BjV9H4Xe6mrinYntn_e-iS9y0jeuM/s1600/Webpage+with+radio+buttons.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOAhyphenhyphenbjbv1VhoCdrKTlhCUBK2vR2D2N9YNpDU0zuk4Cc-iuK7qK9CeSzZwxJX0a4Z2X41Dc8fLobVEnKC_BT5i2NApilXEqcqrXnIdLq67LYXXA3BjV9H4Xe6mrinYntn_e-iS9y0jeuM/s1600/Webpage+with+radio+buttons.png" height="267" width="400" /></a></div>
<br />
Once the server is running and the page is open in the browser, open ToggleLED.vi front panel from the LabVIEW project. Select one of the radio buttons and then press a button. You will now be able to see what commands were received by LabVIEW by inspecting the indicators in ToggleLED.vi.<br />
<br />
I have disabled the VISA functions in the uploaded project. If you want to try them, all you need to do is remove the Diagram Disable Structures from Startup.vi and ToggleLED.vi. This will then communicate with the LaunchPad; however if there is no hardware connected, the redirect will not work and an XML page will be returned after a button is pressed. You will also need to change the VISA Resource in Constants.lvlib:VisaPortNumber.vi.<br />
<br />
That’s all for Part 2. If you have any questions, comments or advice for me, please leave a comment below. Part 3 should be up once I have decided on what to add and figured out how to do it.<br />
<br />
GregAnonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-22537265607924233902014-01-07T19:42:00.000+00:002014-01-08T17:39:04.594+00:00LabVIEW: Web Services with Twitter Bootstrap<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I have been playing around with the updated Web Services feature in LabVIEW 2013 the last few days. My plan is to write a few posts where I create a simple website hosted by LabVIEW which can control some hardware from the browser.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I have done this in the past with my Raspberry Pi, but wanted to give it a go using LabVIEW instead.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">This first post will cover how to set up the project, how to serve static pages and also how to link in third party code. The two third party products that I will be using are <a href="http://getbootstrap.com/" target="_blank">Twitter Bootstrap</a> and <a href="http://jquery.com/" target="_blank">jQuery</a>.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Here is the website that will be designed in the post.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLZI268jfQr90jVvGxWdRFJXOhpiyktY1SJOrxU9w3ZSxW7iFckYsiQwdkTAWg9OyPoohJc7d2lPPBiazdBIjtZ2UKYEVyX7QgUjAGPThaqPL7iWi_g44xPyAlepdNPAOgvH3-C8_31N4/s1600/Home+Page.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLZI268jfQr90jVvGxWdRFJXOhpiyktY1SJOrxU9w3ZSxW7iFckYsiQwdkTAWg9OyPoohJc7d2lPPBiazdBIjtZ2UKYEVyX7QgUjAGPThaqPL7iWi_g44xPyAlepdNPAOgvH3-C8_31N4/s1600/Home+Page.png" height="301" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Start off by creating a blank project from LabVIEW templates. Save the project and then in the project, right click on My Computer and select New > Web Service.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3jsIKxv6okeozs6Rx9nTb5oKXa0eP4Hf2tv7RY_SEKqFwSe98v6ruDVT5PxgssPNavNfKZNcSPZs-GB6vDix8qVVHGxCT_gd2i6KZHXWhYrOrTjqWn0OSxDUlYP65HNxBlOtYkzG8-d8/s1600/New+Web+Service.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3jsIKxv6okeozs6Rx9nTb5oKXa0eP4Hf2tv7RY_SEKqFwSe98v6ruDVT5PxgssPNavNfKZNcSPZs-GB6vDix8qVVHGxCT_gd2i6KZHXWhYrOrTjqWn0OSxDUlYP65HNxBlOtYkzG8-d8/s1600/New+Web+Service.png" height="370" width="400" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">This creates the Web Service in your project.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNhDmkneenw879bxi2EGJRv66pr77ZyNBl28EVhw3MZJnoaF4eaG5PXaaIhifgim9XkeIxNkyE1Ouw7P2HEizxTJFAHbE7RpIKf6Ggtu7k_q-nE81Q5iASixYW_kQewKbIw97x_Vg7GGM/s1600/Web+Service+empty.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNhDmkneenw879bxi2EGJRv66pr77ZyNBl28EVhw3MZJnoaF4eaG5PXaaIhifgim9XkeIxNkyE1Ouw7P2HEizxTJFAHbE7RpIKf6Ggtu7k_q-nE81Q5iASixYW_kQewKbIw97x_Vg7GGM/s1600/Web+Service+empty.png" height="370" width="400" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create the folder structure in Windows Explorer for your public content. I use the following structure created in the project root directory:</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcVJ4S7tg_eaEBPFkLbG9RiwhD11OeH5_hURmnmm8cxAjFBu4GHM9G1Ak5dhGhZZfVyPR8RnJjY1RO2F_4Lis246KUX0hIPxUv938Bn2jCSqo4nizlofC5bh40zHIeXH7l32Jjf8qbojw/s1600/Folder+Structure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcVJ4S7tg_eaEBPFkLbG9RiwhD11OeH5_hURmnmm8cxAjFBu4GHM9G1Ak5dhGhZZfVyPR8RnJjY1RO2F_4Lis246KUX0hIPxUv938Bn2jCSqo4nizlofC5bh40zHIeXH7l32Jjf8qbojw/s1600/Folder+Structure.png" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Once the folder structure has been created, it needs to be added to the project. Add the folder by right clicking on WebService in the project and selecting Add Public Content Folder. Navigate to the Public Content folder created in the previous step and click Select Folder.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMmWnRQlehMXAehj0CcZxXIAzooJWc103jGwrd8sxDk8PscYx0DAj0UaukJLrXLbkwygWX44atSKJqKO1FzIMVtEzgq6vSWAqc-5658d2ClopZT5bMo5LCqeAH1Xrs4GqHE5odfdcw2_g/s1600/Add+Public+content.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMmWnRQlehMXAehj0CcZxXIAzooJWc103jGwrd8sxDk8PscYx0DAj0UaukJLrXLbkwygWX44atSKJqKO1FzIMVtEzgq6vSWAqc-5658d2ClopZT5bMo5LCqeAH1Xrs4GqHE5odfdcw2_g/s1600/Add+Public+content.png" height="370" width="400" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Now that the folder structure has been created, we need to add the source files. Download my project <a href="https://drive.google.com/file/d/0ByzG2Ps_dpjcalEyMkpxVjVYUWM/edit?usp=sharing" target="_blank">here </a>to get the Bootstrap, jQuery, html and images that I used. Add them in Windows Explorer and they will be automatically added in the project as the folders are set to Auto Populate. Once you are done the project should look like this.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_fB1Rx3KHjosKZ9HfjrzbxOlehSbYNdhXA503ukowuiuAM-tpS6Gpizui31pXrn03NMjZziueGmejeMTidDeARUloebs8nQ8lktkyznDBaJStr8jAGMz4DDhbI3wYH_BzixvwOY3p3tA/s1600/Completed+Project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_fB1Rx3KHjosKZ9HfjrzbxOlehSbYNdhXA503ukowuiuAM-tpS6Gpizui31pXrn03NMjZziueGmejeMTidDeARUloebs8nQ8lktkyznDBaJStr8jAGMz4DDhbI3wYH_BzixvwOY3p3tA/s1600/Completed+Project.png" height="400" width="251" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Use the Bootstrap and jQuery links above to get the latest versions if you want. Then just replace the files.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Open the three html files in a text editor of your choice. I use <a href="http://notepad-plus-plus.org/" target="_blank">Notepad++</a> which I think is the best editor that I have tried. It also colours the text depending on the language used and is open source.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">When linking to the css, js, jpg files from html, the path is relative to the html path. In this project you will use the path “static/folder/file” where folder is the type of file and file is the full file name including extension. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Now that we have the files and project in place we are ready to run the server and open the webpage, but first save the project and all the components.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Right click on WebService and select Start. This will bring up a dialog to display that the webserver is running.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3_9lRwq0b0TWyh1B31Kqb0T8IzWZoa9HUqG_gqITEy9v4uo8cYFRquJFBNm6X2ipYU4m_fqsqxr1PIsO-h9zdGc7q3IEPINe_wwFYB9U9PHi9vWpU197whug2QAwQzjGKBO7LulUzeII/s1600/Web+Service+Start.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3_9lRwq0b0TWyh1B31Kqb0T8IzWZoa9HUqG_gqITEy9v4uo8cYFRquJFBNm6X2ipYU4m_fqsqxr1PIsO-h9zdGc7q3IEPINe_wwFYB9U9PHi9vWpU197whug2QAwQzjGKBO7LulUzeII/s1600/Web+Service+Start.png" height="400" width="251" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Now you need to get the URL to connect to. Right click on index.html and select Show Public URL. Copy the URL that is shown in the dialog.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1zN2t-k4NiBgOP3E1liyyP3N7UeEoqw4BbI6AYs_3kDxkoDMaZYwO4Z4AYZOFH2077eL2NFCIQIwTbQHWbcnHHj0_w-PHa3li8BsdwzKigmCc9q0w2Ue4zwt0BnlI9LpyF6PbMtxN_48/s1600/Show+URL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1zN2t-k4NiBgOP3E1liyyP3N7UeEoqw4BbI6AYs_3kDxkoDMaZYwO4Z4AYZOFH2077eL2NFCIQIwTbQHWbcnHHj0_w-PHa3li8BsdwzKigmCc9q0w2Ue4zwt0BnlI9LpyF6PbMtxN_48/s1600/Show+URL.png" height="352" width="400" /></a></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Once you have the URL copied, close the dialog and paste the URL into a browser. Your webpage should now run. Once running, you can navigate between the three html pages using the links at the top of the page.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">If you decide to change the html code, you do not need to restart the server after each change. All you need to do is refresh the browser.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">That is it for Part 1. I will now make some changes and get Part 2 up as soon as I can.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">If you have any comments, questions or tips for me, please leave a message in the comments section below. Thanks for reading.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Greg</span></div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-83598673822430800592013-12-10T18:04:00.000+00:002013-12-10T18:04:03.013+00:00LabVIEW: Getting started with LVOOP<div style="text-align: justify;">
<span style="font-family: inherit;">I have been trying to get a handle on LVOOP for many months now but have been battling to get the concept into my head. I understand the concept of OOP, or at least I think I do, but really battling to convert that into the LabVIEW world.</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Here is a list of resources that I used to try and figure it out:</span></div>
<div style="text-align: justify;">
</div>
<ul>
<li><span style="font-family: inherit;"><a href="http://www.ni.com/white-paper/5786/en/" target="_blank">LabVIEW Object-Orientated Programming</a></span></li>
<li><span style="font-family: inherit;"><a href="http://www.ni.com/webcast/1718/en/" target="_blank">NI LabVIEW Virtual User Group: Advanced Object-Oriented Programming</a></span></li>
<li><span style="font-family: inherit;"><a href="http://www.ni.com/white-paper/3574/en/" target="_blank">LabVIEW Object-Oriented Programming: The Decisions Behind the Design</a></span></li>
<li><span style="font-family: inherit;"><a href="http://blog.eyesonvis.com/2012/08/21/intro-to-lvoop-part-1/" target="_blank">Intro to LVOOP – Part 1</a></span></li>
<li><span style="font-family: inherit;"><a href="https://decibel.ni.com/content/docs/DOC-34153" target="_blank">OOP 1 Hour Hands On</a></span></li>
</ul>
<br />
<div style="text-align: justify;">
<span style="font-family: inherit;">There have been other articles that I have used, but none that I could find started from a blank project to build a basic application. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">So I set about to try write one from scratch. I used the example from the video of a Mammal Parent class with a few Child classes. Here is the UML diagram of what I had planned. I found a great online tool to create the UML diagrams. Have a look <a href="https://www.draw.io/" target="_blank">here</a>.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasiOWmu1IXx-7VDtS9ySalIgPOrLatyCXBTsOcP14rgU-yog3C-qRcYIdYhP2TAUEdL6dSEkmwrsR1APSyX4wd2xP-5cCOxeia2Ty9QctXyMWAWwMConSrT_WRWPie_klAGimj8y-AUk/s1600/Mammal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasiOWmu1IXx-7VDtS9ySalIgPOrLatyCXBTsOcP14rgU-yog3C-qRcYIdYhP2TAUEdL6dSEkmwrsR1APSyX4wd2xP-5cCOxeia2Ty9QctXyMWAWwMConSrT_WRWPie_klAGimj8y-AUk/s400/Mammal.png" width="355" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">As can be seen from the above diagram, I have a project with five classes, each has Dynamically Dispatched vi’s and one has vi’s for Data Member Access.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><b>So that is the idea of my simple program, here is a step-by-step list of what I did:</b></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create a blank project and add five virtual folders. Add folders with the same names to the project directory on disk.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create main.vi which will be your application.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP0TrFIEz5esZof8EEjHamaofrqzIYwrjqfXi5QOioMyVg5Hng-bTk8_mc0b0QMmtL0cOoatsUujvQoPc1AlVAFa7ZR8G2royEAJdi_d1M8_dOyd_GUGxgYY_ZLW5ud7ElSk9epJ36RJA/s1600/LVOOP+Project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP0TrFIEz5esZof8EEjHamaofrqzIYwrjqfXi5QOioMyVg5Hng-bTk8_mc0b0QMmtL0cOoatsUujvQoPc1AlVAFa7ZR8G2royEAJdi_d1M8_dOyd_GUGxgYY_ZLW5ud7ElSk9epJ36RJA/s320/LVOOP+Project.png" width="284" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create the Mammal.lvclass inside the Mammal folder.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTBaCIp9tx8PbJCmvy3ZREvNF2zkZnu4ktlj742PlVlOUbvcG-ykHNO_5JeSZOpnnA5gLYUM-VkH1zxKeQVYYpYWSSDeGeRJieA0lpOgNt_OY8uRoQ1TZf9eMZHQfiA5_5ojVEC4Rpxrg/s1600/New+Class.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTBaCIp9tx8PbJCmvy3ZREvNF2zkZnu4ktlj742PlVlOUbvcG-ykHNO_5JeSZOpnnA5gLYUM-VkH1zxKeQVYYpYWSSDeGeRJieA0lpOgNt_OY8uRoQ1TZf9eMZHQfiA5_5ojVEC4Rpxrg/s400/New+Class.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Save the class in the Mammel folder on the disk. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Next you need to create the methods for Move() and Speak() using the Dynamic Dispatch Template.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8L8H8AuSRsZX1ywcBXGFGrhfg1joCCkjl_rkb4TeuYnVrAHAWCNby7h3965E4uLdI6N9Aj7GQVFwCRy3sqh-KeLRitPvx43uHzFLPuf2WD7V2V7kbhyphenhyphenBLC8n_ZbLoEpOyORyk97rHKok/s1600/VI+from+Dynamic+Dispatch+Template.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8L8H8AuSRsZX1ywcBXGFGrhfg1joCCkjl_rkb4TeuYnVrAHAWCNby7h3965E4uLdI6N9Aj7GQVFwCRy3sqh-KeLRitPvx43uHzFLPuf2WD7V2V7kbhyphenhyphenBLC8n_ZbLoEpOyORyk97rHKok/s400/VI+from+Dynamic+Dispatch+Template.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Add a blank string indicator and wire it to the connector pane. Do this for Move.vi and Speak.vi.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig70Wff0s48YtZSmqSE2REvQSNm1OZtUrEobB1QWqSxVsxhWu2uEwpFtvW1fkab4nGV_6LmjR-zREsDW9Cdv5Y4tTnR8EBKXCZ4ChGeftr7Gz7xfa1_h1Lf0NuvxPQGjK4-mfJ4HnipOs/s1600/Move.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig70Wff0s48YtZSmqSE2REvQSNm1OZtUrEobB1QWqSxVsxhWu2uEwpFtvW1fkab4nGV_6LmjR-zREsDW9Cdv5Y4tTnR8EBKXCZ4ChGeftr7Gz7xfa1_h1Lf0NuvxPQGjK4-mfJ4HnipOs/s400/Move.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">You have now created the Parent class with two methods that can be overridden by the Child classes.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">The next step is to create the Dog, Cat and Human classes that will inherit from Mammal class and the Baby Human class that will inherit from the Human class.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><b>Dog, Cat, Human classes:</b></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create the new classes and leave the control blank. Save the classes to their folders that have been created on the disk. Then edit the Inheritance settings in the class properties dialog. Each class needs to inherit from Mammal.lvclass.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8KCjkJOExs_zN2TX8eImkG851eTHciLIAqaMQVtV2IFWFRl5F_LQgyCEJ3LTEJUnxlZU7XMHYdyZSZGRVAt1tHqSOPgb9M-Tr3nN6clFhazuIAuXLpmWfGQVIhEiBPYxvMoVm4S-Ln_k/s1600/Inheritance.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8KCjkJOExs_zN2TX8eImkG851eTHciLIAqaMQVtV2IFWFRl5F_LQgyCEJ3LTEJUnxlZU7XMHYdyZSZGRVAt1tHqSOPgb9M-Tr3nN6clFhazuIAuXLpmWfGQVIhEiBPYxvMoVm4S-Ln_k/s400/Inheritance.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create a ‘VI for Override’ vi for Move and Speak. Edit the block diagram for each to look like this. In total three extra Speak and three extra Move vi’s should be created. One each for the Dog, Cat and Human classes.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZEJ10UnTXn5UHzryq3bQE-BeMXzt4QdnghIuwasy7f9vdx6A-Dcp6rHq8TuPXHn9MfzWRvBzBcNbGqAcT1zu5eEnba4ggw55LkADtkU2M_rc_JVMzyMNxkvjMWAiZEJnBayk9asuYlV8/s1600/VI+for+Override.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZEJ10UnTXn5UHzryq3bQE-BeMXzt4QdnghIuwasy7f9vdx6A-Dcp6rHq8TuPXHn9MfzWRvBzBcNbGqAcT1zu5eEnba4ggw55LkADtkU2M_rc_JVMzyMNxkvjMWAiZEJnBayk9asuYlV8/s400/VI+for+Override.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguy4OMZeCrjZD5KCB6KaDMRmUroiY3xxxu6UTFigIPvhj0GXxyGKWAtIszSQ0uKDnWCMqu6-OmJk2YH0nfOaT_z5m8W4krSJoHtUX05Yf36w3dssUujCER90LwmBEIqlIaVEKJjiNnomw/s1600/Overridden+VI.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguy4OMZeCrjZD5KCB6KaDMRmUroiY3xxxu6UTFigIPvhj0GXxyGKWAtIszSQ0uKDnWCMqu6-OmJk2YH0nfOaT_z5m8W4krSJoHtUX05Yf36w3dssUujCER90LwmBEIqlIaVEKJjiNnomw/s400/Overridden+VI.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">The string constant in the No Error case gets changed for each method. This is the string that will be displayed in the main application.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><b>Baby Human class:</b></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Create a new class called Baby Human.lvclass and set it to inherit from Human.lvclass.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Open the ‘Baby Human.ctl’ control and add two strings to the cluster. Name them Movement and Voice. By adding controls here, we will be able to change the string that gets displayed at runtime. (Note that the Movement and Voice was hard coded in Dog, Cat and Human)</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhINWNXoaAmthyyPHYwqj8cHBJ__2YechVtaVTNg6mztK6c-gcmjqX5OzhSMqHJW3JRY-BaQoKxcQoIsNzphzSQLS1i7UjM1zsxDuT1ogRp8u0NJ4yEsjfSuupM_LiK_In_2HMJgRYnoSI/s1600/Baby+Human+Control.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhINWNXoaAmthyyPHYwqj8cHBJ__2YechVtaVTNg6mztK6c-gcmjqX5OzhSMqHJW3JRY-BaQoKxcQoIsNzphzSQLS1i7UjM1zsxDuT1ogRp8u0NJ4yEsjfSuupM_LiK_In_2HMJgRYnoSI/s320/Baby+Human+Control.png" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Next you need to make four vi’s for Data Member Access. These vi’s will be public and used to read and write the private data.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW3qE9lpjaE6RMZPqQ3mtalSpTcf5XlkDC8OTkR9B9qoNcTJN2bBvIFSU-59JvQAZFKMKlXcpHh0svOCXBmCsUASGIOCWu0WOp4S5jbIo5QMePu-9-w1vO2upQaMxq0dUPdlzIVUyfl2o/s1600/VI+for+Data+Member+Access.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW3qE9lpjaE6RMZPqQ3mtalSpTcf5XlkDC8OTkR9B9qoNcTJN2bBvIFSU-59JvQAZFKMKlXcpHh0svOCXBmCsUASGIOCWu0WOp4S5jbIo5QMePu-9-w1vO2upQaMxq0dUPdlzIVUyfl2o/s400/VI+for+Data+Member+Access.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Select ‘Read and Write’ for Movement and Voice. Edit the icon for each if you want and then save the created vi’s.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Next you need to create the vi’s that override the Human Move.vi and Speak.vi. Follow the steps above to create ‘VI for Override’. They should look like this.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIIN4HdpyjY1AU6sdCICTl0xmOBAL-CAGzppHk3fq_fBm2QavUgMcyBBIP40IOIGEdozvQLB9dFUPMP9Ulwd96FcbTFvd_e24DKpHFRWxbyKgn9bB9p0To1SgceVHohwEmPqiHmJMkI0c/s1600/Baby+Human+Move.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="343" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIIN4HdpyjY1AU6sdCICTl0xmOBAL-CAGzppHk3fq_fBm2QavUgMcyBBIP40IOIGEdozvQLB9dFUPMP9Ulwd96FcbTFvd_e24DKpHFRWxbyKgn9bB9p0To1SgceVHohwEmPqiHmJMkI0c/s400/Baby+Human+Move.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBLeszcsiZZx4dyIh4cSyf-qvctTP7U648EWLmfUlxURybi7ZZYDIzBYNjt1kCvyjxQ1WPRVQQ2z6i-wwGWSHXyKvMtGBhHSI0ldq31H3PgiYd2Ca5GRrZMArlHhD_wDAWJJIo6zJ48HM/s1600/Baby+Human+Speak.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBLeszcsiZZx4dyIh4cSyf-qvctTP7U648EWLmfUlxURybi7ZZYDIzBYNjt1kCvyjxQ1WPRVQQ2z6i-wwGWSHXyKvMtGBhHSI0ldq31H3PgiYd2Ca5GRrZMArlHhD_wDAWJJIo6zJ48HM/s400/Baby+Human+Speak.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">All of the above steps should set up the classes that are needed to write main.vi. I am going to write a simple application which creates an object of each class, builds an array and then displays each Move and Speak value in a For Loop. When we add the Baby Human class, we need to Set the values for Movement and Voice before we bundle the array.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">For each object that gets passed into the For Loop, the associated Move and Speak method will be dynamically called. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnS2Lg-NFyGti9zoWsrXYo_x4G_rL7lAkgdkXMBFvXKRTu4sL0z3ZwzoinWZq0A0i4-X9DhDJpUJN-dH5TREd8Sn6wzTAm2lZPCcCdRtOYhurAqMv9Av_z2IhlJxaO5A4eGF8c3qsZuf8/s1600/LVOOP+Main+Front+Panel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnS2Lg-NFyGti9zoWsrXYo_x4G_rL7lAkgdkXMBFvXKRTu4sL0z3ZwzoinWZq0A0i4-X9DhDJpUJN-dH5TREd8Sn6wzTAm2lZPCcCdRtOYhurAqMv9Av_z2IhlJxaO5A4eGF8c3qsZuf8/s400/LVOOP+Main+Front+Panel.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrvolgDmE30WF4OlNH4ND6WSnMctfKc3hnUDNcbS-WNb_UgzlwxQxmJ8A4-Y9GHx8NF1rItvvElSq4akxsriic-hKuht6mp1r0wAxh33GNwVtaoEz7lffpRobP8RUbYCwKmieRVpF_GJ8/s1600/LVOOP+Main+Block+Diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrvolgDmE30WF4OlNH4ND6WSnMctfKc3hnUDNcbS-WNb_UgzlwxQxmJ8A4-Y9GHx8NF1rItvvElSq4akxsriic-hKuht6mp1r0wAxh33GNwVtaoEz7lffpRobP8RUbYCwKmieRVpF_GJ8/s400/LVOOP+Main+Block+Diagram.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">If you change the Movement and Voice of the Baby Human class on the front panel, that change will be displayed when the application is run. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">After going through this exercise I think I am starting to get a better understanding of LVOOP. I have a very long way still to go, but I now feel that I am at least on the pathway. I hope this has made sense and is able to help someone getting started. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">If I made mistakes, please leave a comment so that I can correct it. You can get a copy of my project <a href="https://drive.google.com/file/d/0ByzG2Ps_dpjccXpmTUF5bUoydjQ/edit?usp=sharing" target="_blank">here</a>.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Greg</span></div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-89490857967220092852013-12-05T02:13:00.000+00:002013-12-05T02:13:38.903+00:00LabVIEW: Creating Custom Templates and Sample Projects<div style="text-align: justify;">
<span style="font-family: inherit;">The new ‘Create Project’ feature added to LabVIEW 2012 is great and I use it a lot when starting a program. However, I found myself making common changes to the templates before I started writing a program. The main changes were removing the ‘Something’ buttons and events. This isn’t a lot of work but does take time and becomes rather tedious.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">One solution is to use the Create Project feature with a custom template. It is rather easy to set up and works really well after getting over a few minor hurdles.</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I started off with creating a new QMH project from the default template. I made a few changes to the project and then saved the project how I wanted the template to work.</span></div>
<div style="text-align: justify;">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9bClrLx5wmxGUi6gBbvq1u1ZWItxl1sUM7hHkeWLxpV1wGX5oB7koKmCO6XQBpYKLduXn6ALuw9IanH5uG5u_fwEKU8rQWVxFem3ZWZ4tBmIElvPaP2ZZWXm_jNppsojovOhirRSkARw/s1600/New+Project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9bClrLx5wmxGUi6gBbvq1u1ZWItxl1sUM7hHkeWLxpV1wGX5oB7koKmCO6XQBpYKLduXn6ALuw9IanH5uG5u_fwEKU8rQWVxFem3ZWZ4tBmIElvPaP2ZZWXm_jNppsojovOhirRSkARw/s400/New+Project.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Some of the changes that I made were:</span></div>
<div style="text-align: justify;">
</div>
<ul>
<li><span style="font-family: inherit;">Removing the Something and Something Else buttons, events and cases</span></li>
<li><span style="font-family: inherit;">Changed the queue message from a String to a Type Def Enum. This makes the Consumer case a lot easier to set up and eliminates spelling mistakes</span></li>
<li><span style="font-family: inherit;">Added a case to read in a configuration XML file</span></li>
<li><span style="font-family: inherit;">Replaced constants with <a href="http://etchingpathways.blogspot.hu/2013/11/labview-looking-at-constants-differently.html" target="_blank">variable constants</a></span></li>
<li><span style="font-family: inherit;">Remove the Stop button to use the ‘X’ to stop the program</span></li>
</ul>
<br />
<div style="text-align: justify;">
<span style="font-family: inherit;">Once you have the template set up, save the project and close it. Navigate to the ‘LabVIEW Data’ folder in ‘My Documents’. Inside this folder, create new folders with the following structure. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">--ProjectTemplates</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"> |--CategoryOverides</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"> |--MetaData</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"> |--Source</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Place your template into the Source folder. Make sure that Auto Populating Folders is DISABLED in the .lvproj. This caused me a lot of troubles getting set up.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">The next thing to do is create an xml file in the MetaData folder. Call this file TemplateMetaData.xml. I used the default xml file as a template to get started. This is what my file looks like:</span><br />
<span style="font-family: inherit;"><br /></span>
<script src="https://gist.github.com/gregpayne/0daddc291decd83f0282.js"></script>
<span style="font-family: inherit;">To get an explanation on the different keywords, have a look at </span><a href="http://www.ni.com/white-paper/14045/en/" style="font-family: inherit;" target="_blank">this</a><span style="font-family: inherit;"> white paper from NI.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Once you have the xml file saved in the MetaData folder and the template project in the Source folder, you should be ready to go.</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaTlur4dg2kTuskdOQAeXtnwtSOk6lPFb_El5z6tjGQgsY-xo2Mu9q1bdLMk8ApaSQDGb5kWICPF371sZ6omKWTiF6mylD03QrWUSHAyxLs27hrXYZA7LfG3UNsw5-MHFriNe-ct6C1Yc/s1600/New+Custom+Project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaTlur4dg2kTuskdOQAeXtnwtSOk6lPFb_El5z6tjGQgsY-xo2Mu9q1bdLMk8ApaSQDGb5kWICPF371sZ6omKWTiF6mylD03QrWUSHAyxLs27hrXYZA7LfG3UNsw5-MHFriNe-ct6C1Yc/s400/New+Custom+Project.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">As can be seen from above, my custom project is now added to the Create Project wizard. Just follow the normal wizard to create a new project and get programming right away.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">The main problem that I ran into was setting my folders to auto populate in the template. Once I switched that off everything ran smoothly.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Have fun creating new templates and projects.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Greg</span></div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-71740271554383338292013-11-22T15:17:00.000+00:002013-11-22T15:17:14.543+00:00LabVIEW: Looking at constants differently<div style="text-align: justify;">
<span style="font-family: inherit;">I have started listening to the LabVIEW podcast by <a href="http://vishots.com/" target="_blank">VI Shots</a> and am finding them really interesting. The last one I listened to was <a href="http://vishots.com/five-ways-to-improve-your-labview-applications/" target="_blank">Five Tips to improve your LabVIEW Application</a> with Fabiola De La Cueva. After listening to the podcast, I could relate to most of the tips and see where I was going wrong.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Then earlier this week I attended NI Days where I went to a presentation by LabVIEW Champion, <a href="https://decibel.ni.com/content/blogs/labviewramblings" target="_blank">Steve Watts</a> and he spoke about the same subject. This triggered in my head that I should start to make an effort to create a set of rules for myself to stick to in all my applications.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">So today I started by looking at constants differently.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSojx2WuIPHsse_zs2NPiW61GAEG50qpPQz6OWPpnMJQA8KYrJE9Q7W3dFjvGU5eM7PPoxAskw0esX9_KOlNC0agxgCYPv6A1cB_z3qo1M2KsVVcmXg3sLsstHEtt6m2FuC1XBQViRDl4/s1600/Constants.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSojx2WuIPHsse_zs2NPiW61GAEG50qpPQz6OWPpnMJQA8KYrJE9Q7W3dFjvGU5eM7PPoxAskw0esX9_KOlNC0agxgCYPv6A1cB_z3qo1M2KsVVcmXg3sLsstHEtt6m2FuC1XBQViRDl4/s400/Constants.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">This is from Fabiola’s presentation where she asks what is a constant?</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">As can be seen from the slide above, PI is a constant, the number of seconds in a minute is a constant but the number of flux capacitors in the DeLorean might change so is therefore not a constant. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">This means that using ‘constants’ in a program should be limited to ‘True Constants’ and ‘Variable Constants’ should either be wrapped in a vi or loaded from a configuration file.</span><br />
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Wrapping a constant in a vi and adding all your applications’ constants to the project makes them easy to manage and change if needed.</span><br />
</div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I have created a library which I will add to all my projects. This library will then be used as a template for the most common constants used in an application. I then make copies of each as needed, name them ‘xxx_constant.vi’ and use a comment in the application to indicate what the constant does.</span><br />
<span style="font-family: inherit;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit5iLU6XQyIc5YlkHAbItxftJlhM00OJRRos5WadJCCjKivemlREzdqvpUxu35zv9tFMyYgNySX-JOeTdqyuPz20HHW6vSFcAY3MGvSkVZjQQ55IT8H-39LrEsgFAxhGB51acMznAyu3o/s1600/Constants+Library.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit5iLU6XQyIc5YlkHAbItxftJlhM00OJRRos5WadJCCjKivemlREzdqvpUxu35zv9tFMyYgNySX-JOeTdqyuPz20HHW6vSFcAY3MGvSkVZjQQ55IT8H-39LrEsgFAxhGB51acMznAyu3o/s400/Constants+Library.png" width="400" /></a></div>
</div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I have tried to keep the icon colour the same as the default wire colour for each type making reading the application easier. You can get a copy of my library <a href="https://drive.google.com/file/d/0ByzG2Ps_dpjcT3dLLU1uT2twdDA/edit?usp=sharing" target="_blank">here</a> if you want to have a look at it or use it.</span><br />
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">The other method mentioned in the presentation is reading variable constants in from a configuration file. I have also tried this using an XML file which works well and is quick to implement. I will do another post with my vi’s I used some other time.</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">I hope this post has been able to help someone use better style. If I have done something wrong or not understood the concept properly, please leave a comment and let me know so that I can correct it and learn better style.</span><br />
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Greg</span></div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-91479868721224941682013-10-14T08:56:00.001+01:002013-10-14T08:56:06.485+01:00LabVIEW: Certified LabVIEW Developer exam<div style="text-align: justify;">
After months of preparing and wondering when I am going to get to write the National Instruments Certified LabVIEW Developer exam, I managed to get back to the UK and into the September exam.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I felt really confident going into the exam, but a little nervous not knowing what to expect. The program I had to write was similar to the example questions with a few added twists thrown in. Doing the LabVIEW Core 3 course helped a huge amount.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I walked out of the exam rather unsure what had just happened. The first two hours went rather slowly and I thought I was doing well. Then the next two hours flew past without me even realising it. I managed to get to a natural break with about 15 minutes to go. I hadn't finished all the required functions, but what I had worked as it should so I decided to stop adding more functions. Then I spent the last 15 minutes cleaning up my style and making sure that all the code was commented. This is where most of the marks come from so I wanted to make sure I got them.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I walked out the exam not really knowing what to think. I hadn't finished the entire program which was a disappointment, but I knew what I had done worked, looked good and was commented. All I could do now was to wait. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Four weeks later and then email I had been waiting for arrived. I opened it and saw that I had PASSED. So after months of practicing, weeks of nervous waiting, I can eventually say that I am CLD certified.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="margin-left: 1em; margin-right: 1em;"><img border="0" height="108" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjpjrEfi3ZeVc1fmki_dzxxEkZCp7Auvt54FIuGahudbOqqUOWpibb0SPIj1L5Tvwho4HwLHdz3q5Ole1dXWLoxZ2h2y9ocoC2LluolEZx-yr2rt5E5H6eJsq3zkplGBdQ-ZWRFDNr7ug/s400/Certified-LabVIEW-Developer_rgb.jpg" width="400" /></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I am really grateful to everyone who helped me with advice and to National Instruments who presented amazing courses. The next step now is to find a job and get working. I can't wait and am really looking forward to putting into practice the skills that I have learnt over the last few months.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-44202509297148717672013-09-02T08:45:00.000+01:002013-09-02T08:45:27.170+01:00LabVIEW and Raspberry Pi TCP/IP Communications<div style="text-align: justify;">
A few months ago I did the <a href="http://etchingpathways.blogspot.com/2013/05/a-week-of-labview-courses-at-national.html" target="_blank">LabVIEW Connectivity</a> course at National Instruments UK. I really enjoyed it but haven't got around to trying any of the concepts out yet. Last week I decided to write a TCP/IP chat program working between LabVIEW running on my Windows laptop and Python running my Raspberry Pi.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF2pxFhCJ5sRrx_EHSuPfZ1NgDTaLFn-xbW9eNrm-oZmCHgVHmFzF02Ih_a20GvSU_O4BU3r0VJsP-AijKURtJzE3Hra7ZtEnjpkjKRc4NK0DUOX_mfVJYpugKrYPI-u5Ofd_o1pgZt_Q/s1600/LabVIEW+Python+TCP+IP.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF2pxFhCJ5sRrx_EHSuPfZ1NgDTaLFn-xbW9eNrm-oZmCHgVHmFzF02Ih_a20GvSU_O4BU3r0VJsP-AijKURtJzE3Hra7ZtEnjpkjKRc4NK0DUOX_mfVJYpugKrYPI-u5Ofd_o1pgZt_Q/s400/LabVIEW+Python+TCP+IP.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
On the left of the you can see the LabVEIW front panel running the server. On the right is the putty terminal running a Python client. At the moment I only have the functionality to connect one client to the server. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This little project got me thinking and I learnt quite a few new concepts. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><u>LabVIEW Server:</u></b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I used the LabVIEW example finder to get started. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5s3U6bB7Wft8TN7nDT44qKjxiobxBbwXy8uBkQXZRq2zVJPfLo1eX7KC4H_QpNApLug67aHReKcpobiLQEgWIz7X421Qx8XEhu5IZnDgwrpdC35wFYdvym0MuixwbcDhJQE-tl6aod0/s1600/LabVIEW+TCP+IP+Block+Diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5s3U6bB7Wft8TN7nDT44qKjxiobxBbwXy8uBkQXZRq2zVJPfLo1eX7KC4H_QpNApLug67aHReKcpobiLQEgWIz7X421Qx8XEhu5IZnDgwrpdC35wFYdvym0MuixwbcDhJQE-tl6aod0/s400/LabVIEW+TCP+IP+Block+Diagram.png" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The LabVIEW server starts off my listening for connections. I have set a 60 sec timeout for this wait. Once connected, there are two parallel loops running. One loop is used to transmit strings and the other loop is used to receive strings. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To transmit a string, the user types the string in the User Input control and presses the Return key. An end of line character is then concatenated onto the string which is transmitted using TCP Write. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To receive a string, the TCP Read function listens with a timeout of 100 ms. If a string is received, it is concatenated onto the Response String indicator. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><u>Python Client:</u></b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This is where things got interesting. I needed to use threads, timeouts and sockets, each of which I have never used before. This client was written in Python 3.2.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<script src="https://gist.github.com/gregpayne/6409958.js"></script></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I ended up using two threads. One for the transmit and the other for the receive controls.<br />
<br />
I used a global variable which is used to stop the threads when the client or server is stopped. I also needed to use a timeout in both the transmit and receive thread because the recv() and readline() methods blocked the program flow which locked up the threads if the client was stopped.<br />
<br />
With the timeout set, I could monitor the global variable and return cleanly from the thread when the client or server was stopped.<br />
<br />
First start the LabVIEW server, then within 60 sec run the Python client. The connection will be established and you will be able to send strings between LabVIEW and the Raspberry Pi. To stop the programs, either use the Stop button in LabVIEW or CTRL+C in Python. Both methods will stop both the server and the client.<br />
<br />
To download the LabVIEW and Python code, use this <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcNno1b0Z3MHFiV3c/edit?usp=sharing" target="_blank">link</a>.<br />
<br />
I am sure there are many methods to do what I have done here, even better, cleaner ones. My Python is all self taught and only being used for my hobbies. I am using my Raspberry Pi for what is was designed for; learning. If you can recommend a better way to do this, please let me know because I am always keen to learn something new.<br />
<br />
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-38968099139910752902013-08-29T12:27:00.003+01:002013-08-30T10:34:59.045+01:00Raspberry Pi: 3x3x3 LED Cube<div style="text-align: justify;">
If you do a web search for LED cubes, you will notice that they have been built so many times and anything less than 8x8x8 is a bit of a waste of time. Knowing all of this, and basically because I am bored out of my mind, I decided to go ahead and build one with old parts lying around at home. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I ended up with a small 3x3x3 LED cube connected to my Raspberry Pi. I chose 3x3x3 because no extra hardware is needed. All I needed to do was find 27 LED's which I took off an old LED matrix sign board. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-WPQp5Kafn5Wc4g6w_WkjWP-PhyL-ZkgknQeYujSCyG9aapuOacqZI3ssthBEhP2xZgPp0BigT1V4RDjsxnjWJVr4AX1bc-cDtPiDICgEPiNd5dIzrPDkMXfg_BHiB4AYmmwePtJhljk/s1600/20130829_130946.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="346" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-WPQp5Kafn5Wc4g6w_WkjWP-PhyL-ZkgknQeYujSCyG9aapuOacqZI3ssthBEhP2xZgPp0BigT1V4RDjsxnjWJVr4AX1bc-cDtPiDICgEPiNd5dIzrPDkMXfg_BHiB4AYmmwePtJhljk/s400/20130829_130946.jpg" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The basic concept is this; the cube, in this case 3x3x3, is made up of columns (9) and layers (3).On each layer, all the cathodes are connected together and in each column, the anodes are connected together. Therefore, 12 ouputs are needed to control all 27 LED's.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
By driving the layer output low and the column output high, the specific LED will turn on. Driving both the layer and column output low, will turn the LED off. By sequencing what LED is on when, you can draw different patterns. The bigger the cube, the better patterns can be drawn.<br />
<br />
<b><u>Update:</u></b><br />
I have drawn up a schematic to show the hardware connections for the cube and the cube to he RasPi's GPIO header.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6eLHpUqHixUUJm92Q5-SPg-v4k7jYbfopdntIHryKBGjodWkncRJ0YAAjNnq45hperfgFqirwcVGKsVdOwilWRmPWOMwIfECP7UTDpqW2pcgJBA1RyUqmCJzFIBfkanZARG2yMzziyQU/s1600/LED+Cube.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6eLHpUqHixUUJm92Q5-SPg-v4k7jYbfopdntIHryKBGjodWkncRJ0YAAjNnq45hperfgFqirwcVGKsVdOwilWRmPWOMwIfECP7UTDpqW2pcgJBA1RyUqmCJzFIBfkanZARG2yMzziyQU/s400/LED+Cube.bmp" width="248" /></a></div>
<br />
You can download a schematic <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcVkJkU1ZBOUtEaTg/edit?usp=sharing" target="_blank">here</a>.<br />
<br /></div>
<div style="text-align: justify;">
Take a look at this 32x32x32 LED cube that someone build.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="//www.youtube.com/embed/f1YNyQqbiF0" width="420"></iframe>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I wrote my code in Python3.2 using the Rpi.GPIO library.<br />
<br />
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-2563725169543662932013-08-28T11:36:00.000+01:002013-08-28T11:36:37.474+01:00Recipe: Beetroot Burgers<div style="text-align: justify;">
<span style="font-family: inherit;">Over the last few weeks I have been on a veggie burger quest. It all started when I tried a <a href="http://www.sexyfood.co.za/" target="_blank">SexyFood </a>burger at the <a href="http://www.bayharbour.co.za/" target="_blank">Bay Harbour Market</a> in Hout Bay. I enjoy my meat, but am also starting to find the satisfaction in non-meat products. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHhBzQiyZpNISt6SXzBFoDESKJP_D_DGnA6uu5VnsXMquFyIbWldPWQOg3LEIlyI6Kc60qNzdBRPa4LTKtqDIUn28tpwoxauSHWzV5Ym9p30EiQLS2o9uwgCgpI5gghRi7ZpsKX7x6tzQ/s1600/SexyFood+Veggie+Burger.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHhBzQiyZpNISt6SXzBFoDESKJP_D_DGnA6uu5VnsXMquFyIbWldPWQOg3LEIlyI6Kc60qNzdBRPa4LTKtqDIUn28tpwoxauSHWzV5Ym9p30EiQLS2o9uwgCgpI5gghRi7ZpsKX7x6tzQ/s400/SexyFood+Veggie+Burger.jpg" width="363" /></span></a></div>
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">These are the burger that I have been buying from SexyFood. They are great but I am not going to be able to get them when I get back home to the UK. So began my quest to create a decent veggie burger. </span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">I tried some the other day and it all ended in a rather big mess. The base was potato but they just all fell apart. I then kept my eye out for another recipe that had decent comments. That is when I came across The <a href="http://www.theppk.com/" target="_blank">Post Punk Kitchen</a> and <a href="http://www.theppk.com/2012/02/quarter-pounder-beet-burger/" target="_blank">this</a> recipe. The comments went on for ages and they were all positive so I decided to give it a go. </span><span style="font-family: inherit;">I made a few small changes but it's pretty much the same. </span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Ingredients:</span><br />
<br />
<ul>
<li><span style="font-family: inherit;">2 ½ cups cooked and cooled brown rice</span></li>
<li><span style="font-family: inherit;">2 cups cooked and drained lentils (1 can)</span></li>
<li><span style="font-family: inherit;">2 cups grated beetroot (raw) – can also use carrot but haven’t tried that</span></li>
<li><span style="font-family: inherit;">1 small onion finely chopped</span></li>
<li><span style="font-family: inherit;">Salt and black pepper (add more pepper next time)</span></li>
<li><span style="font-family: inherit;">1 teaspoon tyme</span></li>
<li><span style="font-family: inherit;">1 teaspoon dry hot mustard</span></li>
<li><span style="font-family: inherit;">1 teaspoon chilli powder (add more next time)</span></li>
<li><span style="font-family: inherit;">1 cup breadcrumbs</span></li>
<li><span style="font-family: inherit;">2 large tablespoons humus</span></li>
</ul>
<br />
<span style="font-family: inherit;">Mix all ingredients in a bowl. Use food processor to blend. I blended about ¾ of the mixture finely and left <span style="line-height: 115%;">¼ rough to </span>leave some texture, but do it how you prefer. Once blended, it is a relatively dry consistency but packs together well </span><span style="font-family: inherit;">when pressed.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Use a <a href="http://www.amazon.co.uk/gp/product/B001C68OIG/ref=as_li_ss_tl?ie=UTF8&camp=1634&creative=19450&creativeASIN=B001C68OIG&linkCode=as2&tag=etchingpathways-21" target="_blank">burger press</a> or round </span>mold<span style="font-family: inherit;"> to form the patties. I cut the top rim off a </span>yogurt<span style="font-family: inherit;"> container and used that as my </span>mold.<span style="font-family: inherit;"> My patties were about 10 cm in diameter and around 10-15 mm thick. I wrapped each patty in cling film and put them in the freezer. The ingredients above made 12 patties.</span><br />
<span style="font-family: inherit;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitlCJ5ie5h9oxjDkE_dsJRJOVktzAUJ29SmetpBr57SYqcmQvRaqvGoz8nnDy_xs-5std6m2AcQWHJ0Wk3m5m4amvAHZhRbmCFaUy3LbQs8FVpaOYbyICsCKkpetzE3A7TO-iK35-TkZs/s1600/Beetroot+Burgers.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitlCJ5ie5h9oxjDkE_dsJRJOVktzAUJ29SmetpBr57SYqcmQvRaqvGoz8nnDy_xs-5std6m2AcQWHJ0Wk3m5m4amvAHZhRbmCFaUy3LbQs8FVpaOYbyICsCKkpetzE3A7TO-iK35-TkZs/s400/Beetroot+Burgers.jpg" width="400" /></a></div>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">When ready to eat, remove from the freezer and cook from frozen. After about 10-12 min they should be cooked through and ready to eat. Because all the ingredients are grated, they cook really quickly. I am not sure how well they will braai, but with a fine grid I'm sure they will be file. I'll </span>definitely<span style="font-family: inherit;"> give it a go.</span><br />
<span style="font-family: inherit;"><br /></span>
Eat with an avo and you will not be disappointed.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08d3CYivwA6EM-XZQowM8YS9NqKYblt8FPhPCxTZv1O5Hds71ki1rbzcr9XAGkvZ1DuRSY7ht0C8YHfM70ZIfNXnXmEolKuQNp5w0difPcv6hFBOOz3LPkU79DVsN384mIvgzfUo5Ors/s1600/20130828_122600.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="370" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08d3CYivwA6EM-XZQowM8YS9NqKYblt8FPhPCxTZv1O5Hds71ki1rbzcr9XAGkvZ1DuRSY7ht0C8YHfM70ZIfNXnXmEolKuQNp5w0difPcv6hFBOOz3LPkU79DVsN384mIvgzfUo5Ors/s400/20130828_122600.jpg" width="400" /></a></div>
<br />
This is what I used for my mold to form my patties. <br />
<div>
<div>
<br /></div>
</div>
<div>
Greg</div>
</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-34287424772540418902013-07-17T09:00:00.000+01:002013-08-28T11:58:25.380+01:00LabVIEW: Twitter toolkit<div style="text-align: justify;">
I have had this post in my head for a while but just haven't gotten around typing it up yet. I came across the <a href="https://decibel.ni.com/content/groups/interactive-internet-interface-twitter-toolkit-for-labview?view=overview" target="_blank">LabVIEW Twitter Toolkit</a> some time ago and gave it a go. It took a while to understand all the security features, but once I got my head around that, everything went smoothly.<br />
<br /></div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJZz5Y6hiM2dr185oaRgGPLf-rce91N78BEwSm4t8Hk7zICk97au3phrpvQ8N_cFZ3gpDO5SUEqQC6WD0fsRqZEaZQpF3PxYriThpERA0SdcKcl3-50sxXjtw7a-SseY-masF4jyvKww4/s1600/LabVIEW+Twitter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJZz5Y6hiM2dr185oaRgGPLf-rce91N78BEwSm4t8Hk7zICk97au3phrpvQ8N_cFZ3gpDO5SUEqQC6WD0fsRqZEaZQpF3PxYriThpERA0SdcKcl3-50sxXjtw7a-SseY-masF4jyvKww4/s320/LabVIEW+Twitter.png" width="320" /></a></div>
<br /></div>
<div style="text-align: justify;">
The place to start is <a href="https://decibel.ni.com/content/docs/DOC-23379" target="_blank">here</a>. This will guide you through setting up your Twitter Developer Account and creating your application credentials. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
A few points to take note of:</div>
<div style="text-align: justify;">
</div>
<ul>
<li>You must add a callback URL, even if you just add your website. This field must be a valid URL and cannot be blank.</li>
<li>Your application must have read and write access.</li>
<li>Generate your Access Token if it has not been generated yet.</li>
</ul>
<div>
I have edited the basic single tweet example to count characters etc. Here is my version of the block diagram.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvoNGeYJ0JpodyiO0KiM3zU1fYiE-6BphB-9iM93-DHV7uBEmJoh-hT_ScXn0XxPNimXjheEUU8AQUtFZprFsEoQE_sMy90RHwlo1njo4h9l61YsSyBaMgPAlAV8zELN1CFlDnwVxpbTA/s1600/LabVIEW+Twitter+block+diagram+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvoNGeYJ0JpodyiO0KiM3zU1fYiE-6BphB-9iM93-DHV7uBEmJoh-hT_ScXn0XxPNimXjheEUU8AQUtFZprFsEoQE_sMy90RHwlo1njo4h9l61YsSyBaMgPAlAV8zELN1CFlDnwVxpbTA/s400/LabVIEW+Twitter+block+diagram+1.png" width="400" /></a></div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha5VkyngJZiCZDIAPXN6S9lmp8DEVMZlW8DoN84USS23CBmW_9vfcYp6sGhvsL31dFobkQKi_F7qdLgC6UIwHuH_YfXfX_UFmn9NMaBW6eVyxiJshwXDP-rJ84qnmdGUDWXPtCZREyjLE/s1600/LabVIEW+Twitter+block+diagram+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha5VkyngJZiCZDIAPXN6S9lmp8DEVMZlW8DoN84USS23CBmW_9vfcYp6sGhvsL31dFobkQKi_F7qdLgC6UIwHuH_YfXfX_UFmn9NMaBW6eVyxiJshwXDP-rJ84qnmdGUDWXPtCZREyjLE/s400/LabVIEW+Twitter+block+diagram+2.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
I count the characters in the Tweet string and if more than 140 are entered, I disable the Tweet button and change the font colour to red. The block diagram looks as follows.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8nQxiEsEnX5Zghfwl5Ao224LSUCJ5G_ysRDj6P_epQEn5jWs4cwieTUoSmawmYbqez7kZUsDYiAO43L15rabut33hAVfRJgLNfb1IvBuoui5twfcpZo_WbeePvv7IkVxpT8Dbd7TYx_M/s1600/LabVIEW+Twitter+front+panel+tweet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8nQxiEsEnX5Zghfwl5Ao224LSUCJ5G_ysRDj6P_epQEn5jWs4cwieTUoSmawmYbqez7kZUsDYiAO43L15rabut33hAVfRJgLNfb1IvBuoui5twfcpZo_WbeePvv7IkVxpT8Dbd7TYx_M/s400/LabVIEW+Twitter+front+panel+tweet.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh07snW0LjPgLlIMoJGaVxqVY1WIRv1biaXpWKvYJ1CsIShV0mcfnBP5CobGiEZ8Prf_ppmCxUdTt0SNCBDv38dd4Rot_ouyhyHcLv9MLYNfZbkbuT9BL58_5JCgp8N6Eh1TUaTf0cwBh0/s1600/LabVIEW+Twitter+front+panel+settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh07snW0LjPgLlIMoJGaVxqVY1WIRv1biaXpWKvYJ1CsIShV0mcfnBP5CobGiEZ8Prf_ppmCxUdTt0SNCBDv38dd4Rot_ouyhyHcLv9MLYNfZbkbuT9BL58_5JCgp8N6Eh1TUaTf0cwBh0/s400/LabVIEW+Twitter+front+panel+settings.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
So the idea is, the first time you run the program after you have set up your Twitter Application, enter only the Consumer Key and Consumer Secret. Then type a tweet and press the Tweet button. A browser tab will open and ask you to verify your application. Do this and then the tweet will be posted.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Now enter your Access Credentials and use them for every tweet in the future. By explicitly entering the Access Credentials, you prevent having to authorise your application every time you send a tweet.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
That is all there is to it. Once you have it all set up sending tweets from LabVIEW is pretty simple thanks to the toolkit.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcVThReEYyUUJnSVk/edit?usp=sharing" target="_blank">Here </a>is a copy of my application if you want to give it a go.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-43732914766525759362013-07-05T05:45:00.001+01:002013-08-28T11:59:56.696+01:00LabVIEW: CLD Timing Engine<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
After working through the <a href="http://etchingpathways.blogspot.co.uk/2013/06/labview-cld-preparation.html" target="_blank">example programs</a> from National Instruments, I found that most
of them have a common trait. Since I have worked through the programs twice and
seem to have an understanding of the architecture that I plan on using, that
might all change later today – story for another day, I am focusing on getting
set pieces of code together that I can generate quickly to save time. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
One of the very important functions that I have been practicing
is a Timing Engine. This Timing Engine needs to be able to be Started, Stopped,
Paused, Reset, have a Target Time set, indicate whether the timer Has Elapsed
and indicate the running Elapsed Time. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-EYQnuoyQe21o9jf42XHgc1hD80HHPsje-2CiYDcCesP2NefvB9P2tw9ye6nefIKtD44YCFKp6q4yjFjDzVBFpYsHY98Qf7txHMHQba_QyH59ulUh-jcGi7_5Z0ZqS2R_iV5zXyQKnX4/s1600/Main+BD.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-EYQnuoyQe21o9jf42XHgc1hD80HHPsje-2CiYDcCesP2NefvB9P2tw9ye6nefIKtD44YCFKp6q4yjFjDzVBFpYsHY98Qf7txHMHQba_QyH59ulUh-jcGi7_5Z0ZqS2R_iV5zXyQKnX4/s400/Main+BD.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
Here is my main program that I used to test my Timing
Engine. It starts off by resetting the Timing Engine and setting a Target Time. It will then run until the Target Time has been reached at which time the Time Elapsed? indicator will be set. The Timing Engine can be paused by clearing the Advance Time control and reset by pressing the Reset control. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The actual Timing Engine looks like this. (I got the idea from one of the example programs so this is not entirely my own work.) I like the way it works and can be put together really quickly so works well for me.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3W9OZRGcsLCdeRFiRA9XtpSru8QIKRu2SaPSaE6kKy78cpR-bkZ1H9eO8Kbn8Piq6wXt2q6cHP_m3FBWpm748oXTyTssg7a6WPinLmjLXrxr6Eq3pHKZwQ6ff4KNqVgEoYgKiK991SwQ/s1600/Timer+BD.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3W9OZRGcsLCdeRFiRA9XtpSru8QIKRu2SaPSaE6kKy78cpR-bkZ1H9eO8Kbn8Piq6wXt2q6cHP_m3FBWpm748oXTyTssg7a6WPinLmjLXrxr6Eq3pHKZwQ6ff4KNqVgEoYgKiK991SwQ/s400/Timer+BD.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
Basically, a time stamp is taken each time the vi is run. The previous time stamp is subtracted from the current time stamp giving the change in time (dt). If the Advance Time control is set, dt is added to the Elapsed Time and if the Reset control is set the Elapsed Time is set to zero. Once the Elapsed Time reaches the Target Time, the indicator is set. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I have used this Timing Engine for the Car Wash, Sprinkler Controller and Boiler Controller and it works really well. There are many other ways to perform this same task, but this works for me and I hope it can help you in some way.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
You can download the source files <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcdHZsZG4zYWtrZ0k/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-10879778699392164732013-06-25T19:07:00.001+01:002013-08-28T12:00:44.011+01:00My Pursuit of LabVIEW CLD Status<div style="text-align: justify;">
Over the last few weeks I have been honing my LabVIEW programming skills. Not having a full-time job at the moment, very long story, makes this learning easier; I have a lot of time on my hands, but also trickier; I only have the four example exams from the NI website and my imagination to come up with programs to write. My mind also wonders onto <a href="http://www.raspberrypi.org/" target="_blank">Raspberry Pi</a>, <a href="http://www.ti.com/ww/en/launchpad/home_head.html?DCMP=Value_Line&HQS=launchpad" target="_blank">TI LaunchPad</a>, <a href="http://en.wikipedia.org/wiki/Table_Mountain_National_Park" target="_blank">running in the fores</a>t and various other distractions. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCfonglTbrWh7Tkr1ylq4bftjcKfYdcxQ0hj-IRJLP8r1QzP2b_kVLNj3ojtRsdGWV4i0pkOEf-9RvmQZ3I4bVYUW_lM_ErcG2bMBF1FRirZ4rUzdFt6-GtRVdFjetgSBx1Jcby7IeW9g/s1600/LabVIEW+CLD.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCfonglTbrWh7Tkr1ylq4bftjcKfYdcxQ0hj-IRJLP8r1QzP2b_kVLNj3ojtRsdGWV4i0pkOEf-9RvmQZ3I4bVYUW_lM_ErcG2bMBF1FRirZ4rUzdFt6-GtRVdFjetgSBx1Jcby7IeW9g/s400/LabVIEW+CLD.gif" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: justify;">
As can be seen from my last post, I have worked through the four example exams with varying success. I have started round two to get my times <b>down </b>and skills <b>up</b>. So far so good.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I downloaded the example exams quite a while ago but for some reason I found myself back on the CLD e-kit webpage yesterday. Either a new download has recently been added or I just haven't noticed it before, but there is a a download called <a href="http://ftp.ni.com/evaluation/certification/cld_success/cld_success_package.zip" target="_blank">Preparation: Download Certification Prep Exam Sample Exercises</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This folder is brilliant. Firstly, it gives you a break from writing long, complete programs and secondly, it explains/demonstrates some fundamental processes that can be used in your final programs. The exercises are also only around 45-60min long so great when you don't have much time. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I worked through 6 today and although I knew most of the principals, it was nice to get a reminder and refresher on some of the basics.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So if you don't have the exercises yet, go and download them and have a look. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
<div style="text-align: justify;">
<ul style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 12px; list-style-position: outside; list-style-type: none; margin: 6px 0px; padding: 0px; text-align: start;"></ul>
</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-1565353529057180582013-06-04T09:04:00.000+01:002013-08-28T12:01:59.901+01:00LabVIEW CLD Preparation<div style="text-align: justify;">
I am busy getting ready for my LabVIEW CLD exam so working through the worked examples. I have just completed the first one, The ATM Machine and would really appreciate any feedback that you can provide.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYC3fow6_bTlPzdJqNmZvHudIuecJaCPXDHGeqfzfWmm3jS12nlI1fMtPiKrzkYHkRgdQmE0t6Y-SvCvEDUtEE6R-IcETmbUr3Gdm0vyXoTGJJhguUIIvQCzJtTq5UpFC1aIF4hQIsiRM/s1600/CLD+Dreaming.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYC3fow6_bTlPzdJqNmZvHudIuecJaCPXDHGeqfzfWmm3jS12nlI1fMtPiKrzkYHkRgdQmE0t6Y-SvCvEDUtEE6R-IcETmbUr3Gdm0vyXoTGJJhguUIIvQCzJtTq5UpFC1aIF4hQIsiRM/s400/CLD+Dreaming.jpg" width="380" /></a></div>
<br /></div>
<div style="text-align: justify;">
After looking at the solution, I realised that my version of the solution might have been a bit of overkill, but it works and this is a learning process for me. I will be adding all my solutions here so will try and keep this as clean as possible. If you do decide to comment, please not what solution you are commenting for.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<strong>What I have learnt from the example exams:</strong></div>
<ul>
<li style="text-align: justify;">If you get stuck on a section. leave it, carry on and come back to it later. It’s better to get as many sections completed as possible rather than having one section not working and the rest not done as time ran out. I got stuck on one section for 45min and was just getting frustrated with myself. I eventually got up and left it for a few hours, I know you cant do this in the exam. When I came back to look at it, I solved the problem in 5min, a Boolean constant was false instead of true.</li>
<li style="text-align: justify;">Document, document, document. Do documentation as you are writing the code. There might be no time left at the end to get your documentation done and it is a HUGE part of the total mark. I still need to do much better here. </li>
<li style="text-align: justify;">A quote that I heard while doing an <a href="http://www.edxonline.org/" target="_blank">edX</a> online course. “Comments should describe things that aren't obvious from the code: WHY, not what" John Ousterhout</li>
<li style="text-align: justify;">Practice, practice, practice. There are a few tricky areas that I have picked up by doing the example programs. Small/simple things that have taken a lot of time to figure out. Just being aware of these might save you a lot of time. </li>
<li style="text-align: justify;">Test your code regularly. The more you test the better the chance of you having a working program to submit. I test my code after every change I make. This might be overkill, but at least I know that I will always have working code with the functionality that I have added. </li>
<li style="text-align: justify;">When I redo the example exams next week, I am going to start getting into the habit of backing up my code. I currently use Tortoise SVN to make regular backups but this is not available for the exam. Keep a working copy and backup after you finish a section. </li>
<li style="text-align: justify;">Use breakpoints, extra indicators and the probe tool to debug. Sometimes a simple problem that can a long time to figure out, but this time can be drastically reduced by using the tools available.</li>
</ul>
<div style="text-align: justify;">
------------------------------------------------------------------------------------------------------------</div>
<div style="text-align: justify;">
<b><u>ATM Machine 1:</u></b></div>
<div style="text-align: justify;">
Here are some questions that I have:</div>
<ul>
<li style="text-align: justify;">Is it necessary to provide HTML help files for every VI? Takes quite a bit of time which could be used elsewhere. </li>
<li style="text-align: justify;">For the exam, do you need to make an executable to provide with the solution? </li>
<li style="text-align: justify;">I know my 'Enter Pressed' case in the MHL needs some work. </li>
<li style="text-align: justify;">Is there a way to update a single element in the Accounts.txt file or do you need to rewrite the whole file?</li>
</ul>
<div style="text-align: justify;">
You can find my post on the NI Forums <a href="http://forums.ni.com/ni/board/message?board.id=Certification&message.id=820#M820" target="_blank">here</a>.</div>
<div style="text-align: justify;">
Or you can get a copy of the code <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcTUZJQ3ZiU0pTVGc/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
------------------------------------------------------------------------------------------------------------</div>
<div style="text-align: justify;">
<strong><u>Boiler Controller 1:</u></strong></div>
<div style="text-align: justify;">
I have just finished the Boiler Controller example. This took me around 5 hours so I’m getting quicker. Need to practice some common VI’s that I use so that I can get those done quickly. I found the question not as clear as the ATM Machine but I think I got there. </div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Some questions again:</div>
<ul>
<li style="text-align: justify;">The Stop button; is that just to stop the application because the shutdown button just restarts the application. </li>
<li style="text-align: justify;">I ended up using quite a few local variables but not sure if that’s OK. Is there another way to do things. The main place I used them was for the start and shutdown process to remember the button states and valve position value. </li>
<li style="text-align: justify;">My Time Count only counts in seconds. Is it necessary to count in milliseconds? </li>
<li style="text-align: justify;">Is it necessary to disable any controls or indicators during certain steps? As far as I can see it doesn’t say so.</li>
</ul>
<div style="text-align: justify;">
You can get a copy of the code <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcMjRmTW10QWJaUGs/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
------------------------------------------------------------------------------------------------------------</div>
<div style="text-align: justify;">
<strong><u>Car Wash 1:</u></strong></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
This exam was by far the trickiest so far. Once I managed to get my head around the timing system, then the rest of the program just fell into place. I started yesterday and finished it this morning for a total time of around just over 5 hours. Practice is still needed but I am slowly starting to used to some concepts which I will study and hope to be able to use in the CLD exam.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Only one questions this time:</div>
<ul>
<li style="text-align: justify;">Is it better to update the display in an Update Display case or each time outside the case but inside the While loop like I did in this program? I found it easier to do it this way.</li>
</ul>
<div style="text-align: justify;">
You can get a copy of the code <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcWHg0c05ZZFh3VWM/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
------------------------------------------------------------------------------------------------------------</div>
<div style="text-align: justify;">
<strong><u>Sprinkler System 1:</u></strong></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
I finished the Sprinkler system in just over 4 hours which included being stuck on one part for over an 45min. Out of the four examples, I feel this one was the easiest to complete. I am not sure if is because of the practice that I have been having, or because it is the easiest question. I feel that I am getting there which is good.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Next is to practice some common components that I can build quickly to save time, like the timing engine and getting the front panel built as quick as possible. </div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
You can get a copy of the code <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcVTVfTTFIaG5zOUU/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
------------------------------------------------------------------------------------------------------------</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Thanks in advance for all your advice.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-87578425399766275942013-06-02T11:17:00.000+01:002013-08-28T12:02:48.653+01:00Raspberry Pi: MCP23008 Port Expander<div style="text-align: justify;">
I have been wanting to get an <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en021393" target="_blank">MCP23008 </a>I2C port expander connected to my Raspberry Pi for quite a while. I finally got one and during my breaks from LabVIEW CLD exam preparation, made the circuit on some strip board. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxKf9czHMKstA1n7CYhSAt8UAgE43KNBHkOX_fDbEdui96ZFEh77h8LKMht0tmPWCkpwRFD8MSu15oOFHgAw7yFnp4Id52UVgHYEcLD9KWrgsSQRfN9wuZFGWOpwg3zHhc8lxSLqqvRTA/s1600/20130530_174155.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxKf9czHMKstA1n7CYhSAt8UAgE43KNBHkOX_fDbEdui96ZFEh77h8LKMht0tmPWCkpwRFD8MSu15oOFHgAw7yFnp4Id52UVgHYEcLD9KWrgsSQRfN9wuZFGWOpwg3zHhc8lxSLqqvRTA/s400/20130530_174155.jpg" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
Using the <a href="https://github.com/quick2wire/quick2wire-python-api" target="_blank">Quick2Wire </a>Python I2C library makes getting this working really quick and easy. Just make sure you place your LED's the correct way around. I spent a bit of time debugging the I2C until I thought of checking the obvious. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Currently I only have the outputs working as I didn't have any switches with me. I'll add two switches and get that going next. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Here is the code that I used. I set up a little menu to select which LED to turn on or off. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<script src="https://gist.github.com/gregpayne/d20b8cb8803c2ac4afcd.js"></script></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Next I plan to get the software PWM working so that I can connect up to <a href="http://www.cheerlights.com/" target="_blank">Cheerlights</a>. Need to do some more studying and then will get that going. Also need some RGB LED's first.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Until next time, happy coding.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-2457739780323975472013-05-20T17:42:00.001+01:002013-08-28T12:04:04.608+01:00A week of LabVIEW courses at National Instruments<div style="text-align: justify;">
Last week I sat my first two LabVIEW courses. I have been wanting to do some courses for a long time but have never really had the opportunity. Fortunately as I am not working at the moment, I got the time to do them. As I did my <a href="http://etchingpathways.blogspot.co.uk/2013/03/labview-clad-certified.html" target="_blank">CLAD </a>exam a few months ago, I decided to to <a href="http://sine.ni.com/tacs/app/overview/p/ap/of/lang/en/ol/en/oc/gf/pg/1/sn/n24:12754/id/1584/" target="_blank">LabVIEW Core 3</a> and <a href="http://sine.ni.com/tacs/app/overview/p/ap/of/lang/en/ol/en/oc/us/pg/1/sn/n24:12878/id/1581/" target="_blank">LabVIEW Connectivity</a>.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyH-cxwvh0JXTf-BYULLVjlAgE8j9S7pfq4fKCAEjOb_BtXNdptXeJ9e8yl6JDlUlxJlvFlMW9RKesRTpE37Aan-03XzNY6UlnjKu_YB7yc2Rv13w1WuaWQ_C2A3NKvrlnrXR8J2HOarE/s1600/LabVIEW+Core+3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyH-cxwvh0JXTf-BYULLVjlAgE8j9S7pfq4fKCAEjOb_BtXNdptXeJ9e8yl6JDlUlxJlvFlMW9RKesRTpE37Aan-03XzNY6UlnjKu_YB7yc2Rv13w1WuaWQ_C2A3NKvrlnrXR8J2HOarE/s400/LabVIEW+Core+3.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSo5cC9iJjQVnsHAOjXCRLyGigesIWj7hpQBUvrs9_wT4Ozt53IvFYdTANZUIC-68nLtYUm9UDsVO4FWSNbXpWodp_vD4lKTs2q-JsesT-60q4V8c0XYLp57P_UJe_oTPkz6CTfiUCGK0/s1600/LabVIEW+Connectivity.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSo5cC9iJjQVnsHAOjXCRLyGigesIWj7hpQBUvrs9_wT4Ozt53IvFYdTANZUIC-68nLtYUm9UDsVO4FWSNbXpWodp_vD4lKTs2q-JsesT-60q4V8c0XYLp57P_UJe_oTPkz6CTfiUCGK0/s400/LabVIEW+Connectivity.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: justify;">
LabVIEW Core 3 was on Monday to Wednesday and then LabVIEW Connectivity was on Thursday and Friday. The week was really packed in, but the amount of hands-on time kept us busy and focused.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Over all I got more out of Core 3 and will definitely be using many of the concepts in my future programs. I have also thought back to some of my first programs and realised that I could have made them so much better in many ways. I am planning on doing my CLD exam around August so will be going over many of the topics in my practice programs. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I found Connectivity a more fun course where we learnt how to use many network tools and tools to include shared libraries from .net and many other programming languages.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The examples that you work through for both courses are very in depth and explain the concept being taught very well. The instructors that lead the course are very knowledgeable and helpful about the course subject and other questions and topics that arise during the discussion periods. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I highly recommend taking one or many courses that NI offer as this is a great way to learn quickly. The learning curve that I went through a few years ago when I learnt LabVIEW by myself would have been drastically shortened had I done some courses sooner. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Go on, give your <a href="http://sine.ni.com/apps/utf8/nicc.call_me" target="_blank">NI representative</a> a call and book a course today. You will not regret it one bit.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-38801056536725950172013-04-24T09:29:00.001+01:002013-08-28T12:05:35.843+01:00Raspberry Pi temperature profile using LabVIEW<div style="text-align: justify;">
Connected to my Raspberry Pi is a DS18B20 temperature sensor which I have mounted inside the case roughly above the processor. I wanted to map the temperature profile inside the case and have a visual representation of it. To do this I joined up a <a href="http://www.python.org/download/releases/3.2/" target="_blank">Python </a>script, an <a href="http://www.sqlite.org/" target="_blank">SQLite3 </a>database and <a href="http://www.ni.com/labview/" target="_blank">LabVIEW</a>.</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpVpLaZP8fiwwnUY3tsV9qGoFRhAZZ_skxmU7CH78YNyN285owc4K79EVWjIZgtxKsVdmMv80YeeIKvwMZKVwPOP1IpauwSqIqIUcWCDt7IqXlo2pYbYnSAheKYqbctcRDnmGMJNFEDwg/s1600/Raspberry+Pi+Temperature+profile.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpVpLaZP8fiwwnUY3tsV9qGoFRhAZZ_skxmU7CH78YNyN285owc4K79EVWjIZgtxKsVdmMv80YeeIKvwMZKVwPOP1IpauwSqIqIUcWCDt7IqXlo2pYbYnSAheKYqbctcRDnmGMJNFEDwg/s400/Raspberry+Pi+Temperature+profile.png" width="375" /></a></div>
<br /></div>
</div>
<div>
<div style="text-align: justify;">
I only have one temperature sensor connected and the RasPi doesn't run very warm so this image is rather exaggerated. I'll explain a bit more later.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
So I started off by writing a Python script that runs on my RasPi. It measures the temperature and then logs it to a SQLite3 database that I store in a shared folder on a mounted USB flash drive. I have accelerometer data in the database too, but that will be added a bit later.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<script src="https://gist.github.com/gregpayne/83667b620b8f2adab0fe.js"></script>
<br />
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
That is all that happens on the RasPi. Next I wrote a LabVIEW program that queries the database over the network to get all the data. I need to do a bit of work on my query to just return the last line of data but that I'll add in future versions.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To query the SQLite3 database, I used the <a href="http://lavag.org/files/file/212-sqlite-labview/" target="_blank">this </a>toolkit which works really well and is super simple to get set up. Once I have the temperature, I need to display it on in user interface. This is where Sensor Mapping Express VI comes in really handy.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqfYuGKwFuYItom8m4RnUYH-eJ3rWhts1XnKgmzY4l_tpbW5aARJAFAvCfSexztZoXMdOc395bz1Yi_gDuVvDzXvOi-fkW_CJiGCXp2y554UcFOfq2vY97M-rQSDQsdWuoY14bNV5sq-8/s1600/Sensor+Mapping+Express+VI.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqfYuGKwFuYItom8m4RnUYH-eJ3rWhts1XnKgmzY4l_tpbW5aARJAFAvCfSexztZoXMdOc395bz1Yi_gDuVvDzXvOi-fkW_CJiGCXp2y554UcFOfq2vY97M-rQSDQsdWuoY14bNV5sq-8/s400/Sensor+Mapping+Express+VI.png" width="400" /></a></div>
<br /></div>
</div>
<div>
<div style="text-align: justify;">
All you need to do is point to your .stl file and select where you want to the temperature sensors to sit on the RasPi. I used <a href="http://sketchup.google.com/3dwarehouse/details?mid=f73210983e2a2263fdbbb98e1470ed1d&prevstart=0" target="_blank">this </a>model which I converted using Google SketchUp. This is where I had to use four dummy senors to be able to show the temperature difference. I have set the outside 4 sensors to 0 degrees Celsius and only sensor 0 is getting the temperature from the database. With more sensors this can be made a lot more accurate. As I said earlier, this is just to prove a concept for now.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Every 100ms I query the database, build an array with the temperature data and then apply it to the Sensor Mapping Express VI. The temperature profile then changes according to the surface temperature of the RasPi.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Here are the colours that I used for my mapping:</div>
<div style="text-align: justify;">
<br /></div>
<blockquote class="tr_bq">
<div style="text-align: justify;">
Temperature vs Colour mapping:</div>
<div style="text-align: justify;">
0 Celsius R-0 G-0 B-255</div>
<div style="text-align: justify;">
21.25 Celsius R-0 G-255 B-255</div>
<div style="text-align: justify;">
42.5 Celsius R-0 G-255 B-0</div>
<div style="text-align: justify;">
63.75 Celsius R-255 G-255 B-0</div>
<div style="text-align: justify;">
85 Celsius R-255 G-0 B-0</div>
</blockquote>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I have already connected up an ADXL345 accelerometer which is acquiring tilt and pitch values, so my next step is to be able to move the model in LabVIEW as I move my physical RasPi. Should be some fun for a few more hours.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you want a copy of my code, you can grab it over <a href="https://docs.google.com/file/d/0ByzG2Ps_dpjcT1VYbjgwUlhsek0/edit?usp=sharing" target="_blank">here</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Please feel free to leave any tips, comments or questions below.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-11156297327342608912013-04-22T07:06:00.000+01:002013-04-22T07:06:11.374+01:00Route static files for BottlePy web framework<div style="text-align: justify;">
I have been using <a href="http://bottlepy.org/docs/dev/" target="_blank">BottlePy </a>on my <a href="http://www.raspberrypi.org/" target="_blank">Raspberry Pi</a> for quite some time. I really like the simplicity of the framework and the ease at which you can get something up and running. The one issue I had, was that you could not load static css or js files. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
There are ways around this, like placing your files in <a href="https://gist.github.com/" target="_blank">Gist </a>and linking to the raw code, but this can be an issue when you want to run your webserver 'offline'. The <a href="http://bottlepy.org/docs/dev/tutorial.html?highlight=static" target="_blank">documentation </a>is not very clear on how to do this, so here is what I did to get it working properly. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This is the template that I use to route the static files. This is part of my main python code that runs the server.</div>
<div style="text-align: justify;">
<br /></div>
<script src="https://gist.github.com/gregpayne/b4cea9fcd1355a5f7183.js"></script>
<div style="text-align: justify;">
Then all you need to do is add your file names in the .tpl file. By doing this, your css, or js files can be stored locally so they can still be served if you are offline. </div>
<div style="text-align: justify;">
<br /></div>
<script src="https://gist.github.com/gregpayne/289744e50cef90eed3c5.js"></script>
<div style="text-align: justify;">
That is about it. I hope this helps because I really find this framework great to use and works flawlessly on my Raspberry Pi.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-31765981065400352202013-04-22T06:32:00.000+01:002013-08-28T12:08:09.475+01:00Source Control for LabVIEW using TortoiseSVN<div style="text-align: justify;">
For a long time now I have been using LabVIEW, but I am not very diligent at using source control. Source control is one of those things that you never really need until it's too late. So this weekend I decided to install <a href="http://tortoisesvn.net/" target="_blank">TortoiseSVN </a>on my laptop to start out small, but get into the habit of backing up and recording the changes I make to my code. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To get up and running is rather easy. Go over to <a href="http://tortoisesvn.net/" target="_blank">TortoiseSVN</a> and download the install file. Once installed, you are ready to get going. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The first thing to do is make a folder somewhere to store your repository. I called mine svn_repos. Now right click, you will see an option for TortoiseSVN. Select the Create repository here option from the drop down menu. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpmx8DL5Gzm_UhJMuvzDldIsqS2nEA7HOvYzduxHz4UBZd8u8Q0oo2_f9nWdXJDlRL81p0099Al0AVio-8kDvHlS39BsUXXnr4mTxtvrhdV5DH-b74gVNj80OOgGQmXeNWoSkjwlm6_nE/s1600/TortoiseSVN+create+repository.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpmx8DL5Gzm_UhJMuvzDldIsqS2nEA7HOvYzduxHz4UBZd8u8Q0oo2_f9nWdXJDlRL81p0099Al0AVio-8kDvHlS39BsUXXnr4mTxtvrhdV5DH-b74gVNj80OOgGQmXeNWoSkjwlm6_nE/s400/TortoiseSVN+create+repository.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
Once you have created the repository, go over to the folder that you want to back up. Right click on the folder and select the import option under the TortoiseSVN menu. A window will pop up where you need to enter the path and details of the change. My folder name is TemperatureLogger so just change that in the path to suit your folder.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglmWYG0w8qg5mijqQofWuv_JXHTQIldCTNhaqqhZfeEnYtnyfTK8TL5ilS4r82ZKbD1qkd7JiotXj3ixmQobiRbU4HP-ARRt3yb-GnhBxnlpmRTnmw39KJExEAce-bYQ0FRBnfwyM8w6o/s1600/TortoiseSVN+import.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglmWYG0w8qg5mijqQofWuv_JXHTQIldCTNhaqqhZfeEnYtnyfTK8TL5ilS4r82ZKbD1qkd7JiotXj3ixmQobiRbU4HP-ARRt3yb-GnhBxnlpmRTnmw39KJExEAce-bYQ0FRBnfwyM8w6o/s400/TortoiseSVN+import.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
Press OK and all the files in that folder will be backed up.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Now you need to get a working copy. I use the same folder but you can select any folder for your working copy. Right click on the folder that you have just imported and select the SVN Checkout option. Select your path and if it is the same path you will get a warning. Click OK and when the checkout is complete, you will notice that there is a green tick icon over the folder. When you make any changes to the files, that green icon will turn red.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The LabVIEW part is to now install the <a href="http://jki.net/" target="_blank">JKI Toolkit</a> for TortoiseSVN. Firstly you need to install the <a href="http://jki.net/vipm" target="_blank">VI Package Manager</a>. Once installed, search for TortoiseSVN in the user interface and install it. This takes a couple of minutes and needs your input for a few of the steps.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Once everything is installed, open one of the files that you previously imported and checked out in LabVIEW. Make any change and then save it. You will now notice that there is a red icon over the files that have been changed. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7FQv3nT8wSa1qkMY0ZxPzghIaSXywe1wMKV9tqp023c5LOfdVeYxqZmMJKXkxygwCfDu2cfs1JtjGNPs-fPy5daB1bRemUenzLbw3LPAsWccGswUpc_hkYzjH0XWTeLYMyQ8-Q3nQJR4/s1600/TortoiseSVN+changes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7FQv3nT8wSa1qkMY0ZxPzghIaSXywe1wMKV9tqp023c5LOfdVeYxqZmMJKXkxygwCfDu2cfs1JtjGNPs-fPy5daB1bRemUenzLbw3LPAsWccGswUpc_hkYzjH0XWTeLYMyQ8-Q3nQJR4/s400/TortoiseSVN+changes.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
In LabVIEW, go to tools > TortoiseSVN > commit. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI3tY5iAKXfwsROwRX-sFsV3U0ElQDnRAkcLtxHqk64sNcuvdSYXeTOpt4rPH6h53H4sO-f7T5ihfxBc52f_5umEW0Oco55rYEM2Csm9zvMoA5QhD6XriHPFGCOgzN9TjmAEwi2FD-2aM/s1600/TortoiseSVN+LabVIEW+commit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="398" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI3tY5iAKXfwsROwRX-sFsV3U0ElQDnRAkcLtxHqk64sNcuvdSYXeTOpt4rPH6h53H4sO-f7T5ihfxBc52f_5umEW0Oco55rYEM2Csm9zvMoA5QhD6XriHPFGCOgzN9TjmAEwi2FD-2aM/s400/TortoiseSVN+LabVIEW+commit.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
Here you will be given the option to add a comment for the changes that were made. This helps you track your changes over time.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf0Y2E8LlBVf16fXppQ7pFnudQuGZ-Rb0qY3y9b60_oweeYvz8VLdjVNi7x1gZ5UI5Luhvf70a1mcNMdKR91OeF24wb_usy_rqzo3o8a3JbaKFppnAuYyx-O4xmGjHyNi9pb6r0YKypLk/s1600/TortoiseSVN+LabVIEW+commit+changes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="337" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf0Y2E8LlBVf16fXppQ7pFnudQuGZ-Rb0qY3y9b60_oweeYvz8VLdjVNi7x1gZ5UI5Luhvf70a1mcNMdKR91OeF24wb_usy_rqzo3o8a3JbaKFppnAuYyx-O4xmGjHyNi9pb6r0YKypLk/s400/TortoiseSVN+LabVIEW+commit+changes.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
You will now notice that icons over the files are back to green letting you know that you have backed up all your files.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVgoomoKY-GYLkPqhZv54enhE9j23FLp1fe83dGC2l9GdTUT6DaNebe7Jx_jFonOonN5ChbxmQkssRWSevKYsyttBS6hIJb4GUBZ9j6QQhrC8u7K4sMe4O9xIQ1FMJKMJpoZJAdQmGoHo/s1600/TortoiseSVN+LabVIEW+green.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVgoomoKY-GYLkPqhZv54enhE9j23FLp1fe83dGC2l9GdTUT6DaNebe7Jx_jFonOonN5ChbxmQkssRWSevKYsyttBS6hIJb4GUBZ9j6QQhrC8u7K4sMe4O9xIQ1FMJKMJpoZJAdQmGoHo/s400/TortoiseSVN+LabVIEW+green.png" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
You can also get these options directly from Windows Explorer, but it is really convenient to have the option to back up your work directly from LabVIEW. There are many more tools to be used and they are explained pretty well in the <a href="http://tortoisesvn.net/support.html" target="_blank">documentation</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Well I hope this helps you start to back up and document the changes that are made to your programs. Please don't forget that this can be used for any type of files, not just in LabVIEW. All you need to do is right click on the file or folder and choose the option under the TortoiseSVN menu.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-59882800969171745082013-04-16T09:20:00.000+01:002013-08-28T12:08:58.320+01:00Raspberry Pi: Direct connection to Windows 7<div style="text-align: justify;">
This is something I have been wanting to try for quite some time but never really found much info on how to do it. Well I sat down the other day to get it done and realised that it is MUCH easier than I expected.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
My objective is to directly connect my Raspberry Pi to my laptop using an ethernet cable. In the next few months I am going to be away from a decent internet connection but I still wanted to do some work on my RasPi. So my Google searching started, finished and here is what to do.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The process uses a built-in feature of Windows 7 called Internet Connection Sharing (<a href="http://windows.microsoft.com/en-gb/windows-vista/using-ics-internet-connection-sharing" target="_blank">ICS</a>). In a nutshell, you can use any Windows computer with more than one network connection, WiFi and LAN, and share the connection to other computers. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Firstly you need to set up the settings on Windows. You need to go to the properties of your disconnected LAN connection and click on the sharing tab. Then check the box to allow other network users to connect through this internet connection.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGWvH35iCTsNnXa1EWuY5ezEE7o-ZGEvS6xyCvy5jvmJvNpjzj9JtoQXLDM2fc0Xwg2a_VHDiuMpVgyae4iPAnBJF9VT_j3_Bma3gQrUGX0dCTdY5YklQEv8cx3SKu03tHfcotRaaqXAY/s1600/LAN+Sharing.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGWvH35iCTsNnXa1EWuY5ezEE7o-ZGEvS6xyCvy5jvmJvNpjzj9JtoQXLDM2fc0Xwg2a_VHDiuMpVgyae4iPAnBJF9VT_j3_Bma3gQrUGX0dCTdY5YklQEv8cx3SKu03tHfcotRaaqXAY/s400/LAN+Sharing.png" width="317" /></a></div>
<br /></div>
<div style="text-align: justify;">
The tricky thing to set up is the IP address that you are going to give the RasPi. You need to check the TCP/IPv4 settings under the Networking Tab. I picked an IP address and gave my RasPi a static address so that I know what it is when ever I use this connection.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Next you need to power up your Raspberry Pi and connect to it some way. Either use a WiFi connection that is already set up, an ethernet connection to your router or using the serial port on the GPIO.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
You then need to set up the IP address by editing the interfaces file.</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo nano /etc/network/interfaces</span></blockquote>
<div style="text-align: justify;">
Change the part of the file that refers to your eth0 connection to look similar to below. You might have other settings in there like WiFi IP addresses and passwords but just leave those alone.</div>
<div style="text-align: justify;">
</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">iface eth0 inet static</span> </blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"></span><span style="font-family: Courier New, Courier, monospace;">address 192.168.137.184</span> </blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"></span><span style="font-family: Courier New, Courier, monospace;">netmask 255.255.255.0</span></blockquote>
<br />
<div style="text-align: justify;">
Once you have saved the interfaces file, send the shutdown command so that you can change over the connections. Once powered off, directly connect your RasPi ethernet port to your Windows ethernet port. You should be able to use both straight-through and cross-over cables. Now power up the RasPi.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Once booted up, you should be able to log in with Putty to the static IP address that you set above. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And that is pretty much it. Another cool thing by connecting this way is that you should be able to power your Raspberry Pi from your computer USB port. This makes transport really easy as all you need is an ethernet cable and a USB cable to get up and running. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Hope this helps and if you have comments or questions, please leave them below and I'll get back to you as soon as I can.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com2tag:blogger.com,1999:blog-1371984308505189336.post-25344109912671642172013-03-18T17:21:00.002+00:002013-03-18T17:21:22.189+00:00Suspension Training workout<div style="text-align: justify;">
I got a<a href="http://www.rip60.com/" target="_blank"> rip:60 </a>suspension trainer for Christmas last year and have been using it on and off for the last few months. I started out doing the videos, but after a few weeks I hurt my knee running so took a few weeks off. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Three weeks ago I started again, but this time with my own program. I used the wall chart that comes with the package and just picked a few moves that I wanted to do. I stayed away from squats and exercises that put too much pressure on my knees so concentrated mainly on upper body moves. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Here is my routine that I have done five days a week for the last four weeks. I can already see results and will change it up next week.</div>
<br />
Do a 10 - 15min warm up before completing any exercise.<br />
<br />
10 reps each leg Alternating Lunge with Rear Delt Fly<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3FSVC3jcNPPZKbVUf_8PBYwksSVN7n7UNu1h4zgNveQ2juUyWyqHgpbcv-LEbi5tce-viMZ2aRXG-0eI8Fno8dRtQ9YCYV0Vxs9v_i07roslXdVPxctm__WCmALr_XCbG7w4-qGKlEzk/s1600/Alternating+Lunge+with+Rear+Delt+Fly.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3FSVC3jcNPPZKbVUf_8PBYwksSVN7n7UNu1h4zgNveQ2juUyWyqHgpbcv-LEbi5tce-viMZ2aRXG-0eI8Fno8dRtQ9YCYV0Vxs9v_i07roslXdVPxctm__WCmALr_XCbG7w4-qGKlEzk/s200/Alternating+Lunge+with+Rear+Delt+Fly.jpg" width="200" /></a></div>
<br />
15 reps Fly<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlF9gWgzZOUZiwdV8cIMa8AQeydbIeQ6_0oEGu3ytXo3o5ol7EKl3AvsvLUuVQyYtyhzo68RxT3BiJSA-w-vr3hgL8bvuaZ_XtCGL479RnihNcau-Ot3X6BIJN9ROuEVBRVWrW_BUlk9U/s1600/Fly.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlF9gWgzZOUZiwdV8cIMa8AQeydbIeQ6_0oEGu3ytXo3o5ol7EKl3AvsvLUuVQyYtyhzo68RxT3BiJSA-w-vr3hgL8bvuaZ_XtCGL479RnihNcau-Ot3X6BIJN9ROuEVBRVWrW_BUlk9U/s200/Fly.jpg" width="200" /></a></div>
<br />
10 reps Lat Pull Down<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUtklVKUHZAKd2OW8QFV4J-o0QdXs4ILmJwTHbpWlLuFf5-8sBCIUnedl8gumhLpZikB4hPC45-9whrvQtOQ-SB3EzgHDj9ts8HEEi_Tz-6wePcB3Twi4Ry7tfJF_WD5ZqaUCsMjWykQc/s1600/Lat+Pull+Down.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUtklVKUHZAKd2OW8QFV4J-o0QdXs4ILmJwTHbpWlLuFf5-8sBCIUnedl8gumhLpZikB4hPC45-9whrvQtOQ-SB3EzgHDj9ts8HEEi_Tz-6wePcB3Twi4Ry7tfJF_WD5ZqaUCsMjWykQc/s200/Lat+Pull+Down.jpg" width="200" /></a></div>
<br />
2 sets of 60 sec Plank using suspension trainer to support your feet<br />
<br />
10 reps Tricep Extension with Roll Out<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIVh4vBJVmW8EfiBs2FFbMWOvKUJffJ3ANGeUB-q_1krsrdQ1nePV-0hCIjfdn8_GnYlGBirtfw2jbnucUUYWIQOFxGqyW0L5EoBFcdrs2b659C1T7xxPAqm00-qxh5IR3Ohf7Xb919Ow/s1600/Tricep+Extension+with+Roll+Out.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIVh4vBJVmW8EfiBs2FFbMWOvKUJffJ3ANGeUB-q_1krsrdQ1nePV-0hCIjfdn8_GnYlGBirtfw2jbnucUUYWIQOFxGqyW0L5EoBFcdrs2b659C1T7xxPAqm00-qxh5IR3Ohf7Xb919Ow/s200/Tricep+Extension+with+Roll+Out.jpg" width="200" /></a></div>
<br />
10 reps Bicep Curl<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJTl2XXUFgVMUQMpk4rCK1rltZBxspKy-kBr740OarlfEWCcRHehMW77UoLnTU5mm1Vn98Ox6fooSUUSfeMPrThIQnw_jwh4TD1mJJSwR-KQ14opAsfYC9cUvKtIjK3nr7XEz9vU7wh_E/s1600/Bicep+Curl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJTl2XXUFgVMUQMpk4rCK1rltZBxspKy-kBr740OarlfEWCcRHehMW77UoLnTU5mm1Vn98Ox6fooSUUSfeMPrThIQnw_jwh4TD1mJJSwR-KQ14opAsfYC9cUvKtIjK3nr7XEz9vU7wh_E/s200/Bicep+Curl.jpg" width="200" /></a></div>
<br />
15 reps Plank with crunch to Push Up<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl7z9jmcd9hrez-5DsIX7CskVU_jc3Ibauk90FKESbuxEOsMolleHTtWW89R6TpI0rqHjmmHxqYHLlQRAWY8wXeugcwHe2e4hdjZ3S4RyrmwtZMn88aGACM4q2ZnAhLmB0MizD5e440rM/s1600/Plank+Push+Up+to+Crunch.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl7z9jmcd9hrez-5DsIX7CskVU_jc3Ibauk90FKESbuxEOsMolleHTtWW89R6TpI0rqHjmmHxqYHLlQRAWY8wXeugcwHe2e4hdjZ3S4RyrmwtZMn88aGACM4q2ZnAhLmB0MizD5e440rM/s200/Plank+Push+Up+to+Crunch.jpg" width="200" /></a></div>
<br />
30 sec Plank using suspension trainer to support your feet<br />
<br />
2 sets of 60 sec Reverse Plank with Abduction<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxdpTNuw_ls5YBjaoivL9RopzzvTzMWFjXkvvXG2O1yMBJUqrgy1SQCqHN0jJ_BzdyEbJLQZPkXHDtSlcu27vMyDaIftwenA2PNtIqvrwS80_hf3kzTZKzh-aSlsYJvWZIb8MhqjNR7VU/s1600/Reverse+Plank+with+Abduction.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxdpTNuw_ls5YBjaoivL9RopzzvTzMWFjXkvvXG2O1yMBJUqrgy1SQCqHN0jJ_BzdyEbJLQZPkXHDtSlcu27vMyDaIftwenA2PNtIqvrwS80_hf3kzTZKzh-aSlsYJvWZIb8MhqjNR7VU/s200/Reverse+Plank+with+Abduction.jpg" width="200" /></a></div>
<br />
15 reps Push Ups<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMXs5FsZII-QwjfrtQAlyx5mhpsWw5vlLHLZZtKL8oP1mvHuBnEp_0xhOQzYgev07Le17NunWflML43GskoLdWjdYClsj-K0rbe0fdgFnmQNguy8EReF4DS6r_vXkKNUxwvbwonS8jAIA/s1600/Push+Up+Palms+Facing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMXs5FsZII-QwjfrtQAlyx5mhpsWw5vlLHLZZtKL8oP1mvHuBnEp_0xhOQzYgev07Le17NunWflML43GskoLdWjdYClsj-K0rbe0fdgFnmQNguy8EReF4DS6r_vXkKNUxwvbwonS8jAIA/s200/Push+Up+Palms+Facing.jpg" width="200" /></a></div>
<br />
10 reps Hammer Curl<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXp_ykslVduHb2KiURvXiN63wSR36grl5VXB2aol0dvHiJCjAAJZzHhPMWShtJmTzNSkTveuZy95VYUqvNy_1pijql7UFYsbB3lUlZfBfZ8w4N34jwHn6SkuEEJF3gmMbRHng_wkMjd6Y/s1600/Hammer+Curl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXp_ykslVduHb2KiURvXiN63wSR36grl5VXB2aol0dvHiJCjAAJZzHhPMWShtJmTzNSkTveuZy95VYUqvNy_1pijql7UFYsbB3lUlZfBfZ8w4N34jwHn6SkuEEJF3gmMbRHng_wkMjd6Y/s200/Hammer+Curl.jpg" width="200" /></a></div>
<br />
10 reps each side Plank with Oblique Crunch<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVEezumFXzir7XhqhswUjMbTo5DbcFM4j0WYVGmA5u6Zm322vu_sWBPWKoHPwZU4qRTKKOQgu-o-3_5Qv_yELBNSUlb_l6BOYZ_iVdXwXgdhNNdgd-1Ym4uVDsZauobfyprte1_0yJAuI/s1600/Plank+to+Two+Leg+Oblique+Crunch.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVEezumFXzir7XhqhswUjMbTo5DbcFM4j0WYVGmA5u6Zm322vu_sWBPWKoHPwZU4qRTKKOQgu-o-3_5Qv_yELBNSUlb_l6BOYZ_iVdXwXgdhNNdgd-1Ym4uVDsZauobfyprte1_0yJAuI/s200/Plank+to+Two+Leg+Oblique+Crunch.jpg" width="200" /></a></div>
<br />
Repeat from top once more<br />
<br />
Balance on each leg for 30 sec with closed eyes<br />
<br />
Stretch and cool down<br />
<br />
That should take about 45 min so in total with warm up and cool down should be about 60 min.<br />
<br />
GregAnonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-41653906261759464722013-03-16T08:05:00.000+00:002013-08-28T12:09:50.392+01:00LabVIEW: CLAD certified<div style="text-align: justify;">
I have been working with <a href="http://www.ni.com/labview/" target="_blank">National Instruments' LabVIEW</a> software and hardware for about 3 years now. Unfortunately I have not been able to do any courses or qualifications through the companies I have worked for so I just learnt and taught myself as I went along.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
All that changed after I moved to the UK. I went to a NI symposium and they offered a Certified LabVIEW Associate Developer (<a href="http://sine.ni.com/nips/cds/view/p/lang/en/nid/14438" target="_blank">CLAD</a>) exam at the end of the symposium for all those that wanted to take it. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I decided to go for it and make the most of the opportunity given to me. I thought it went well and was quite confident when I left the exam. However, from my experience, that doesn't always mean a good thing.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Well this morning, after waiting a few weeks, I got an email from NI with my CLAD certificate. I passed and am now CLAD certified. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0BRBR5hhylHSrjEmTm1qAYQNv8KmSyFJcw8vUEG7Ini8OUqpDB9KdlpZHcpGg7GwkCQf-qahdIi6lYYKgZkgk6-ptsW2CcEfnN8cWhroVnXNSpVUUj6mLb22oEmg1PKI_uPIeBNmO3Rc/s1600/Certified-LabVIEW-Associate-Dev_rgb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="108" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0BRBR5hhylHSrjEmTm1qAYQNv8KmSyFJcw8vUEG7Ini8OUqpDB9KdlpZHcpGg7GwkCQf-qahdIi6lYYKgZkgk6-ptsW2CcEfnN8cWhroVnXNSpVUUj6mLb22oEmg1PKI_uPIeBNmO3Rc/s400/Certified-LabVIEW-Associate-Dev_rgb.jpg" width="400" /></a></div>
<br /></div>
<div style="text-align: justify;">
I have been waiting a long time to get this certification and finally have it.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Thank you to NI who offer such an exam to those willing to work for it and stay after the symposium has ended.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0tag:blogger.com,1999:blog-1371984308505189336.post-38098873136939768582013-03-12T09:03:00.000+00:002013-08-28T12:11:23.184+01:00Raspberry Pi: NAS server<div style="text-align: justify;">
I have been wanting to set up my Raspberry Pi as a Network Attached Storage (NAS) drive for quite some time. I eventually got a chance yesterday to give it a go. Unfortunately the Raspberry Pi USB port can't power my external hard drive and I don't have a USB hub at the moment, so I just used a 16GB flash drive.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
First you need to format your external drive with NTFS. Then place a file on it. Any file will do. I chose a text document so that I can open it and view it on the Pi. Once you have set up your drive, turn off your RasPi, plug the drive into the USB port and then turn on the RasPi. It is safer to plug the USB in when the RasPi is off because some versions don't have poly fuses on the USB ports.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Once booted up, log in and check to see if the drive is connected.</div>
<div style="text-align: justify;">
</div>
<ul>
<li><span style="font-family: 'Courier New', Courier, monospace;">sudo fdisk -l</span></li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxwpIPey8ceMWW-oCVGCsFtafjIOak54YulSQBF9FHLU83boxdR_2Wi05gB2c9U-mJ-BwginAKT0zwkBZ75uSVY-i4n76xKBkfKK_8Dd2G027Ym8JVHeZFWcLoNKrmhXyJAOkNhxrF1U8/s1600/fdisk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxwpIPey8ceMWW-oCVGCsFtafjIOak54YulSQBF9FHLU83boxdR_2Wi05gB2c9U-mJ-BwginAKT0zwkBZ75uSVY-i4n76xKBkfKK_8Dd2G027Ym8JVHeZFWcLoNKrmhXyJAOkNhxrF1U8/s400/fdisk.png" width="400" /></a></div>
<br /></div>
<div>
You can see that my connected drive is right at the bottom. The drive is called sda and because there is only one partition, it is called sda1.</div>
<div>
<br /></div>
<div>
Next you need to create a folder where your drive is going to be mounted into. I called mine myHadrDrive. You also need to give the folder root access so that when you connect to it you are able to read from it and write to it.</div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo mkdir /mnt/myHardDrive</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">sudo chmod 0777 myHardDrive</span></li>
</ul>
</div>
<div>
Next you need to mount the hard drive to the folder that has just been created. Open fstab and add the following line to the bottom of the file where it reflects your setup.</div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo nano /etc/fstab</span></li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoS6A87DbVOnVRwLRIpVp4VoxrUBGDVElSdAgk-JSR-r9MawEEwDgZZp2wUlN-OEv5zQIHrZNqICGvknyKM8cQJZJAyK5mDKy18lol-Z7M7aeiUvaVQEDVV2QFwOEkTXRd3z1EkjSS96M/s1600/fstab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoS6A87DbVOnVRwLRIpVp4VoxrUBGDVElSdAgk-JSR-r9MawEEwDgZZp2wUlN-OEv5zQIHrZNqICGvknyKM8cQJZJAyK5mDKy18lol-Z7M7aeiUvaVQEDVV2QFwOEkTXRd3z1EkjSS96M/s400/fstab.png" width="400" /></a></div>
<br /></div>
</div>
<div>
Mount the drive</div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo mount -a</span></li>
</ul>
</div>
<div>
Now we need to install and set up the Samba server. This will allow a windows machine to connect to the RasPi over the network. Start by installing the following packages using apt-get.</div>
<div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install samba</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install samba-common-bin</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install ntfs-config</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install ntfs-3g</span></li>
</ul>
<div>
Once all of those packages are installed, edit the Samba configuration file. It took me a while to get this right but with the help of <a href="http://www.youtube.com/watch?v=jr2Jz8km2BU" target="_blank">this </a>video, I managed to get it. </div>
</div>
</div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo nano /etc/samba/smb.conf</span></li>
</ul>
<div>
Replace the entire file with the following:</div>
</div>
<div>
<blockquote>
#======================= Global Settings =======================<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = raspnas server<br />
netbios name = raspnas<br />
dns proxy = no<br />
### Logging<br />
log file = /var/log/samba/log.%m<br />
max log size = 1000<br />
syslog = 0<br />
panic action = /usr/share/samba/panic-action %d<br />
### Authentication<br />
security = user<br />
map to guest = pi<br />
#======================= Sharered Folders =======================<br />
[media]<br />
path = /mnt/myHardDrive<br />
guest ok = yes<br />
guest account = ftp<br />
browseable = yes<br />
read only = no<br />
create mask = 0777<br />
directory mask = 0777<br />
writeable = yes<br />
admin users = everyone<br />
#==========================================================</blockquote>
</div>
<br />
<div style="text-align: justify;">
A few points to note:</div>
<div style="text-align: justify;">
</div>
<ul>
<li>WORKGROUP is the workgroup that the drive will be connected to</li>
<li>raspnas is the name of he drive on the network</li>
<li>path is the folder that you set up earlier</li>
<li>Change the file according to your setup</li>
</ul>
<div>
Lastly you need to restart the Samba service and add the user to the Samba database</div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo service samba restart</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">sudo smbpasswd -a pi</span></li>
</ul>
</div>
<div>
Now your Samba server is set up. You still need to do one last thing. You need to make sure that the drive gets connected at startup.</div>
<div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install autofs</span></li>
</ul>
</div>
<div>
Add the following line to the bottom of the config file</div>
<div>
<ul>
<li><span style="font-family: 'Courier New', Courier, monospace;">sudo nano /etc/auto.master</span></li>
</ul>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfHOSd1vZ5itLlNLmefq9kP5DZHXltr3bITayBflUlNyyvgGPG7JEghg8yqrPlOIkYwU3A__wQ1WO2fuzjOGfb03oTpgYg04IV8fbYlSDNgb445DGD8pWyHo4cJonQGmSuE8eUSog4Mwo/s1600/automaster.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfHOSd1vZ5itLlNLmefq9kP5DZHXltr3bITayBflUlNyyvgGPG7JEghg8yqrPlOIkYwU3A__wQ1WO2fuzjOGfb03oTpgYg04IV8fbYlSDNgb445DGD8pWyHo4cJonQGmSuE8eUSog4Mwo/s400/automaster.png" width="400" /></a></div>
<br /></div>
<div>
Reboot your RasPi and then you should be able to log on to the shared drive using your Windows machine.</div>
<div>
<br /></div>
<div>
I hope this has helped anyone who was stuck. If you still have any problems leave a message in the comments and I'll try help as best I can.</div>
<div>
<br /></div>
<div>
Greg</div>
Anonymoushttp://www.blogger.com/profile/07702900559182901560noreply@blogger.com0