Overview of modular applications AF (operator frame) series (1) -LabVIEW in

First, the primer

LabVIEW face of the article described in the previous frame on content development involve very little. In order to explain the operator Framework (Actor Framework) strengths and weaknesses, just out QDSM (Queue-Driven State Machine) framework were compared.

So, before writing this begins, in fact, always wanted an article on the framework for the development of LabVIEW, LabVIEW explain the current development environment, what are the main framework, their advantages and disadvantages, usage scenarios, and the evolution of the frame. With roughly a plan of architecture, to finish this article, ready to find time to write about.

Second, the text

There are 13 videos in this series, but the last one is based NXG version of the development, the current pit more, it will not consider.

So be prepared to write 12 notes the article.

First, go to interpret this series of articles Video:

In this series, the purpose is to let everyone know how to use the Actor Framework, developing applications for the operator in LabVIEW. The operator is a framework for advanced concepts in LabVIEW, rapid development framework is also officially supported by the current that can be used.

Programmers always want a stable and reliable way, as much as possible to reuse code. The Actor Framework (hereinafter referred to herein AF) to meet this demand, it supports code reuse. There are many other benefits of using AF, of course, there are some shortcomings, we will introduce these shortcomings in the back of this article series.

This series of articles explaining the technology, require skilled technicians can use QMH mode, the ability to develop modular software in LabVIEW.

First, we will use QMH mode, write a basic need to demonstrate how it works. Then, using the AF alternative, to indicate that this may be a better approach to software development.

The preferred software design principles commonly used, we will have a cohesive code into a module and a low internal cohesion within high.

To illustrate this point, the display application, we write a data acquisition module, a file i / o modules, a user interface module and a control module, to organize all messages between the different cycles in a simple data. The following block diagram:

The basic function module is then written out QMH frame, as shown below:

The user interface module is actually composed of two cycles, a cycle is an event-based, the other is based on the cyclic key.

所谓的高内聚性,就是每个模块都应该有一个明确的目的,只负责一件事,例如用户界面模块只负责接收和显示数据或响应用户输入,但它不负责判断文件是不是你的,也不具备做文件i/o的能力。低耦合,意味着一个模块不应该依赖于另一个模块。例如,即使I/O文件没有加载,用户界面也应该运行。

所以,内聚性指的是模块本身如何编写,而耦合指的是模块如何依赖于其他模块。高内聚性的主要好处是它的可读性,如果你在一个模块中有密切相关的函数,那么很清楚该模块做什么的,也使该模块变得可维护。

举个可维护性的例子,假如,在写入一个文件时有一个bug,您知道另一个必须出现在两个文件I/O模块中,因此您可以很快的测试那些特定的函数,来判断问题所在。

因为该模块只有一个明确的用途,该模块也变得高度可重用,。

如果您有其他需要使用文件i/o模块的应用程序,则有一个明确的目的:它们可以在您想要的任意多个应用程序中将其放到您的框图中,因为低耦合的好处是可维护性,因此对特定模块的更改仅限于该单个模块,而不会对其他模块产生连锁反应模块可测试性。因此,单元测试中涉及的模块可以保持在最低限度。如果所有功能都是一个模块的一部分,那么您可以使用同一个模块测试这些功能。

现在我们知道为什么有这些单独的循环,让我们来演示如何在循环之间进行通信。

首先,点击开始按钮,消息依次在“用户接口模块”、“信息处理循环”、“数据采集模块”进行传递,实现了各模块的功能运行。

综上,搭建了整个通信系统,即队列或用户事件,这些队列或用户事件的引用将存储在功能全局变量(FGVs)中,与其他模块共享。在实际运行过程中,并非所有模块都需要实际加载,它们可以在运行时异步动态启动。

虽然,这只是一个模块化软件开发的概况,但基本覆盖了已知的大多数情况,如果您注意到这些“用户界面模块”、“消息处理循环”、“数据采集模块”,它们都是完全相同的代码,但是不得不重复它三次,所以如果使用QMH框架,通过努力,可以将部分的逻辑封装成子程序,放在单独的项目库中,以简化程序,但仍然有些重复。

现在,我们可以使用一种更为结构化的技术,在开发代码时,最大化将代码重用和高效使用。而这正是AF所具备的特性。所以在下一篇文章解读中,要向您展示AF是如何派生的,以便展示它如何解决代码重用的问题,特别是在这样的模块化应用程序中。


原创码字不易,如有收获,希望关注、点赞和喜欢。

发布了23 篇原创文章 · 获赞 10 · 访问量 6830

Guess you like

Origin blog.csdn.net/qq_26647635/article/details/104369287