Choice of design pattern for data acquisition system

Hello all
I have a trouble about selecting the suitable design pattern / architecture for a data acquisition system. 
Here is the details of the desired system:
There is data acquisition hardware and I need to use it by observing parameters on User interface. 
the data acquisiton period, channel list to scan should be chosen on User interface. Besides, there are many user interface interactions. e.g. if user selects a channel to add scanlist, then I need to enable and make visible some other parts on user interface. 
When user completes the channel selection, then he will press the button to start data acquisition. Then I also need to show the scanned values on a graph in real time and log them in txt file.
I know that I cannot use producer consumer pattern here. because the data acquisition loop should wait for parameters to scan channels. and it works in a given period by user. so the user interface loop performs higher rate then consumer loop (data acquisition loop). it means queue will be bigger bigger. if I use notifier it will loss some data come from user interface. 
is there any idea about that ? is there any suitable design pattern for this case ? 
Thanks in advance
best regards 
Veli BAYAR
Embedded Systems Software and Hardware Engineer 
"You live in a graphical world. Why not program in one?"
Solved!
Go to Solution.

johnsold wrote:
Veli,
I recommend the Producer/Consumer model with some modifications.
You might need three loops.  I cannot tell for sure from your brief description.
The User Interface loop responds to the user inputs for configuration and start/stop of acquisition.  The parameters and commands are passed to the Data Acquisition loop via a queue. In this loop is a state machine which has Idle, Configuration, Acquisition, and Shutdown states (and perhaps others). The data is sent to the Processing loop via a different queue. The Processing loop performs any data processing, displays the data to the user, and saves it to file. A notifier can be used to send the Stop or shutdown command from the User Interface loop to the other loops.  If the amount of processing is minimal and the file write times are not too long, the Processing loop functions might be able to occur in the Timeout case of the UI loop Event structure.  This simplifies things somewhat but is not as flexible when changes need to be made.
I am not sure that a Design Pattern for this exact setup exists but it is basically a combination of the Producer/Consumer (Events) and Producer/Consumer (Data) Design Patterns.
Lynn
Check out this thread: http://forums.ni.com/t5/LabVIEW/Multiple-poll-case-structures-to-event-help/td-p/2551309
There are discussions there about a 3-loop architecture that may help you.
Jeff
Jeffrey Zola

Similar Messages

  • Design patterns  for data access

    . What design patterns can be used for data access to ensure that only a minimum amount of data is maintained in session

    . What design patterns can be used for data access to
    ensure that only a minimum amount of data is
    maintained in sessionThat's not a design pattern, that's business logic.
    Your application has to determine what "minimum" means.
    Martin Fowler has lots of patterns for data access in his "Patterns of Enterprise Application Architecture". Check them out.

  • Is there a design pattern for this?

    I'm looking for a solution to a design problem I have.
    For a restaurant booking system I need a number of different opening times describing when you can and cannot book. These opening times are essentially Jodatime Period objects. There's a set of opening times spanning a week and these are repeated for every week (a default set of opening times) however it's possible to override these opening times say for a specific day.
    The domain model would be something like a Restaurant class holding 2 Lists of OpeningTime objects one for defaultOpeningTimes and the other for overiddenOpeningTimes the overidden ones get used if they exist for the requested time period. However the database model would be a bit messy as I'd have 2 lists mapping to the same table (OpeningTime). Is that a good idea? Perhaps there's a design pattern for this, if someone could point me in the right direction I'd be very grateful, or perhaps this is the best solution? Thanks!

    jduprez wrote:
    But why do you put the logic in the database too (I'm no DB expert and I didn't know these concepts until I read your post, but that's what a dynamic view based on derived values looks like to me): performance (1 round-trip instead of two)?Hi jduprez. Long time no speakee.
    I guess part of it is that I spent many years as a DBA and modeller, and really appreciate what it's taught me about design. Also, databases are (or should be) designed from the ground up to provide data-directed requests optimally, and include all sorts of nice stuff like transaction handling that aid consistency, as well as speed.
    That said: I HATE SQL. Think Coliseum, with that emblazoned in 60-foot high letters around its walls, and it might come close to just how much I hate that so-called "language". I hate its form; I hate it's inconsistencies; I hate the fact that something like what OP is trying to do is NOT an easy task (and might involve the creation of a table that simply contains Dates, just in order to satisfy Boolean logic).
    However, once you work it out, a database view (at least from the database's standpoint; JDBC I'm not so sure about) is just like any other Table - and that I DO like.
    Programs are good at processing parameterized (ugh) temporal information; databases are good at persistence and high volume. Those two may meet at some point, but I reckon it's going to take another Codd (or Joda) before it does.
    - that's clearer to 90% of the dev team (my biased numbers, based on 50% of Java developers having decent knowledge of SQL and much less than that having the advanced SQL knowledge which I rank your suggestion at)Sounds to me like you'll get the solution that matches the skills you have then. Is that what you really want, if a better one is available?
    - that doesn't require investigating the if of your suggestion (JDBC support)Agreed, but only because my JDBC knowledge isn't what it could be. I'd also be surprised if it doesn't support access to a named view, since they were designed to be equivalent to Tables.
    - the Op is using DAOs, so it's possible, if profiling does show this is hampering performances, to change that with no impact on the client code that calls the DAO.There's no doubt that a database solution is much higher level than a programming one; but, as I said, it's what they were designed to do. And tinkering around with program optimization has the feel of a "hacker's solution" to me. Not that there's any particular problem with that - I do it quite often when I have no control over my source - but I also try to keep in mind what the "actual" problem is.
    Winston

  • What is the best design pattern for this problem?

    No code to go with the question. I am trying to settle on the best design pattern for the problem before I code. I want to use an Object Oriented approach.
    I have included a basic UML diagram of what I was thinking so far. 
    Stated simply, I have three devices; Module, Wired Modem, and Wireless Modem.
    In the Device Under Test parent class, I have put the attributes that are variable from device to device, but common to all of them.
    In the child classes, I have put the attributes that are not variable to each copy of that device. The attributes are common across device types. I was planning to use controls in the class definition that have the data set to a default value, since it doesn't change for each serial number of that device. For example, a Module will always have a Device Type ID of 1. These values are used to query the database.
    An example query would be [DHR].[GetDeviceActiveVersions] '39288', 1, '4/26/2012 12:18:52 PM'
    The '1' is the device type ID, the 39288 is the serial number, and the return would be "A000" or "S002", for example.
    So, I would be pulling the Serial Number and Device Type ID from the Device Under Test parent and child, and passing them to the Database using a SQL string stored in the control of the Active Versions child class of Database.
    The overall idea is that the same data is used to send multiple queries to the database and receiving back various data that I then evaluate for pass of fail, and for date order.
    What I can't settle on is the approach. Should it be a Strategy pattern, A Chain of Command pattern, a Decorator pattern or something else. 
    Ideas?

    elrathia wrote:
    Hi Ben,
    I haven't much idea of how override works and when you would use it and why. I'm the newest of the new here. 
    Good. At least you will not be smaking with a OPPer dOOPer hammer if I make some gramatical mistake.
    You may want to look at this thread in the BreakPoint where i trie to help Cory get a handle on Dynamic Dispatching with an example of two classes that inherit from a common parent and invoke Over-ride VIs to do the same thing but with wildly varying results.
    The example uses a Class of "Numeric"  and a sibling class "Text" and the both implement an Add method.
    It is dirt simple and Cory did a decent job of explaining it.
    It just be the motivation you are looking for.
    have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Design patterns for keypad...

    Hi All,
    what design patterns should I use If I need to program a front panel(
    keypad+display) for a phone which is going to have a lot of many different commads?
    are there any good examples ?
    thanks.

    . What design patterns can be used for data access to
    ensure that only a minimum amount of data is
    maintained in sessionThat's not a design pattern, that's business logic.
    Your application has to determine what "minimum" means.
    Martin Fowler has lots of patterns for data access in his "Patterns of Enterprise Application Architecture". Check them out.

  • Multiple Sound Card for data acquisition gives read buffer error

    I am using 6 usb based sound cards for voltages and currents mearuments of a three phase delta system.. Hardware is working well. but in labview when i use builtin Input=>sound box for data acquisition it also works well upto 4 inputs... but when i use more i.e. 6 it starts giving error "cannt perform action, read buffer is full" some thing like this... som times it goes to "not responding"...i have tried to find the solution and found in another post of this fourm to varry the sampling rate... i did it upto 96000 that is maximum ... but still problem is same...i need to know, how to manually increase the read buffer. if not possible then.. is there any way that labview stop giving any type of error during simulation?

    thnx i hv solved that problem ... now there is another problem... i am getting all my signals in computer but problem comes when i use phase detector. it keep on showing different values in phase measurement block.. how can i manage the signal with correct phase. i cannt send code cz it has many VIs and they are spread in computer. so i am pasting come photos that are showing different. look in picture...it is from same signal and the phase is different..
    Attachments:
    Capturexcvxccxvxcvcxvvxcvxcv.JPG ‏11 KB
    Capturexcvxcvxcvxcv.JPG ‏11 KB

  • Design Pattern for execution queue

    Anyone know of any good design patterns for using a JMS Queue and MDB's
              as async
              execution queue which maintains execution order by some key
              

    Enforced ordering on redelivery will be supported in the
              next release, but only if the application clamps the pipe-line
              size down to its minimum and the MDB pool size down to one.
              I don't think enforced ordering is supported in the current release.
              We are looking at least partially addressing the general design
              pattern below in the release after next. I don't think I can
              get away with being more specific. (Sorry.) Currently, I
              think something along the line of Larry's solution is the only way to
              accomplish it. Interestingly, the recent thread started
              by "[email protected]" on correlating requests and responses
              seems to be somewhat related.
              Tom, BEA
              Larry Presswood wrote:
              > Well you are both correct however we have something which works
              > however it does involve some threading primitives which generally is not
              > a good idea
              > inside wlas but seems to work.
              >
              >
              > Generally have a singleton on the server which has slots for each key
              > with message
              > numbering for each message and force a wait if message for key is out of
              > order
              > during fifo processing rules. IE do what things you can do in parallel
              > but gate for
              > the last step.
              >
              > I think there is a general remote execution pattern out there.
              >
              > The general problem to solve is this:
              >
              > In a messaging system you want to process messages for each key/session
              > in order however
              > with a large number of sessions its possible to parallel messages for
              > different sessions
              >
              > Otherewise you can either create custom queues or a topic with a
              > selector and then
              > create custom consumers which does not behave as well from a resource
              > perspective
              > as MDB's do.
              >
              >
              >
              >
              >
              >
              >
              > Nick Minutello wrote:
              >
              >>I may be completely wrong - but I think that Larry is referring to the inherant
              >>out-of-order message consumption that you get when using MDB pools to consume
              >>from a Queue.
              >>
              >>In short, the only design pattern here is to deploy the MDB to only one machine
              >>in the cluster - and set the pool size to 1.
              >>
              >>In-order execution is incompatible with the parallel execution that MDB's give
              >>you.
              >>
              >>-Nick
              >>
              >>
              >>
              >>Tom Barnes <[email protected]> wrote:
              >>
              >>
              >>>Hi Larry,
              >>>
              >>>Generally, I think it is best to have a seperate queue per key if the
              >>>
              >>>number of keys is small. This prevents starvation of a particular
              >>>message. For example when handling message-priority, low priority gets
              >>>
              >>>an MDB pool of size 1, high priority gets and MDB pool of size 10.
              >>>
              >>>Note that WebLogic JMS allows a queue to specify a sort-order keys based
              >>>on arbitrary message fields. Note that the in-flight message pipe-line
              >>>
              >>>between server and asynchronous clients is unsorted.
              >>>
              >>>Tom, BEA
              >>>
              >>>Larry Presswood wrote:
              >>>
              >>>
              >>>>Anyone know of any good design patterns for using a JMS Queue and MDB's
              >>>>
              >>>>
              >>>>as async
              >>>>execution queue which maintains execution order by some key
              >>>>
              >>>>
              >>>>
              >>
              >>
              >>
              >
              

  • Design Pattern for Controlling Uniqueness

    Hi,
    I'm looking for a good design pattern for controlling uniqueness. E.g. I have classes representig a particular database relation. The constructor has the database key(s) as parameter(s). For the other attributes there are corresponding setter and getter methods.
    How can I make sure, that I have only one instance with key(s) foo in my system?
    Of course I have some ideas but I'm not sure if that is the best thing I could do. So I could use a map, to map the keys to the tuples.
    This map could be in another class foo2 which creates the objects of foo1 (which has only a protected or package-private constructor).
    Or I could place the map into foo1 itself as a static variable, and add a static factory method. The constructors would then be protected or private. Are these solutions good? Which one to prefer?
    How can I handle other unique attributes (not part of the key)?
    The equals method for such a class could then test the keys only, since there is only one object with such a key in the system, right?
    Thanks for any help.
    Greets
    Puce

    The class could have only private constructors and a public static getter method, which would decide based on some collection of the object created so far, whether to create a new one or give an old one.

  • Flex design pattern for BlazeDS transfer objects

    Dear Community,
    I have a question regarding the nature of objects transferd from BlazeDS backend to the Flex client.
    According to some adobe docs all the presentation logic should be in flex and BlazeDS should provide only services.
    The question is what kind of transfer objects should be used? with what level of abstraction?
    To make it more clear let's talk about a simple forum application like adobe forums.
    I have created a Forum service, which returns a Forum transfer object, which has a List of Threads, with each thread having a List of Messages.
    Flex gets the Forum transfer object and does all the presentaiton work.
    This is a very nice seperatin of concerns architecture BUT there are two major performance issues:
    - when the forum becomes bigger the transfer object will be huge
    - the flex will use huge client resources to create the presentation of the forum transfer object.
    So my question is what is your strategy/ design pattern for such a problem.
    An obvious answer would be create services that include the presentation logic and use transfor objects like ThreadListPage which will include only the first 10 threads.
    Thanks in advance

    I think you are going to get a few varied types of answers to a general question like this, but I will comment on a few things.  First, you should only be transmitting the data that you need to use or display to the user at the time.  If this forum was implemented in Flex (I wish) you wouldn't transfer the text for all the threads.  You might not transfer the thread text at all (just the subjects), you'd make calls back to the server to fetch that data when and if you need it.
    Also, I think you are overestimating the resources required for the Flex "presentation layer".  If you think about it, these workstations we have here are pretty idle most of the time when you're at a website.  Nowadays there's plenty of processing power just sitting there waiting, so as long as your design isn't flawed the CPU or memory are rarely going to be a bottleneck with Flex.
    The way I design, BlazeDS (or GraniteDS etc) should mostly just be "serving data".  There is some flexibility available, for example I don't see a problem with putting certain types of business rules (such as a limit on the number of results that can be recieved in a search) within server side code, and validation rules on the Flex side.  So there's not too many "industry standards" in Flex yet beyond maybe what's done in the various standard architectures, at least not that I'm aware of.
    You might find it beneficial to look into some of the various frameworks/architectures available like Cairngorm, Mate, Swiz, and so on.  Learning how they work (looking at examples) would probably answer some of your questions too.

  • Standalone application for data acquisition using NI DAQ card

    I have made a standalone application in labview GUI for data acquisition and signal processing. if i have to run this application in any other computer what all softwares should be installed other than labview runtime engine...NI DEVICE DRIVER CD alone is to be installed or do i have to install any other software for data acquisition using NI daq card??
      thanks and regards
    Solved!
    Go to Solution.

    You should only need the run time engine, The device drivers for the device, maybe need VISA drivers if you are doing serial or something of that nature, You may need the channels or tasks created in NI measurements and automation if you created them there.
    There may be other things that you will need depending on what you include in your code and what tool kits that you have installed.
    Tim
    Johnson Controls
    Holland Michigan

  • Design pattern for unprotecting and reprotecting sheets with VBA?

    Many macros can't run when a worksheet is protected, so when I develop an Excel workbook that has protected worksheets, I have to unprotect worksheets when macros are called and then reprotect the worksheets once the macro has completed.
    The current design pattern I use for this is the following:
    I look at each procedure individually and consider which sheets need to be unprotected for it to run. Then in each procedure I write:
    Sub Test()
    Dim bSheet1Protected as boolean
    Dim bSheet2Protected as boolean
    bSheet1Protected = Sheet1.ProtectContents
    bSheet2Protected = Sheet1.ProtectContents
    bSheet1Protected.Unprotect
    bSheet2Protected.Unprotect
    '''The rest of my code
    if bSheet1Protected then Sheet1.Protect
    if bSheet2Protected then Sheet2.Protect
    End Sub
    But I imagine that maybe there are better ways of doing this. What is your preferred design pattern for unprotecting and reprotecting sheets with VBA?

    Hi JP3O,
    I think it is a good practice to unprotect the worksheet before execute some code and protect it back after the code execute finished.
    >>But I imagine that maybe there are better ways of doing this. What is your preferred design pattern for unprotecting and reprotecting sheets with VBA?<<
    I am not able to find a better way since we always need to unproect the worksheet if some code didn't not executed successful when the worksheet is proected.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What is the best design pattern for top-down ws development..?

    Hi,
    What is the best design pattern for top-down development+ wsdl2service....?

    elrathia wrote:
    Hi Ben,
    I haven't much idea of how override works and when you would use it and why. I'm the newest of the new here. 
    Good. At least you will not be smaking with a OPPer dOOPer hammer if I make some gramatical mistake.
    You may want to look at this thread in the BreakPoint where i trie to help Cory get a handle on Dynamic Dispatching with an example of two classes that inherit from a common parent and invoke Over-ride VIs to do the same thing but with wildly varying results.
    The example uses a Class of "Numeric"  and a sibling class "Text" and the both implement an Add method.
    It is dirt simple and Cory did a decent job of explaining it.
    It just be the motivation you are looking for.
    have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Design Pattern For Web Services.

    I tried asking siomilar questions in WebService Forum but didn'y got any replies.
    Can anybody tell me what should be the Design for Web Services.
    I have understanding that there can be just 1 Interface/Implementation class for each Web Service, and which will have 1 end point.So for evry such Interface we will have to have 1 Web Service.
    Can someone please clarify wheather I'm correct or not ?
    I guess that If my application has many Interfaces and I have to expose the application as Web Service.Then I will have to expose all methods from one Interface and then expose this new Interface as Web Service.
    Is this how WS will work.
    Any pointers to design PATTERNS for Web Service will be highly appreciated.
    Thanks
    Rahul

    I don't know if anyone has documented new patterns specifically aimed at web services but the old ones definitely apply. Like you were alluding to, there is a letter-envelope decoupling of interface and implementation with the XML WSDL interface and coded implementation.

  • Design pattern for IFS

    Hi,
    I am new to Oracle IFS. I just want to know Is there any proven design pattern for IFS application development.

    The class could have only private constructors and a public static getter method, which would decide based on some collection of the object created so far, whether to create a new one or give an old one.

  • Choosing a design pattern for duplicate processes

    I need to create an application that controls and aquires data for two basins in a wastewater treatment pilot plant. Both basins go through the same series of states aerobic, anoxic, settle and decant but at different times (and therefore need to be controlled independently). Can I run two state machines in parallel or would it be best to use a different design pattern altogether (eg Master/Slave)? The application is intended to be run off a FP-2010.

    You certainly can run two state machines in parallel - maybe you could put the state machine in a re-entrant subVI and place two copies of that subVI on your top-level diagram, passing in different parameters to specify e.g. interface channels and output filenames. If it's not possible for two independent VI's to communicate directly with your I/O hardware then they could use e.g. queues to communicate with a separate I/O process. Queues could also be used to communicate with a user interface process if that's required. I guess the choice is influenced by how important it is for your solution to be re-usable and scalable.

Maybe you are looking for

  • Missing hard drive memory on brand new Macbook Pro

    Hi all, Forgive my lack of technical knowledge here, but I've just bought a new Macbook Pro Retina, and despite migrating literally about 1GB worth of files, the system is showing approx. 22GB of storage space being taken up by 'other.' I know these

  • JDeveloper 11g Toplink Session Configuration Editor Error

    Hi everone, In JDeveloper11g Relase1, Session Configuration Editor doesn't run correctly, always crashes, and session.xml configuration file has validation errors, for example: element primary-project not expected. element login not expected. element

  • SQL Server 2014 Installation Problem

    I run the setup file and hit the New Standalone Installation Of SQL Server. When i enter the license key and accept the terms of use and pass the Product Updates and Install Setup Files, i see a warning on Microsoft.NET Security ... but i know that's

  • At switch on it needs a WPA2 and a WPA password every time

    Every time I switch on it is not connected to my WiFi and says it needs a WPA2 password which i enter then when I switch on again later it says I need a WPA password which I enter. It's request alternates every time. Very boring!!

  • Problem with an 845 Pro4 (MS-6391)

    I'm building a system using an MS-6391 board and I can't get anything out of it. I had a brand new power supply (kind of cheap) on the system first that wouldn't give it any power at all, even though it is rated for P4's. I switched it with an Antec