Archive for the ‘example_program’ Category

By using Active X or the NI LabVIEW Report Generation Toolkit you can match your timestamps in LabVIEW with your timestamps in Excel.




>> Start converting now.

To mimic program logic control codes in LabVIEW, you can use multiple while loops so the function can update in real time and update based on logic in that moment.  This code can be tailored for any use you may need.





>>  Download the code here.

This front panel template tool can be integrated into LabVIEW to allow you to select a VI in memory or browse to a VI on disk.  You can also use this tool to change a VI’s front panel indicator and controls.




>> Grab the code here.

For the love of robotics, community members are designing some pretty incredible VIs! This week we’re featuring community member MarcoPolo5, who developed a VI that allows you to simulate a robot using a tree control and 3D picture control. The program uses a parent-child relationship between its elements, meaning if a translation or rotation is applied to the parent object, it will automatically have the same effect on all the connected child objects. Front panel joint controls are available for manually manipulating joints, and can also be linked to a secondary program for path simulations. The current element object types supported are sphere, box, cylinder, cone, and CADfiles (ASE, STL, and VRML). Click on the link below to get the code and further operating instructions!


>> Download the code here: Robotics and 3D Object Simulator



Community member jpaul has shared a piece of code that allows you to create a set of LabVIEW VIs to print a PDF document by calling the open source PDFCreator application through Microsoft ActiveX. As an added convenience, the program automatically saves your work at all times, so there is no need for a “Save As” button. Before running the VI, you first need to install the PDFCreator. To get the code plus a step-by-step Getting Started guide on how to run the program, check out the link below.


>> Download the code here: PDF Documents in LabVIEW

Who doesn’t love a sweet, new app? Community member BROhan has developed code that allows you to build a native iPhone application for simple data monitoring. The iPhone app communicates with a measurement application,which performs your measurement and publishes the latest data value to a variable, and LabVIEW Web Services, whichretrieves the latest data value in the variable and returns it. Your iPhone then periodically calls the web service and plots the latest data value.




Your measurement application constantly runs in parallel with your web service VI. When the web service VI is called by the iPhone app, it reads the value from the shared variable, generates an XML string, writes an HTTP response, and sends the data back to the iPhone. Read more about this exciting project, and download the code below!



>> Download the code here: iPhone Data Monitoring App




With energy costs on the rise, community member iangbell used NI LabVIEW software to develop a convenient, efficient way to keep your power consumption down and your monthly bills low. Using a simple energy monitor with a serial RJ45 connector and a USB to serial cable, he developed a LabVIEW program that gathers your home’s energy consumption data, displays it graphically, and allows you to check it remotely through a web server. This program earned the #1 spot in the NI Top 5 Example Codes for 2010! Check it out below, and feel free to share your comments and suggestions with the NI Community.


>> Download the code here: Home Energy Monitor



Community member Karsten has shared a cool way to program the Windows 7 task bar to graphically display the progress of your code running in NI LabVIEW software. As you can see in the images below, this LabVIEW task bar will fill up as your code progresses toward completion. This way, LabVIEW users can multitask on their PCs while still monitoring the progress of their code in the blue ribbon at the bottom of their desktop. Using the .NET assembly and Interop Libraries for the Windows 7 Taskbar, Karsten built a set-up that only exposed the two relevant  functions: SetProgressState for controlling the state of the progress bar and SetProgressValue for updating the progress. Check out the link below for a simple LabVIEW 2009 application programming interface (API) and an example using the .NET assembly to manipulate the Windows 7 task bar.


>> Download the code here: Windows 7 Progress Bar for LabVIEW



Inspired by a Microsoft .NET Chart demonstration, community member Thoric has developed an XControl for NI LabVIEW software with similar functionality. The XControl allows you to set names and axis labels, add as many data series as you want, change the plot type and switch between 2D and 3D plotting, change design features on your graph, and include a legend. Thoric also shared an Interactive Demo to show how easy it is to program the XControl to expand on the built-in functionality. You’ll need to download the free MicrosoftCharts toolkit before proceeding onto the coding. Go check out Thoric’s example below!


>> Download the code here: Microsoft.NETChart for XControl