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.