Timing for Data Acquisition Using Notifiers

I'm trying to use notifiers to transfer data from an acquisition (master) loop to the slave loop. I want data to be transferred for analysis only when the VI is in a certain state - not in all states. That's why I'm preferring to use notifiers instead of queues (I want all data collected during the other states to be disregarded). I have attached a simplified version of what I'm trying.
The master loop generates a data point every second. The slave loop is in a "delay" state for 5 seconds and then in "acquire" state for 3 seconds. Given this architecture I would expect no data for 5 seconds and then 3 data points to be plotted during "acquire" state because only one data point is generated per second. But for some reason I get 5 or 6 data points during every acquire cycle. I haven't figured out why I get 5-6 data points instead of 3. It probably has to do with the timing functions I'm using.  
Thanks!
-Arnie 
Attachments:
Notifier Data Transfer Template.vi ‏62 KB

Here is an example of a race condition without the use of local or global variables.  What is happening is that the notifier is already queued up with a value even before the Elapsed Timer has even started.  So one extra value will be in the output array.  Also, depending on how the parallel loops perform (which goes first), there may be an extra value queued up before the Time Elapsed event could fire.  Typically, when I ran it, I got an array size of 6 at first, and then it went down to 5.  Clearly the architecture is not right for what you want to do.  Instead of depending on timers and parallel loop timing, you could receive all the values queued and just discard the ones you don't want.
- tbob
Inventor of the WORM Global

Similar Messages

  • 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

  • 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

  • Data Acquisition - using local variables to write data to a file

    Hello,
    I am running a Data Acquisition vi (currently in LabVIEW 7.1 but soon to be updated to 8.2) that collects ~100 parameters of data from several sources contained in a while loop. The current configuration (which I did not write) uses very few subVIs and writes to ~100 local variables to store each parameter. It then reads all the local variables and builds an array of all the strings, converts then to a spreadsheet string, then uses the write characters to file function to append to a datafile. I am trying to clean things up and have came up with subVIs to collect the data from the following sources:
    8 serial port sources collecting btwn 8 and 20 parameters each
    ~15 thermocouple readings
    ~10 analog inputs
    ~20 parameters read off an ARINC 429 bus.
    I have come up with a subVI to read each of the sources and have placed the subVIs in the while loop. Each subVI outputs the data that it collects in array or cluster form. I was wondering how best to write each parameter to a CSV file at between 1 and 10 Hz. Should I write each subVI output to a LV and then read them off as was done before (the difference being that I have reduced the # of LVs to ~10 vs >100?
    I should add that precise timing is not that important, so if all the subVIs are not collecting simultaneously (which I understand that they won't be), it does not really matter.
    Thanks.

    Hi jilla,
    jilla wrote:
    What I think that you are saying is to turn the outputs of the 4 subVIs into inputs of a 5th subVI that writes to the data file. Correct?
    Yes.  It may sound like a fine-point, but I beileve it's better to create a VI specifically for formatting data - in your example, 4 arrays IN, a single string OUT.  Then write the string to file as a seperate operation.  GUI-displayed data can go through a similar transformation, the four arrays wired to a subVI which builds output-structures specifically for display.  It's a beginner's mistake to put lots of individual controls and indicators on the screen when groups of them are naturally related (in an object-oriented sense.)  Use clusters to group related controls - this will keep the diagram much cleaner.
    One more question: at what point (either # of data points or frequency of data collection) does it become necessary to use queues? Thanks.
    Well, there's not really a clearly definable "point".  I'd say if your update-rate climbs above 100Hz, or you witness poor program or system performance, then it's time.  The scenario you've described is a fairly simple acquire/display&log loop - and simple is good.   Then-again people can't see/react-to updates faster than about 10Hz - so it doesn't make sense to sacrifice performance - if performance becomes an issue.
    Re: queues:  Queues are sometimes used to buffer data that's "produced" in one place and "consumed" in another.
    Here, if/when logging data, you're logging with every DAQ.  I wouldn't recommend using a queue to transport data from a "DAQ loop" to a "Logging-loop" - those functions can be in the same loop.  Should/could a queue be used to get data from a "DAQ loop" to update the GUI at a lower frequency?  Sure, but a Notifier might be a better choice.   Further, in the (simple?) program you've described, you might use a case structure (True/False) to only update FP indicators every "X" iterations - a simple solution that doesn't require Queues or Notifiers.
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • 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

  • How to writing the data into the file at the same frequency of data acquisition using myRIO

    Hi everyone,
    I have a question regarding data acquisition fequency and data recording frequency of myRIO. Hope you guys can help me out.
    Basically, I want to acquire voltage input at analog input 0 at the frequency of 1kHz and then write the data into a file (tdms format). 
    However, I always found there were only 55 or 56 data points recorded every second in the data file (see the excel sheet). 
    To confirm my data acquisition was performed at the correct frequency, I added a small function in the main loop to indicate the time spent between two acquisition events. 
    To my surprise, the period of data acquistion is correct (1ms or 1kHz) but there are only 55 or 56 data point per second recorded in the data file.
    How can I record every data point acquired by the analog input?
    Thank you!
    P.S. I am very new to myRIO. How can I manually set the system time for myRIO? The default time of my myRIO is wrong. 
    Best,
    Tengyang
    Attachments:
    test result.xlsx ‏16 KB
    Main with timed loop.vi ‏122 KB
    test result.xlsx ‏16 KB

    Have a look at the Jakarta POI project, they have a Java API for creating Word documents.
    http://jakarta.apache.org/poi/hwpf/index.html

  • Continuous data acquisition using NiDAQmx with a start and a stop trigger

    I'm sorry if this has been answered many times before, I can't quite seem to find the answer I'm looking for.
    I am using LabWindows CVI version 7 and NiDAQmx with a PCI6023E.
    I wish to acquire data continuously using an external clock as a timebase - I am happy with this.
    I wish the acquisition to start when an external signal (say on PFI7) goes high. I am also happy with this.
    What I also need is for the acquisition to stop when the signal on PFI7 goes low, or possibly when a signal on say PFI8 goes high. I'm not too concerned about which approach to use.
    How do I stop the acquisition with an external signal?
    Thanks in advance,
    Crispie

    I don't have CVI installed, but I've attached screen shots of a LabVIEW program that I believe accomplishes what you are trying to do. Translating it to the C API should be straight forward. I'll try to explain what the program is doing since it's using some of the more advanced features of the driver. Also, the DAQ device you are using doesn't support a true "stop" trigger so I'm using a reference trigger to get as close to the desired functionality as possible.
    First, the program configures a finite acquisition that uses both a start trigger and a reference trigger. The acquisition is using an external sample clock and will acquire 4 samples (2 pre-trigger samples and 2 post-trigger samples). Four may seem like an odd number here, but it allows us to emulate the functionality of a stop trigger as close as possible. Given this configuration, you must acquire at least 2 samples before the "stop" trigger is recognized, and you must acquire 2 more samples after the "stop" trigger is recognized. Hopefully this restriction is acceptable. You can always discard the last two data points after the stop trigger if they're not of interest, but you're stuck always acquiring at least two points between when the start and stop triggers are recognized.
    The program also overrides the default buffer size and read position. By default, the DAQmx driver will pick a buffer size exactly big enough to fit the pre-trigger and post-trigger data (4 samples in this case) and will begin reading data from the start of the pre-trigger data. Explicitly allocating a larger buffer will allow your acquisition to execute without receiving buffer overflow errors, and changing the default read position will allow you to read all of the data between the start and stop triggers as it is acquired and not just the pre-trigger and post-trigger data.
    Finally, the while loop takes care of reading the data. In this case, the loop continues to read data until the task is done and there are no longer samples available for reading from the buffer. The number of samples read per iteration is the lesser of the user specified amount or the number of samples available for reading from the buffer.
    I hope this helps. Good luck.
    Attachments:
    Stop_Trigger1.JPG ‏40 KB
    Stop_Trigger2.JPG ‏43 KB

  • Connection verification failed for data source using mySQL

    Hi,
    I having problem with mySQL datasource and getting the above error. This is only happening in our staging server. We are using ColdFusion 8 running JRUN4 and trying to connect to mySQL v 5.1.41. I tried adding DSN from my localhost using ColdFusion 9 developer edition and I am able to connect without error.I know that mysql server, username & password is valid. I can access the mysql also using mySQL gui tool from different pc and it works fine. I'm believe that this has something to do with mySQL driver? Can somebody shed some light on how can I fix my DSN connection problem? Thank you.
    here's the error:
    Connection verification failed for data source: forum
    com.mysql.jdbc.CommunicationsException: Communications link failure  due to underlying exception:   ** BEGIN NESTED EXCEPTION **   java.net.ConnectException MESSAGE: Connection timed out: connect  STACKTRACE:  java.net.ConnectException: Connection timed out: connect      at java.net.PlainSocketImpl.socketConnect(Native Method)      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)      at java.net.Socket.connect(Socket.java:519)      at java.net.Socket.connect(Socket.java:469)      at java.net.Socket.(Socket.java:366)      at java.net.Socket.(Socket.java:208)      at  com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:173)       at com.mysql.jdbc.MysqlIO.(MysqlIO.java:267)      at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739)      at com.mysql.jdbc.Connection.(Connection.java:1553)      at  com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)       at  coldfusion.server.j2ee.sql.pool.JDBCPool.createPhysicalConnection(JDBCPool.java:589)       at  coldfusion.server.j2ee.sql.pool.ConnectionRunner$RunnableConnection.run(ConnectionRunner. java:67)       at java.lang.Thread.run(Thread.java:619)   ** END NESTED EXCEPTION **    Last packet sent to the server was 0 ms ago.

    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6ef0253
    HTH
    Tim Carley
    www.recfusion.com
    [email protected]

  • MultiThread for data acquisition (basic problem)

    Hi there,
    I want to create a data acquisition VI that perform acquiring data in an independant thread, and when the data is ready, displaying it in a graph. In another word, one thread for acquisition and another one for UI events (button to start / stop acquisition, display cursor...). Data acquisition is higher priority than displaying data. Any VI concrete sample for multithread ?? Thanks in advance.

    > Hi there,
    > I want to create a data acquisition VI that perform acquiring data in
    > an independant thread, and when the data is ready, displaying it in a
    > graph. In another word, one thread for acquisition and another one for
    > UI events (button to start / stop acquisition, display cursor...).
    > Data acquisition is higher priority than displaying data. Any VI
    > concrete sample for multithread ?? Thanks in advance.
    By default, the UI runs in the UI thread. The execution of the VI runs
    in the Standard execution system, which has its own thread. By default,
    these threads are at the same priority. If you want your DAQ to run at
    a higher priority, you can place your DAQ code in a subVI. Then set the
    subVI to run in any execution system you like at a higher
    priority.
    Call the subVI in parallel with the rest of your UI loop, and determine
    how you want the DAQ data to get to the UI. You can use a global, a
    queue, etc. Don't overlook simply using the terminal or local for the
    graph. All of these other methods have their advantages, but they also
    add overhead. At some point, you will need to copy the data from the
    DAQ code to the UI code. This is all that writing to a terminal or
    local does as long as synchronous display is not turned on.
    Greg McKaskle

  • ETL for Data warehouse - use view instead of transformations?

    When populating staging tables, is anyone else using this approach of using a view - as opposed to transformations within your ssis dataflow ?  I had not thought of this approach, but I suppose it results in the same goal - to get the wanted schema
    for data flowing into the destination.  I suppose it would be just a matter of using the view as your source - as opposed to the underlying table(s), followed by transformations before the destination?

    Hi sb,
    I would say that it depends.  You want your load to be efficient and your want your load to be simple and easy to enhance later.  Sometimes these goals can be conflicting, so you need to decide what's important for your implementation.
    Regarding efficiency, you will typically be better off with a view as the filtering, lookups etc will be done at source, so less data transferred to your staging area.  For example, the view might only ask for 12 of 25 columns in a source table, so
    you will be bringing over, perhaps, half the amount of data.  Another example, your view might join two tables at source, while another design option would bring over all of the larger table and perform a lookup (on the smaller table) for each record
    of the larger table.  This could be extremely inefficient if each lookup went back to source.
    Regarding easy enhancements, in the first example, if you bring over all 25 columns, you might find it easier to add one of the, as yet, unused 13 columns.  Regarding the second example above, with views, there is a risk that a new view will be created
    for new requirements, resulting in multiple views importing overlapping data.  You really only want to import each datum once, with no duplication.  Note; duplication is unlikely if the views are essentially one view per logical table in the source
    system.
    I've sat on the fence a bit answering this question, but it really does depend, and it is a big question.  What you need to do is understand the ramifications of the design you implement.  Having qualified my response, I very often use views to
    perform simple 1:1 mainipulation of the source data.
    Hope that helps a little,
    Richard

  • Sample VI's for data acquisition from SR850

    Hi,
    I was helped a lot by NI in finding driver for our instrument,SR850. I've
    installed its driver and need some sample VI's for its data acquisition. I
    am a
    beginner in Labview and getting data from SR850 is creating a lot of
    trouble
    for me at the moment. We have Labview 7.1 installed on our computers in
    Linkoping university.
    Your help in this regard will be highly appreciated.

    Actually i have to plot all of SR850's outputs(X,Y,R) vs. time and save corresponding data on a PC,but i am unable to write its VI. Hope to hear from u soon

  • Changing Field Label length for Data Element using ABAP code.

    Hi Experts,
    We have a scenario where we have to update the maximum length of the various Field Labels (Short, Medium, Long..) for a Data Element using ABAP code.
    Does anyone know how to do this ? Is there a Function Module available for this purpose ?
    Appreciate your valuable inputs.

    Hi ,
    Use the view
    DD03M
    Give
    TABNAME as table name,
    DDLANGUAGE = EN / sy-langu
    and order by position. (for correct sequencing)
    You will get description of the fields (short,medium, long etc). You will also get the length and other details.

  • Multiple data acquisition using PXI-5124 digitizer

    I have a system in which I do data acquisition of the present state of the physical system (using PXI-5124 digitizer),
    give the system some change (using labview program itself) and do data data acquisition again corresponding to 
    the changed state of the system.
    So I need to do two data acquisitions in one loop. How do I do this ? Labview examples have some programs (attached file) that
    does one data acquisition in one loop but I need to do two.
    I tried to make some changes to this program but it doesn't seem to work well.
    Thanks
    Attachments:
    PXI5124-data-acquisition.vi ‏46 KB

    From the explanation you have given about reconfiguring the digitizer,
    I think the example you are looking at is the one you want.
    The digitizer is reconfigured with new settings every time with in that loop,
    so the user can change the settings such as triggers and vertical range on the fly.
    The original state of the example showed how it was reconfiguring the digitizer,
    was there something else you wanted to add  to that example?

  • I am doing data acquisition using the 6024E board, how can I acquire voltages greater than 10V

    I am doing data acquisition on MATLAB using the 6024E board, the maximun range I can see is <-10V,-10V>, can I increase this limit to be able to acquire higher voltages

    Without knowing the details of the signal you are acquiring (output Z etc), I can only offer an old suggestion.
    A voltage divider may be usefull. This will work if your application can tolerate some external resistors.
    Ask if you want details.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Lenovo 14 20DM correct driver for 'Data Acquisition and Signal Processing Controller'

    Hi Everyone, I am the happy owner of a new Yoga 14 20DM. A few days ago I made the decision to upgrade to Windows 10. Whilst the upgrade went smoothly I did have to install a number of drivers manually. At the moment I am stuck on trying to install the 'PCI Data Acquisition and Signal Processing Controller' (as shown below).  I have tried right clicking on the device then selecting Properties > Driver (tab) > Update Driver > Search automatically for updated driver software, however doing so only shows the screen capture below!  Furthermore I have searched the Lenovo support page for a suitable driver however none is available! http://support.lenovo.com/au/en/products/laptops-and-netbooks/thinkpad-yoga-series-laptops/thinkpad-yoga-14/20dm?TabName Finally I have also installed, and run, 'System Update 5' the software program available from Lenovo. However it was not able to install a correct driver for this device. I have done a little searching on this topic, and have read a couple of stories about people installing an incorrect driver for this device, and then experiencing blue screens! Can anybody suggest how I can go about locating and installing the correct driver for this device? Any help will be greatly appreciated. Kind Regards, Davo

    Hi Ingemann, Ultimately I decided on the newest version of the Intel Chipset Device Software (INF Update Utility), which at this time (on the Intel website) is version 10.0.27. https://downloadcenter.intel.com/download/20775/Intel-Chipset-Device-Software-INF-Update-Utility- Interestingly enough I was presented with the message below when I ran this executable.  I selected Downgrade (with some trepidation), and after rebooting was pleasantly surprised to see that the troubled device was missing from the list. I can only assume that this means the correct drivers were installed. Thanks you very much for your help. Kind Regards, David

Maybe you are looking for

  • Batch Processing of Messages

              How can I set up WL7.0 so that a certain number of messages are delivered to a           consumer? In other words insteading of having one message delivered to the messagelistner,           I want to have x number of messages delivered so t

  • Custom order in playlists

    First, please accept my apologies for posting this query twice - I had posted the earlier one without realising it was on the iTunes for Windoze thread. I'm not thinking too clearly just now, so please bear with my error in netiquette. Using iTunes 7

  • .psd preview images not showing in desktop folders

    Name, size, kind, etc text shows but no image of the files, in any of my folders that i look through with finder. Jpgs made from the psd's preview fine.. what gives? PS 10.0.1 os 10.5.4

  • Error trying to download cs5 from Trial S/W page

    I need to download CS 5 Design Standard. I lost the original media during a cross-country move, but I still have the serial numbers. I tried downloading from the Trial Software page, but when I click on ANY of the links, I get the following: Access D

  • Database with MSExcel

    Hello everybody, I wish all a happy new year. Now my questions again. I want to work in my application with an MSExcel database. Is it possible to do this with an ActiveX - Control or have I to do something special, like to include header -files or l