This document discusses foundational design patterns for multi-purpose applications. It covers topics like coupling, cohesion, and moving beyond using a single while loop. Functional global variables and queued message handlers are introduced as design patterns to enable communication between independent processes. The document provides examples of how these patterns can be used to decompose an application into independent processes to improve scalability, testability, and maintainability.
Object-Oriented Analysis and Design (OOAD) is a software engineering methodology that involves using object-oriented concepts to design and implement software systems. OOAD involves a number of techniques and practices, including object-oriented programming, design patterns, UML diagrams, and use cases.
This Project is based on Functional Dependencies and Normalization
Content
Introduction to Functional Dependency
Types of functional Dependency
Trival Functional Dependency
Full Functional Dependency
Partial Functional Dependency
Transitive Dependency
Multivated Dependency
Normalization Process Concepts
Process of Normalization
Normal Form
1st Normal Form
2nd Normal Form
3rd Normal Form
Boyce – Code Normal Form (BCNF)
Object-Oriented Analysis and Design (OOAD) is a software engineering methodology that involves using object-oriented concepts to design and implement software systems. OOAD involves a number of techniques and practices, including object-oriented programming, design patterns, UML diagrams, and use cases.
This Project is based on Functional Dependencies and Normalization
Content
Introduction to Functional Dependency
Types of functional Dependency
Trival Functional Dependency
Full Functional Dependency
Partial Functional Dependency
Transitive Dependency
Multivated Dependency
Normalization Process Concepts
Process of Normalization
Normal Form
1st Normal Form
2nd Normal Form
3rd Normal Form
Boyce – Code Normal Form (BCNF)
Active database system, architecture, fundamental characteristics/features, application, strength as well as the weaknesses of an Active Database Management System.
This slide give the basic introduction about UML diagram and it's types, and brief intro about Activity Diagram, use of activity diagram in object oriented programming language..
NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...JKI
Slides for presentation given by Justin Goeres at NIWeek 2011. Learn about a template for inter-process communication that’s easy enough for Intermediate developers, but powerful and flexible enough for CLAs. Nearly every significant LabVIEW-based application uses multiple loops and multiple pieces of hardware. Without a clear design pattern, coordinating all these moving pieces is a recipe for spaghetti code. In this presentation, we introduce an elegant, powerful, and easy-to-use template for inter-process communication based on the concept of “Public” and “Private” events.
Active database system, architecture, fundamental characteristics/features, application, strength as well as the weaknesses of an Active Database Management System.
This slide give the basic introduction about UML diagram and it's types, and brief intro about Activity Diagram, use of activity diagram in object oriented programming language..
NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...JKI
Slides for presentation given by Justin Goeres at NIWeek 2011. Learn about a template for inter-process communication that’s easy enough for Intermediate developers, but powerful and flexible enough for CLAs. Nearly every significant LabVIEW-based application uses multiple loops and multiple pieces of hardware. Without a clear design pattern, coordinating all these moving pieces is a recipe for spaghetti code. In this presentation, we introduce an elegant, powerful, and easy-to-use template for inter-process communication based on the concept of “Public” and “Private” events.
CLA Summit 2013: Connecting LabVIEW to Everything ElseJKI
Slides from JKI's CLA Summit 2013 presentation, "Connecting LabVIEW to Everything Else," presented by Jim Kring.
Our consulting customers want the software we create to be “open,” in the sense that they need to integrate it into other business systems, or they need to use it from their own system development, or they just need to get data out in the way they want. This means providing an external API that users/clients can access – especially from tools other than LabVIEW. In this presentation from the Americas CLA Summit 2013, Jim Kring explains why external APIs are a fundamental part of professional software development, and explores how different types of APIs are useful at different stages of development all the way from proof-of-concept to final shipment.
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW DeveloperJKI
Slides from JKI's NIWeek 2012 technical session, "Secret Sauce: Tools to Make You a Better LabVIEW Developer," presented by Justin Goeres.
If you could save one hour a day by working smarter, how much more value could you create and how much less stress would you feel? LabVIEW Champion Justin Goeres shows you how to manage your code, projects, and commitments using the same free and low-cost tools JKI engineers use.
Model Predictive Control Implementation with LabVIEWyurongwang1
This presentation was presented at National Instruments NIWeek 2007 to demonstrate how to use LabVIEW to implement model predictive control (MPC) strategies to control complicated coax manufacturing processes. Both MatLAB MPC and LabVIEW MPC were implemented in these applications.
Real time Vital Signs Monitorong Using NI LabVIEWTalha Patel
ABSTRACT
It is undeniable that nowadays people are more aware of the health conditions. One of the most widely used methods to test the health conditions of an individual is to measure user blood pressure, oxygen level and heart rate. There is a huge market for non-invasive methods of measurement of these vital signs. The objective of this project is to design a algorithm in a well known NI platform (NI LabVIEW), which can easily be used with cheap, low powered and non-intrusive sensors. This project specifically deals with the data acquisition and signal conditioning of three vital signs: blood pressure, oxygen level and heart rate and also with the designing of sensors to acquire them and interfacing them with NI Data Acquisition System (DAQ). The theory, design procedures, experimental results and discussions of these systems are presented.
AIM AND OBJECTIVE
The aim of this project is to design a new algorithm to measure three biological parameters (Blood Pressure, Heart Rate & Pulse Oximetry SpO2) together using VI LabVIEW. It provides data acquisition system for collection, management, control and analysis of these parameters.
To obtain this objective four things are required to work properly which are given below:
1. To acquire vital signs (physiological parameters) using biosensors.
2. To interface the obtained data with NI DAQ System which converts it into digital format.
3. To link the DAQ System with NI LabVIEW and design an algorithm to measure real time data in graphical interface.
4. Finally, to design & develop a graphical user interface in LabVIEW to display the outputs.
Following topics will be addressed into presentation:
Motivation and goals of splitting monolith application
Criteria and markers to start splitting process. Is it necessary at all?
Optimal order of extracting microservices
How organize the whole process in closed iterative steps?
What can be done with common libraries and shared code?
Options for technology and deployment of target microservices
How organize and motivate the teams and convince management?
Speaker Bio
Andrei is a Software Architect in VMWare Tanzu Labs. The areas of his interest are REST API design, Microservices, Cloud, resilient distributed systems, security and agile development. Andrei is PMC and committer of Apache CXF and committer of Syncope projects.
Whar are microservices and microservices architecture (MSA) How we reach them? Are they the same or SoA or not? When to use them? What are the key characteristics?
Slides of my talk given in #Gapand2017 in Andorra
Adding Real-time Features to PHP ApplicationsRonny López
It's possible to introduce real-time features to PHP applications without deep modifications of the current codebase.
Using WAMP you can build distributed systems out of application components which are loosely coupled and communicate in (soft) real-time.
There is no need to learn a whole new language, with the implications it has.
It also opens the door to write reactive, event-based, distributed architectures and to achieve easier scalability by distributing messages to multiple systems.
Overcoming software development challenges by using an integrated software fr...Design World
With ever increasing Connectivity options, Security Protocols and Sophisticated Human Interfaces, Software and AP developers find themselves caught more deeply in the dichotomy of dealing with increasing complexity of designs and shrinking timelines. Resource constraints and constantly evolving software landscape provide challenges to software Integration that have to be overcome to enable designers to focus on the actual application.
Developers need a Modular Software Framework that accelerates software integration, provides flexible programming options and enables application re-use across multiple platforms. “That framework is MPLAB® Harmony.”
Join us for the webinar series where we provide a technical overview of MPLAB® Harmony, Live tool demos, Microchip and third party Middleware support and finally demonstrate how Harmony accelerates software integration and moves development focus and resources to Application Development and testing.
In this first installment of a three part webinar series attendees will learn:
-Current Software Development Challenges and how MPLAB® Harmony, Microchip’s software framework, overcomes them.
-Technical Overview of MPLAB® Harmony Framework.
-Integrating RTOS in an embedded development ecosystem.
-Graphics Application demo illustrating how MPLAB® Harmony facilitates changing system requirements.
Abstract
The idea of this talk is to help development teams to make correct architectural decisions.
Andrei will highlight the basic architectural principles and show ways to achieve architecture that is good enough to cover the project requirements and evolve in the future.
He will also present several cases from real projects, where wrong, missing, or over-sophisticated architecture decisions really hurt the development teams:
- Painful sharing: do shared modules increase reusability or will be the source of problems?
- Microservices are the solution to every problem!
- Non-extensible extensibility: too sophisticated configuration hurts
- Over fine-grained: incorrect splitting to Microservices can make life even harder as with monolith
- Convey horizontal split: how organizational driven split can jeopardise the architecture
- Model-driven: central responsibility blocks and limits the team
- Cargo cult: blindly following patterns and rule can produce an unmaintainable system
- Freestyle architecture: what happens if teams completely ignore architecture
- Improve with less intelligence: smart endpoint and dumb pipes
Abstract
The idea of this talk is to help development teams to make correct architectural decisions.
Andrei will highlight the basic architectural principles and show ways to achieve architecture that is good enough to cover the project requirements and evolve in the future.
He will also present several cases from real projects, where wrong, missing, or over-sophisticated architecture decisions really hurt the development teams:
- Painful sharing: do shared modules increase reusability or will be the source of problems?
- Microservices are the solution to every problem!
- Non-extensible extensibility: too sophisticated configuration hurts
- Over fine-grained: incorrect splitting to Microservices can make life even harder as with monolith
- Convey horizontal split: how organizational driven split can jeopardise the architecture
- Model-driven: central responsibility blocks and limits the team
- Cargo cult: blindly following patterns and rule can produce an unmaintainable system
- Freestyle architecture: what happens if teams completely ignore architecture
- Improve with less intelligence: smart endpoint and dumb pipes
Scripting experts from Inductive Automation cover general best practices that will help you add flexibility and customization to HMI, SCADA, IIoT, and other industrial applications. Some specific tips about using scripting in the Ignition platform will be included as well.
In this webinar, learn more about:
• Common scripting pitfalls and how to avoid them
• The best programming languages to use
• Things to consider before using scripting
• How scripting environments work
• Scripting timesavers
• And more
Scripting experts from Inductive Automation cover general best practices that will help you add flexibility and customization to HMI, SCADA, IIoT, and other industrial applications. Some specific tips about using scripting in the Ignition platform will be included as well.
In this webinar, learn more about:
• Common scripting pitfalls and how to avoid them
• The best programming languages to use
• Things to consider before using scripting
• How scripting environments work
• Scripting timesavers
• And more
Choosing the right parallel compute architecture corehard_by
Multi-core architecture is the present and future way in which the market is addressing Moore’s law limitations. Multi-core workstations, high performance computers, GPUs and the focus on hybrid/ public cloud technologies for offloading and scaling applications is the direction development is heading. Leveraging multiple cores in order to increase application performance and responsiveness is expected especially from classic high-throughput executions such as rendering, simulations, and heavy calculations. Choosing the correct multi-core strategy for your software requirements is essential, making the wrong decision can have serious implications on software performance, scalability, memory usage and other factors. In this overview, we will inspect various considerations for choosing the correct multi-core strategy for your application’s requirement and investigate the pros and cons of multi-threaded development vs multi-process development. For example, Boost’s GIL (Generic Image Library) provides you with the ability to efficiently code image processing algorithms. However, deciding whether your algorithms should be executed as multi-threaded or multi-process has a high impact on your design, coding, future maintenance, scalability, performance, and other factors.
A partial list of considerations to take into account before taking this architectural decision includes:
- How big are the images I need to process
- What risks can I have in terms of race-conditions, timing issues, sharing violations – does it justify multi-threading programming?
- Do I have any special communication and synchronization requirements?
- How much time would it take my customers to execute a large scenario?
- Would I like to scale processing performance by using the cloud or cluster?
We will then examine these issues in real-world environments. In order to learn how this issue is being addressed in a real-world scenario, we will examine common development and testing environments we are using in our daily work and compare the multi-core strategies they have implemented in order to promote higher development productivity.
This is a small introduction to microservices. you can find the differences between microservices and monolithic applications. You will find the pros and cons of microservices. you will also find the challenges (Business/ technical) that you may face while implementing microservices.
Travis Cox from Inductive Automation will go over the important questions you should ask when planning an enterprise solution. His presentation will help you start and maintain a smoother development process that results in an open, interoperable, standards-based, and secure enterprise solution.
Travis Cox from Inductive Automation will go over the important questions you should ask when planning an enterprise solution. His presentation will help you start and maintain a smoother development process that results in an open, interoperable, standards-based, and secure enterprise solution.
Similar to Foundational Design Patterns for Multi-Purpose Applications (20)
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
3. 3ni.com
When Most
Consider Advanced
Architectures
When You Should Consider Advanced
Architectures
DefiningAdvancedApplications & LabVIEWAbility
Ability
3-Icon
Apps
State
Machines
Multi-Process
Apps
Multi-Target
Apps
LearningEffort
4. 4ni.com
Master Key Design Patterns…
…and Understand Their Limitations
Ability
3-Icon
Apps
State
Machines
Multi-Process
Apps
Multi-Target
Apps
LearningEffort
Master the FGV
and the QMH
5. 5ni.com
While Loop
Acquire Analyze Log Present
10ms 50ms 250ms 20ms
Doing Everything in One Loop Can Cause Problems
• One cycle takes at least 330 ms
• User interface can only be updated every 330 ms
• If the acquisition reads from a buffer, it may fill up
7. 7ni.com
User Interface Event Handler
DAQ Acquisition
DAQ
Execution: The user interface cannot respond to other input while acquiring data
Development: Modifying one process requires modifying the other
Extensibility: How do you add a data logging process?
Maintenance: Can you test one piece of an application without testing its entirety?
Why is Coupling Bad?
8. 8ni.com
Coupling is OftenAccidental: Case Study
Initial Scope
• Demonstrate:
• Data Acquisition
• CAN Synchronization
• Selected Architecture:
• State Machine
Final [Expanded] Scope
• Demonstrate:
• Data Acquisition
• CAN Synchronization
• IMAQ Acquisition
• TDMS Streaming
• DIAdem Post-processing
• Selected Architecture:
• Band-Aids and Duct Tape
NIWeek 2011 Hummer Demo
9. 9ni.com
Coupling is OftenAccidental: Case Study
Final Demo Code
• Once
• Once you start…you can’t stop
• You can’t test independent actions
• There are 7 shift registers:
• State
• DAQ Settings
• TDMS Settings
• Errors
• DIAdem References
• IMAQ Settings
• CAN Settings
• Whether used or not, every shift
register goes across every case
10. 10ni.com
While Loop
Cohesion: Limiting Process Scope
• Often, shift register
defines scope of process
• Processes should be very
cohesive
• Independent processes
should be separate loops
» DAQ »
» TDMS »
» User Interface »
» State Information »
Multiple shift registers for one process
indicate over-coupling
X
X
X
12. 12ni.com
DAQ Application
Event-Driven Loop
How to De-Couple Independent Processes
Best Practices
1. Identify data scope
2. Delegate actions to appropriate
process
3. Avoid polling or using timeouts*
*except for code that communicates with hardware
Considerations
1. How do you send commands?
2. How do you send data?
3. Which processes can communicate
with each other?
4. How do you update the UI?
?
13. 13ni.com
Inter-Process Communication
ensures tasks run asynchronously
and efficiently
Goals
• Loops are running independently
• User interface can be updated
every 20 ms
• Acquisition runs every 10ms,
helping to not overflow the buffer
• All while loops run entirely
parallel with each other
While Loop
Acquire
While Loop
Analyze
While Loop
Present
While Loop
Log
10ms
50ms
250ms
20ms
…How?
14. 14ni.com
Many Data Communication Options Exist in LabVIEW
1. TCP and UDP
2. Network Streams
3. Shared Variables
4. DMAs
5. Web Services
6. Peer-to-Peer Streaming
7. Queues
8. Dynamic Events
9. Functional Global Variables
10. RT FIFOs
11. Datasocket
12. Local Variables
13. Programmatic Front Panel
Interface
14. Target-scoped FIFOs
15. Notifiers
16. Simple TCP/IP Messaging
17. AMC
18. HTTP
19. FTP
20. Global variables
… just to name a few!
In no particular order…
16. 16ni.com
What is a design pattern and why use one?
• Definition:
• A general reusable approach to a commonly occurring problem
• Well-established, proven techniques
• A formalized best practice
• Not a finished design
• Design patterns:
• Save time
• Improve code readability
• Simplify code maintenance
17. 17ni.com
What is the difference between a design pattern and a
framework?
Design Pattern
• Focuses on a specific
problem
• Geared toward solo
developers
• More foundational
Framework
• Focuses on larger
applications
• Geared toward team
development
• Often involve an architect
18. 18ni.com
Design Patterns are not Specific to LabVIEW
• Design Patterns: Elements of Reusable Object-Oriented
Software, 1994
• Includes examples in C++, Smalltalk
• The LabVIEW community has
adopted and extended several design
patterns for use with LabVIEW
• Examples:
o Producer / Consumer
o State Machine
o Queued Message Handler
o Factory Pattern
o Singleton Pattern
19. 19ni.com
RisksAssociated with a “Flat Tire”
(Poor Application Design)
• Nothing happens when you press “Stop”
• Poor error handling
• No consistent style
• Complicated maintenance and debugging
• Difficulty scaling application
• Tight coupling, poor cohesion
20. 20ni.com
Inter-Process Communication
• Store Data
• Stream Data
• Send
Message
Many more variations,
permutations, and design
considerations
Typically straightforward
use cases with limited
implementation options
22. 22ni.com
De-Facto Communication Choice: Locals / Globals
• Local and Global variables are simple and obvious
• Text-based mindset isn’t used to parallel programs,
multithreading
• Problem: Locals / Globals are pure data storage and
could cause race conditions
“The traditional, text-based programmer’s first instinct is
always to use local variables.”
– Brian Powell
23. 23ni.com
What is a Functional Global Variable?
• The general form of a functional global variable includes
an uninitialized shift register (1) with a single iteration
While Loop
1.
Functional Global
Variable Code
24. 24ni.com
What is a Functional Global Variable?
• A functional global variable usually has an action input
parameter that specifies which task the VI performs
• The uninitialized shift register in a loop holds the result of
the operation
25. 25ni.com
Sidebar: Reentrant vs. Non-Reentrant
• Non-reentrancy is required for FGVs
• Reentrancy allows one subVI to be called simultaneously
from different places
• To allow a subVI to be called in parallel
• To allow a subVI instance to maintain its own state
Data
Space
Data
Space
Data
Space
State (or the data that
resides in the uninitialized
shift register) is maintained
between all instances of
the FGV
26. 26ni.com
Various Inter-process Communication Methods Exist
• FGVs are one tool of many in the toolbox:
Same target
Same application instance
Same target, different application instances /
Different targets on network
Storing -
Current Value
• Single-process shared variables
• Local and global variables
• FGV, SEQ, DVR
• CVT
• Notifiers (Get Notifier)
• Network-published shared variables
(single-element)
• CCC
Sending
Message
• Queues (N:1)
• User events (N:N)
• Notifiers (1:N)
• User Events
• TCP, UDP
• Network Streams (1:1)
• AMC (N:1)
• STM (1:1)
Streaming
• Queues • Network Streams
• TCP
27. 27ni.com
What Else Do I Need to Know?
• Store Data
• Stream Data
• Send
Message
Many more variations,
permutations, and design
considerations
Typically straightforward
use cases with limited
implementation options
28. 28ni.com
Queued Message Handlers
• What are Queues?
• What is the Queued Message Handler (QMH)?
• Basic modifications to the QMH template
29. 29ni.com
Adding Elements to the Queue
Dequeueing Elements
Reference to existing queue in memory
Select the data type the queue will hold
Dequeue will wait for data or time-out
(defaults to -1)
Queues 101: Inter-Process Communication
30. 30ni.com
Producer Consumer Generalization
Thread 1
Thread 2
Thread 3
Best Practices
1. One consumer per queue
2. Keep at least one reference to a
named queue available at any time
3. Consumers can be their own
producers
4. Do not use variables
Considerations
1. How do you stop all loops?
2. What data should the queue send?
QUEUE
QUEUE
31. 31ni.com
Anatomy of a “Producer” Process
Process
Stop
Condition
Met?
Send
InformationData
Information
Action or Event
Sends message to other process, program, or target
32. 32ni.com
Anatomy of a Message Producer Process
Process
Stop
Condition
Met?
Inter-Process
CommunicationData
Command
Action or Event
Sends message to other process, program, or target
Message comprised of a
command and optional data
33. 33ni.com
Constructing a Message
Examples:
Data
Variant allows data-type
to vary. Different
messages may require
different data.
Command
Enumerated constants
(or strings) list all of
the options.
Command Data
Initialize UI Cluster containing configuration
data
Populate Menu Array of strings to display in menu
Resize Display Array of integers [Width, Height]
Load Subpanel Reference of VI to Load
Insert Header String
Stop -
34. 34ni.com
Sidebar: Enums versus Strings for Commands?
Enumerated Constant
• Safer to use – prevents
misspellings
• Compiler checks for
message validity
• Requires a copy for each
API (e.g. “Initialize”)
• “Add case for every value”
String
• Misspellings could lead to
runtime errors
• Onus is on the developer to
get messages correct
• Streamlines usage across
multiple APIs
• Universal data type
35. 35ni.com
?
Next
Steps
FIRST STATE
Case structure has a case for every
command
Next steps could enqueue new action
for any other loop, including this one
Data cluster for all
states
After command is executed,
data cluster may be updated
Queue
Reference
Command
Execution
State
Specific
Data-type
Definition
Variant To Data
Dequeue
Action &
Data
Queued Message Handler “Consumer” Process
Defines the scope
of operations this
consumer can
handle Stop
Condition
Met?
38. 38ni.com
Queued Message Handler
UI event capture loop
Message handling loop
Create queue for message communication and user
event to stop event loop
Template
42. 42ni.com
General Modifications to the QMH Template
• Add Interrupt
• What if a process needs to disrupt the flow of tasks (e.g.
Emergency stop)?
• Add Additional Message Handlers
• Add Error Handler
• Add Timeout to Dequeue Messages
• May want to timeout for regular Update Display execution
• …etc.
42
43. 43ni.com
Application-Specific Modifications to the QMH
• Official Login Process
• Operator login and documentation
• Customized or Interactive Displays
• Different ways of displaying different types of data
• Standardized Logging
• Company or application specific file formatting and structure
• …etc.
43
44. 44ni.com
Summary and Next Steps
• FGVs are an effective data storage mechanism
• Action engines prevent race conditions
• The QMH is really a starting point
• It will get you really far, but…
• It is frequently customized
• It is frequently one component in a larger framework
• Next Steps:
• Advanced Architectures in LabVIEW CustEd Course
• History Probe for keeping track of actions:
https://decibel.ni.com/content/docs/DOC-1106
45. 45ni.com
Solution Sources Programming, Inc.
Company History
• Est. 1990
• Headquartered in San Jose, CA
• Support Requirements Worldwide
Expertise
• Turnkey Engineering & Production Test
Systems
• LabVIEW, TestStand, LabWindowsCVI
Industries
• Aerospace & Defense
• Consumer Electronics
• Green Technologies
• Medical and Life Sciences
• RF and Wireless
• Semiconductor
Contact us
www.ssprog.com
sales@ssprog.com
408-487-0270