Best architecture and design pattern to use
I am currently designing a moderately sized LabView application and cannot decide on the best architecture/design pattern or combinations thereof to implement.
The program basically polls an instrument connected to a serial port continuously at a 2-10Hz rate. When operator clicks a button to start a run, the polled data is then filtered, has math functions performed on the data, writes collected data to files, and produces reltime graphs and calculates point-by-point statistics. At the completion of a run, some additional data files are written. I pretty much know how to accomplish all these tasks.
What is also required is main-vi front panel interaction by the operator to access a database (via a C# dll with .Net) to query for specifications to apply in order to determine pass/fail status. Setup conditions also need to be changed from time to time by the operator and applied to the data in real time (ie- a measurement offset). I have prototyped the database portion successfully thus far.
For the main vi, I started off using the Top Level Application Using Events design pattern (Event structure within a while loop). Copious use of bundled clusters and shift registers keep the database data updated. I cannot figure out how to have the top level vi concurrently poll the serial device as outlined above. The Event structure is only active when defined control values change, and use of a timeout is no help since it prevent data from being collected while the user is accessing the database. All database and setup parameters must be applied to the data as it comes in from the serial port. Error trapping/recovery is a must.
I believe what I need is two parallel processes running under my main vi (one for database and setup, the other for polling and data processing/display, but what would be the preferred choice here?
Revert back to a polled loop in lieu of Events, use notifiers, occurrences, user-defined events, Producer-consumer loops?
It�s been about 3 years since I have had an application on this level (which used a state machine architecture), and a lot has changed in LabView (using 7.1 Prof Devel). I am currently having a mental block while trying to digest a lot of features I have never used before.
Suggestions Welcome!
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
I suggest a (3) state machine(s) architecture. The first is the user interface. Your main VI is a good start. Another state machine handles the instrument I/O (your serial polling). The third handles all data processing. The three loops run independently. Each has a wait to allow LV's scheduler to share CPU time among the loops. I like queues or functional globals for inter-loop communications.
This allows a lot of flexibility. Each portion can be tested alone. Each can have different timing and priority.
Spend some time thinking about what needs to be done and plan the structure carefully before you do any coding (except for little test programs to try new ideas).
I also like Conway and Watts "A Software Engineering Approach to LabVIEW", published
by Prentice Hall.
Lynn
Similar Messages
-
J2ME framework and design patterns
Hi everyone.
I'm thinking of building a few J2ME applications, and was wondering if there are any frameworks for this (i.e. for building midlets)? For web applications you have frameworks like Struts (Jakarta/apache), but I've not found anything for J2ME.
Also, any known and proven J2ME design patterns would be of great help!
Thanks for all your help!
Best regards,
ArntHi
AFAIK there r no frameworks, you dont need them - everything you code should be as simple and straightforward as possible.
Hmmm... proven design patterns, well, as I've found standard Java DP can't be used in J2ME, cause you need to do everything with small amount of memory and processing power. Object programming is cool, but it makes big impact on speed of code and on size of generated classes.
And believie me, sometimes those 2-3 kb make difference (eg. on Nokia 6310i, where you have 30 KB of memory, on 3510i it's about 60KB...)
So, one patter of which I can think about is - make your code simple :)
regards
Leszek -
Is MVC a architecture or Design Pattern?.
Hi,
It may be simple question,but i need clarification on this.
Thanks in Advance.Model View Controller is an object-oriented design pattern.
Some individuals may choose to use it (questionably) to describe a piece of a software architecture. In this case they are using the design pattern to describe only an element of an architecture.
MVC outlines how objects will communicate in a three-tier system consisting of a business model and a presentation layer.
MVC does not describe hardware configuration, load balancing, clustering, firewalls, routers, security constraints, resource pooling, and other critical details of a software architecture.
A software architecture design may include and/or use the MVC design pattern to indicate how the technical design of the application should be designed. Here the decision to use MVC is part of the architectural design. It is one specification of the architecture design. There are many other elements of a software architecture design that have nothing to do with MVC.
MVC by itself is a simple object-oriented design pattern. It cannot be used to describe and/or design a software architecture. -
Hi all,
Which design patterns could be applied in coding EJB? I don't know if my question is clear enough, but what I really want to know is which design patterns I could use with EJB and how could I use them this way? (Some example situation)
Regards,
Filipe Fedaltoi think it depends of what u intend to do..
e.g. i think (maybe i'm wrong, any relevant replies are welcome!) that u could use a stateless session bean to implement some facade, delegating entities creation to some non-bean classes? or why not a stateful session bean to implement a factory (when entities creation depend on client preferences)? -
Get instance method and design pattern
Hi All,
1. I New to abap objects and i read the help and some stuff from the forum,
l like to now more about design pattern in abap objects,
2. I saw in some abap class the use of method of GET_INSTANCE i think it's from factory pattern , what is the pros. and cons to use this method ,when i should consider to use it ?
Thanks in Advance
NinaHello Nina
A very good introduction into design patterns is the book "Head First: Design Patterns". Here you will find many good reasons why and when to use the factory pattern.
You should use the factory pattern when
- you want to prevent "direct" instantiation (i.e. using a public CONSTRUCTOR method) by the developer
- you want to hide the complexity of instantiation from the user of the class
- the instantiation creates an implementation of an interface and you want to keep control of which implementing class is returned
Regards
Uwe -
Regarding which design pattern to use for this scenario???
hi guys
I am working on a J2EE application where I need to do translations for 3 different scenarios. It is basically a conversion from service order objects to invoices.
First from a service order object to an invoice.
Second a conversion from a transaction table.
Third a conversion from a remote system.
Finally the product is an invoice..
What design pattern can i use ....is strategy pattern a good idea??
Thanks
JHi,
I think your problem is in result state. You can you sequencial block but for approve or reject you need to set target for each result state. Here I am providing a link. I think you will get your solution here please go through it.
http://help.sap.com/saphelp_nw2004s/helpdata/en/44/429bbd709914bce10000000a155369/frameset.htm
if you have any query please let me know.
Thanks
Chandan -
[BOOK] What's the best book about DESIGN PATTERN
Hi Guys,
by experience, what's the best book for you concerning the Design Pattern in Abap. I mean :
Quality,
Comprehensiveness,
Clearness,
Amount of chapter,
etc.
Thank for advices.
Rachid.Dear Rachid,
This is rank 1 book, but u have learn online also. So many websites are there. example search: OO Design patterns ZEVOLVING.
Regards,
Abbas. -
What are the best practices in design patterns?
What design patterns are likely popular?
If you go to your local bookstore or online book store you will find at least 20 books that describe this.
Some how I doubt you are going to get 20 books worth of an answer. -
EP 7.0 architecture and design
Hi,
We are planning to implement EP 7.0 and i was wondering what other people who have already implemented would recommend.
I need general guidelines like scalability, sizing, security.
We have been using digital certificates on out current portal and would like to use an other authentication mechanism since certificates are expensive and difficult to maintain if there are thousands of users since renewal process is time taking and it has to be done every year.
Could anyone suggest anything related to using Reverse proxy mechanisms,etc.
Also need to know how many nodes, servers which would bring out optimal performance to EP 7.0 .
All useful inputs are appreciated and rewarded.
Thanks,
ClaudiusHi Claudius,
in this scenariov: Browser - AS-ABAP Communication Through a Reverse Proxy
the browser communicates always with the AS-ABAP through a reverse proxy server. For this reason all generated URLs must contain the name and port of the reverse proxy server.
Example:
Proxy: www.sap.com (http:80, https:443)
Host: webas.sap.corp (http:1080, https:1443)
HTTPURLLOC
MANDT SORT_KEY PROTOCOL APPL HOST PORT
100 010 HTTP * WWW.SAP.COM 80
100 011 HTTPS * WWW.SAP.COM 443
As there is no application filter, table http synchronizes all requests in order to generate new URLs. The protocol is the factor that decides which entry is used.
You can also use the Apache Web server as the intermediary server. In this case, configure the Apache Web server as a reverse proxy that routes requests based on a set of rules and conditions. For this configuration, the Apache Web server uses the mod_rewrite and mod_proxy modules.
mod_rewrite is a URL rewriting module that performs modifications to the URL received by the Web server and creates a new request. These modifications are based on a set of rules and conditions that you also specify in the configuration file.
mod_proxy is a module that makes the Apache Web server the intermediary server. It transforms the response from the backend system and sends it back to the client so that it appears to have been sent from the Apache Web server. The backend system remains hidden.
This documentation provides only a brief description of the Apache configuration. For more information about configuring the Apache Web server as a reverse proxy, see the Apache Web server documentation.
Prerequisites
The applications that are to be processed by the Apache Web server are deployed on the AS Java.
Procedure
1. Copy any of the applications files that are to be available to the client from its directory tree on the AS Java to the Apache Web servers document root tree.
Do not copy the WEB-INF and meta-inf files to the Apache Web servers directory tree. They contain specific information that does not need to be available to the client.
2. Edit the Apache Web server configuration file (httpd.conf):
a. Insert the mod_rewrite and mod_proxy modules in the Web servers LoadModule and AddModule entries.
Example Configuration Entries
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/libproxy.so
AddModule mod_rewrite.c
AddModule mod_proxy.c
RewriteLog "/etc/httpd/logs/rewrite_log"
RewriteLogLevel 9
b. Using <Location> </Location>tags, specify the rules and conditions to use for the redirection. Use a separate <Location> section for each application that is to be redirected by the Apache Web server.
Example Redirection Rules
<Location /application_root_dir>
RewriteEngine On
RewriteCond % \.jsp
RewriteRule ^(.+) http://somehost.com:90% [P]
RewriteCond % Example
RewriteRule ^(.+) http://somehost.com:90% [P]
</Location>
Result
The Apache Web server redirects the corresponding requests to the AS Java.
if it helpful reward points are appreciated
Message was edited by:
Pierluigi Demaria -
Is macbook easy to use for that with the special programs ? And if it is which one of the available macbook is better ? Concerning ram, storage, size ...
Please i want a detailed answer to help me chose well.
I know macbook is the best in quality and everything but i hope it won't make things harder on me.
And thanks.See what the department at the university recommends as a start so you are sure the software will be compatible.
The MacBook Pro is very capable and great for design work, but you do need to be sure the school is not using Windows-only software. If the Mac is acceptable, then the model is up to you, but the MacBook Pro Retina will give the best screen image, and the 15" is large enough to make the images very legible. Go for the most memory you can afford at the outset as the Retinas are not upgradable. -
Best photo and doc scanner for use with mountain lion?
Am trying to set up a home system where all my docs and old photos get stored in the computer and iphoto. Thanks for your help in advance.
My recomendation from Apple Store:
http://store.apple.com/us/product/H4943LL/A/epson-perfection-v600-photo-color-sc anner -
Life cycle and desing patterns
Hi Friends,
I am new to SAP BI/BW and learned extract and Reports
Now i am getting some doubts like what sdlc and design patterns are used to SAP BI/BW
Please could you suggest , whether we are have to use in BI/BW
thanks
BabuHi Babu,
SAP BI/BW project also has got the standard project life cycle steps. Whenever you are working on a SAP BI/BW implementation project it starts from
Requirement Gathering -
> Blueprinting -
> High level and detailed design -
> Implementation -
> Unit Testing -
> Integration Testing -
> Go live.
Regards,
Durgesh. -
Is MVC2 a design pattern or architecture? for yes and no why?
I am using JSF which follows MVC2. Is MVC2 a design pattern or architecture? For yes and no why? what is the difference between design pattern or architecture?
Hi There,
Maybe this will help answer your questions...
Firstly, MVC2 is a proprietary name for the Microsoft .NET framework based around the Model-View-Controller pattern - it is an updated version of their first attempt - MVC.
The Model-View-Controller pattern harks back to the days of SmallTalk, and as far as I am aware is not included in the original Gang Of Four design patterns, although there is no reason why it can't be considered a design pattern.
Software architecture is about how different parts of the system fit (interface) together and how they relate, including static relationships (cardinality relationships, state) and processes (what happens when), it most often consists of many design patterns each used to address the various needs of a complete system.
Hope this helps
Rich -
Difference between n-layer software architecture and MVVM design pattern?
hello everyone,
I am not clear with this concepts of Software architecture pattern and design pattern.
I am developing an wpf application using MVVM. Now, my question is, does MVVM come under n-layered architecture?
or n-layer architecture and MVVM both are different?
Regards,
Rakesh.N
Rakesh murthy"
Now my question is, i want to process the data which i get from database. where should i write that processing logic after getting the data from database? in model classes? or in view model classes?
The model is however the data comes from wherever it comes from.
If there is any processing after you get it then that would be in the viewmodel.
The viewmodel adapts your data to the view.
If it needs any adapting then the viewmodel does that, not the model.
EG here
protected async override void GetData()
ThrobberVisible = Visibility.Visible;
ObservableCollection<CustomerVM> _customers = new ObservableCollection<CustomerVM>();
var customers = await (from c in db.Customers
orderby c.CustomerName
select c).ToListAsync();
foreach (Customer cust in customers)
_customers.Add(new CustomerVM { IsNew = false, TheEntity = cust });
Customers = _customers;
RaisePropertyChanged("Customers");
ThrobberVisible = Visibility.Collapsed;
That logic is in a viewmodel.
in this context , in which layer the viewmodel and model classes are put under in n-tier architecture?
They're in two of the n layers/tiers.
Or they're in one.
Depending on how someone decides to classify a layer or a tier.
There is no absolute definition.
Why would you care?
Hope that helps.
Technet articles: Uneventful MVVM;
All my Technet Articles -
Best design pattern for a large number of options?
Hi,
I'm faced with the following straightforward problem, but I'm having trouble coming up with a design solution. Any suggestions?
Two items in the database can be related in three possible ways (temp replacement, permanent replacement, substitute). Each item has three possible stock levels. The user can select one of two items.
This comes out to 54 different prompts that need to be provided to the user (example: "The entered item has a preferrable temp replacement available that is in stock, sell instead of the entered item?", "The entered item is out of stock, but has a substitute item available, use instead?", etc. etc.)
Does anybody have a suggestion of a good design pattern to use? In the legacy system it was implemented with a simple case statement, but I'd like to use something more maintainable.
If anybody has any suggestions, I'd appreciate it.
thanks,In the legacy system it was
implemented with a simple case statement, but I'd like
to use something more maintainable.Is it ever likely to change? If no, then a case statement is pretty maintainable.
How is the data retrieved? I'm guessing it's a decision tree: if the desired object is in stock, return it, otherwise look for a permanent substitute, &c. In this case, perhaps you have a retrieval object that implements a state machine internally: each call to the retrieval operation causes a transition to the next-best state if unable to fulfill the request.
If you do retrieve all possible data in a single query (and I hope not, as that would almost certainly be very inefficient), then think of some sort of "preference function" that could be used to order the results, and store them in a TreeMap or TreeSet ordered by that function.
Maybe you are looking for
-
Quite honestly, I wouldn't be suprised if they delete this post, but hopefully some people will get to read it before it is. I have been a big fan of the ThinkPad brand computer for as long as it existed. I work in Computer Networking and Securit
-
HT1918 How do I remove my credit card from my itunes account?
I need to remove my credit card from my itunes account. My daughter doesn't realize when her gift cards run out so she keeps buying not realizing it comes out of my bank acct.
-
HT204053 Can I use my icloud email address as apple id?
I'm trying to update my current apple id ([email protected]) to [email protected] & I can't seem to get it to work. Can anyone advise why that might be???
-
RoboHelp HTML Version 9 - what is the version for ehlpdhtm.js?
We have been running pen tests looking for vulnerabilites on applications my company has created in order to be PCI certified. I built webhelp systems for these applications using RoboHTML v9. The pen test has indicated that ehlpdhtm.js is suspect wi
-
Does frequently sleeping/turning off the 30" display lower display life?
I typically sleep or turn off my 30" Cinema display about 6 times each day while my Mac Pro is sleeping. I also turn the display off when listening to music/podcasts. Will this frequent power on/power off lower the life of the monitor?