Thursday 28 September 2017

GUI Design #1



Idle User Interface Design with Hide/Unhide Settings.

User Interface is the very important for your application. There are lots of constrains and standards for UI developments. Here we will discuss about the idle space allocation using split bars and docking feature for settings.
Split bar – We haven’t used this feature in LabVIEW widely. This will help you to make UI standard. Main advantage is Fit to pane feature enable your UI to adopt different aspect-ratio. In LabVIEW we have 2 split bar.
·         Vertical Split Bar – Splits your LabVIEW panel in vertical manner.
·         Horizontal Split Bar -    Splits your LabVIEW panel in horizontal manner.

UI Design

I will always prefer the above alignment, because this will the standard arrangement in most of the application we used our day to day life.
We can use Split bars to split our Front panel in this manner.

Split Frontpanel.

UI Design.
If you present your UI in this way the customer will have an impression on you. Here with this I’m going to add one small and amazing feature. That will make your UI more advance one. Hiding the Option buttons.

Option enabled

Options hided
So to do this, do we need to write big code? No not at all See the below diagram only one property node will make your life more amazing! ☺☺

Block Diagram.
To download this code, click here.

And we are happy to announce, next week we launch our first UI tool kit in VI package manager. Follow us for more updates.

Tuesday 19 September 2017

LabVIEW Architectures

LabVIEW Architectures Series 2 of 8

Before going to next architecture let me tell you the inefficiency of the simple state machine.
    

  • GUI handling is very tedious job. At that time, they will use serious of select function to check the UI changes.
Handling UI Changes
If your UI has more controls, idle case will become messier. In LabVIEW 2007 NI introduced event structure to capture UI changes. After this, whole way programming was changed. Here is one more advantage, you can configure event time out -1 (Wait until event occur) if there is no UI event your program will freeze (No load in processor).
Event Structure
Event Selector: The event selector label specifies which events cause the currently displayed case to execute. To view other event cases, click the down arrow next to the case name.
Event Time Out: The Timeout terminal specifies the number of milliseconds to wait for an event before timing out.
Event Data Node: The Event Data Node identifies the data LabVIEW returns when an event occurs. Like the Unbundle by Name function, you can resize the node vertically and select the items you need. Use the Event Data Node to access event data elements, such as Type and Time, which are common to all events. Other event data elements, like Char and VKey for example, vary based on the event you configure.
·       If you want to pass the data from one case to another case, you have to use shift register or local variable. If you use local variable your program load will increase. So most of the people started use shift register.
State Machine with Data shift registers
If your program grows data will be increase, so the number of shit register will also increase and your program will become more complex to debug and can’t maintain it.
 To overcome this problem Data Cluster concept introduced.
 Data Cluster: A typedef cluster which is contain all elements to pass one case to another case.
This is the widely used version of simple state machine. Click here to download this state machine.
 ·       What next…? Can you guess what is the missing in above architecture☺? Yes, you are wright state transition. In this method at end of the state only we can determine the next state. This makes your program harder to read and can’t maintain the modularity. Here the String array and Enum array concepts introduced.
Enum Array State Machine
Click here to download this architecture. Same way peoples used string based state machine.
In Next article we will discuss about advanced state machine Architectures.

Tuesday 12 September 2017

Challenge #4

Challenge #3 Winners

Here are the winners of the Challenge #3. Thanks for your submissions.


1. Vadim Ladik



Good approach towards the application. Require detailed explanation of different cases of Main VI
Also make use of Subdiagram labels for documentation if available

Vadim Ladik Solution


Eval Formula Node VI

Similar to the Formula Node but with variables that can be entered on the front panel. Refer to Formula Parsing VIs in More Detail for more information on the differences between the Eval Formula Node VI and the Formula Node.

2. NanthaKumar T




Recommend you to deselect view as icons for terminals
Also make use of Subdiagram labels for documentation if available

3. Saran Sharvan

Simple approach to the solution

 Congrats all three. Keep Posting your solutions and share knowledge :) Challenge #3

Challenge #4


Design a Clock with following features

1. Time in Dial format (Need GUI Customization) 
2. Display time of different time zones
3. Time zone input in the form of UTC


Add your name to the VI Name (for example Challenge #4_Ramesh) For easy valuation.

Thanks.


Note:
  1. Send your VI to support@thelabview.com
  2. Avoid sending multiple emails
  3. Comments and feedback are welcome
  4. Winner of this challenge posted at the start of the next challenge.

Wednesday 6 September 2017

LabVIEW Architectures Series 1 of 8


Architectures in LabVIEW
We have used many architectures in our LabVIEW projects. Here we are going to discuss different kind of architectures in LabVIEW (form Simple State Machine to Actor Frame Work).
Basically National Instrument has defined 3 basic type of Architectures in LabVIEW.
·       Simple VI
A VI without structure is called simple VI.
Simple VI
·       General VI
If any Structures is used inside of the VI it is called General VI.
General VI
·       Simple State Machine
This Simple State Machine Architecture in LabVIEW is introduced by National Instruments. This is the very simplest and basic format of state machine. This will contain a While loop, Case structure and Typedef Enum connected to shit register.

Simple state Machine
Here end of every state it will decide the next state. In this scenario
if error occurred in Init function it will go to Error state else wait for idle state.
Using this Basic Architecture Developers changed many things to do more complex applications.
Next series we will see what are the changes makes State Machine is more powerful tool.
Comment your thoughts.


Tuesday 5 September 2017

Challenge #3

Challenge #2 Winners

We are so happy to received submissions for Challenge #2 which is 3 times the previous solution. Thanks for your submissions.


1. Jhareesh Akella


Very good explanation, Handled most of the loop holes of this applications. Excellent coding style.

2. Shrikant Singh



Used inbuilt function to search the dictionary word. Also he used Defer Panel Updates Property to avoid UI Update while searching. This property will very use full for very big applications.


Defer Panel Updates Property

When you set this property to TRUE, LabVIEW redraws any front panel objects with pending changes then defers all new requests for front panel updates. For example, controls and indicators do not redraw when you change their properties or values. If the operating system requests a redraw, such as if the window is no longer behind another window, LabVIEW redraws the front panel with the current properties instead of the original properties. If FALSE, LabVIEW immediately redraws the changed elements of the front panel.


Here is the Defer panel update VI which is made by Shrikant singh. Make use of this to your applications.



3. Basker Babu



Good approach to attain the solution.



 Congrats all three. Keep Posting your solutions and share knowledge :) Challenge #2

Challenge #3

Here is the Task oriented Coding Challenge 3


We have 3 inputs named A,B & C

Create a code in such a way that output results the formula mentioned in the Formula control



The Formula should support following functions
Addition (+)
Subtraction (-)
Multiplication (*)
Subtraction (/)
power (^)
Square root (sqrt)

This should also support parenthesis () for formulating
  

Add your name to the VI Name (for example Challenge #3_Ramesh) For easy valuation.

Thanks.


Note:
  1. Send your VI to support@thelabview.com
  2. Avoid sending multiple emails
  3. Comments and feedback are welcome
  4. Winner of this challenge posted at the start of the next challenge.