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

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • I w'd like to know if LabVIEW 6.0 Application Builder includes the daqdrv (for data acquisition) and serpdrv (for serial communication) support files by default.

    Building an application to communicate to a device by serial port

    Hi velou
    The LabVIEW 6i Application Builder no longer requires daqdrv. Regardless of your Application Builder and LabVIEW version, you must always install the appropriate driver files on the target machine. For example, if your application communicates with a DAQ board and a GPIB board, then you must install NI-DAQ and NI-488.2 on your target machine. If you are using the VISA VI's for serial communication, than you have to install NI-VISA . If you are using the "old" serial VI's, than you have to include serpdrv separately.
    Luca P.
    Regards,
    Luca

  • Data acquisition from SPCM-AQRH-15 and Nano-ViewTM 200-2/M

    I am trying to acquire data from APDs (PerkinElmer, SPCM-AQRH-15) and Nanopositioner (Mad City, Nano-ViewTM 200-2/M). The second equipment has USB 162 or 202 digital interface integrated but I am not sure abut the first one since I am still waiting my order. anyway, I want to control/communicate with both of them using your product, does anyone know what software and hardware I need? thanks.
    Solved!
    Go to Solution.

    Hello Confuciusl,
    I have been looking into the problem
    statement that you gave us above and have some questions for you as well as
    some answers. I am going to go with the basic understanding that we will be
    using LabVIEW to not only communicate with your devices, but also for data
    acquisition and analysis.
    In reference to your APDs (PerkinElmer,
    SPCM-AQRH-15), I have looked at the data sheet for the product located here,
    and have determined that the best method of communication with your device
    would be to use some type of Counter/Oscilloscope card in a PCI/PXI standard.
    This will allow for proper recording of your signal from your Output Terminal.
    For more information on cards please refer to this link.
    As for the second instrument listed, the
    Nano-ViewTM 200 from MadCity, it mentions here that The Nano- View/M™
    system includes the Nano-Drive™ controller and is compatible with user written
    LabVIEW software. Since we do not have the capability to obtain the product you
    are specifically trying to communicate, the best option at the moment would be
    to try and contact MadCity and see if they have any specific Instrument Drivers
    pre-built for LabVIEW that will allow you to communicate with your device. If
    they do not, the next option would be to develop your own by following the
    guidelines at the following link.
    Thanks again and have a great day!
    Regards,
    Nicholas K
    National Instruments
    Applications Engineer

  • Data acquisition on the basis of time

           Hi everyone,
    I want to acquire the radial run-out (radial small displacement) of a rotating spindle using a capacitive sensor. To do so I will use the LabView v. 7.1. The PCI-6036E card from National Instruments (NI) will be utilized for data acquisition. The spindle turns at 100 rpm and a rotational incremental encoder is fixed at rear of spindle. This encoder provides an index digital pulse per revolution. This pulse should be used to start and finish the sampling process. I want to sample on the basis of time, by means of sampling rate of the card (Ksamples/s). So, let us suppose that I want to acquire 500 data/rev. The spindle takes 0.6 sec to complete one revolution. Thus, the required sampling rate is Fs = 500 samples/0.6 s = 833 samples/s. So, I should set the VI in LabView so that it samples only 833 data/s. Therefore, I will have to reduce the sampling rate of the analog-input channels in use. For example, let us suppose that the card provides 100 Ks/s when operating in multiple channels. Let us admit that there are 4 analog-input channels in use. So, the scan rate per channel is 25 Ks/s. This is too much for this application. I only need 833 samples/s. So, I should program the VI so that the card provides that required sample rate. As said earlier, I need to start and end the sampling process at the same point. Thus, to do that the index pulse of the encoder will be used. Also, I want to sample during 5 consecutive revolutions of the spindle. So, by means of a loop in VI, I should count the index pulse of encoder until the number of pulses be equal to 5 (= number of revolutions). At this instant, the sampling process should be stopped. Note: 1) the sampled data should be put in a buffer. After the sampling process is finished, this data should be saved in a file of LabView; 2) In fact, the data acquired by the sensor are voltage analog input. Questions:1) Could you make a VI for this problem, please? Note: you can use the DAQ ASSISTANT EXPRESS VI or DAQmx TASK NAME CONTROL method2) What should I do to stop the data acquisition at the end of 5 revolutions using the index pulse of encoder?3) Could you send examples (VIs) similar to my problem above? In anticipation, thank you very much for any help. My e-mail: [email protected]                                                                                      
     Bruce  

    duplicate post
    Continue in other thread
    Message Edited by smercurio_fc on 11-14-2008 09:10 AM

  • Data acquisition from NI PXI 5152 using LabVIEW

    Hi,
        This might be really stupid question, I am new to LabVIEW and the Digitizer equipment. I was wondering if there are already any labVIEW based application available to read the data from PXI5152. I would be using both channels available and may be trigger. If there is no such application available, what would be port numbers I would be using for data acquisition. But, If I am to develop an acquisition software, I would be looking at every single specification of the equipment. I am assuming the output will be a digitized signal varying with the clock input, since It is used as oscilloscope. When working with labview how would I specify the port to read from and how would my PC recognize the port. I working on a pre-configured system and they won't let me unplug anything to check the configuration. Does NI provides a software to read into the signal fed into the channel and trigger inputs. I have tried looking into the different forum discussion but didn't find any that address my issue. May be it's too simple and stupid. But, it would be a great help if you could point out my misunderstanding.
    Thanks in advance.
    BP

    There are numerous examples. Help>Find Examples> Modular Instruments>Ni-Scope. There is a test panel available in MAX. On the Measurement I/O>NI-Scope palette, are all of the driver functions includeing the NI-Scope Express.
    I'm not quite sure I understand your references to 'port's. Once installed into the chassis, it should be listed in MAX. In the functions you will be using, there will be a dropdown menu that you will be able to select the scope resource name.

  • How to use peak detection in labview to detect peaks from data acquisition information

    Hi
    I am a university engineering student who is working in a team to develop a coin detector, its purpose is to recognize different coinage and detect fakes.
    For this we are using LabVIEW 8.5.1. I am relatively new to labview and have had no experience of using to before. We are trying to integrate four voltage signals produced by an electromagnet, straingauge, optical sensor and a proximity sensor. We have already developed signal conditioning for these tests and now wish to put them into labview.
    Our plan is to use peak detection on each of the tests so that labview can detect peaks which correspond to different coin types, provided they meet set criteria for each coin. Then to combine these either using logic or mathscript to produce a Boolean output for each coin.
    One of our advisors helped us develop a peak detection program for a simple simulated sine wave however we are struggling to adapt this for data acquisition information and itegrate it with mathscript and to be honest it does not make much sense. I have attached the program below. Thanks in advance for your assistance. 
    Attachments:
    Strain 2.vi ‏25 KB

    Chris,
    Here are several ways to help  you get started with peak detection:
    1. On your functions palette, you can search for "peak detect" and you'll find several different variations of VIs that will do peak detection.
    2. You may also want to take a look at this tutorial: Peak Detection Using LabVIEW and Measurement Studio
    3. There's an example in the example finder called "Peak detection and display" that will probably be useful. 
    Hope this helps, 
    Misha

  • LABVIEW SE DATA ACQUISITION

    I need to do data acquisition from a keithley 2000 multimeter having serial port (RS 232 interface) and also IEEE 488. Does labview student edition have the necessary software ( i guess NI-VISA etc) to do so? If so, i would like to install it.

    I just purchased the NI-VISA Development Software  part #  777300-03     and NI-VISA Deployment License   part # 777300-00 . Is that all i need for data acquisition from serial device data acquisition  ?  I downloaded the driver for  Keithley 2000 meter from IDN website. So please confirm whether i am fine or anything else is needed. Your response indicates that NI-VISA alone will do the job of serial data acquisition and therefore i am not going for labview now.
    Thanks and Regards
    poli

  • "Advance Synchronization Techniques for Data Acqusition is not simple.

    I want to use a 6534 DIO to drive my instrument and a synchronized 6502E to do AI from the instrument. The developer zone tutorial "Advanced Synchronization Techniques for Data Acquisition" suggests some of what is necessary to change from using AO as the master to using some other operation. After installing an RTSI cable, "Synchronized AI,AO,DI,DO,CTR.vi" runs as-is. Has anyone successfully converted the "Synchronized AI,AO,DI,DO,CTR.vi" or something similar to having some other master than AO? I want to use DO as master, and have moved the start vi's to the initialization cases except that for DO, have removed DI completely,and have tried to get DO to transmit REC1 on RTSI1 and AI and AO to clock o
    n the RTSI1 signal. The modified VI runs to completion, but I get no input at AI.

    Hi Bhanu,
    I ran the program SAP_FACTVIEWS_RECREATE.It is also not fetching any data.In the monitor, the extraction shows yellow status and the Processing says NO DATA.I have not given any selections at infopackage level.
    Please let me know what do i do.
    Thanks in advance.
    Regards,
    Venkat

  • Problem in data acquisition for cRIO-9076 wth c series drive interface module 9516

    I am using LabVIEW for my project i.e., the speed control (using PID) of a motor and want to create a vi for the same.
    The specifications of the products being used are as follows:
    1) Motor: AKM24F (dc motor)
    2) CompactRIO: cRIO-9076
    3) C Series Servo Drive Interface: NI-9516
    I am facing problem regarding the real time interface between the motor and PID block in labVIEW i.e. in the data acquisition part to be specific. Please suggest a way in which I can successfully acquire the analog data(speed) from the motor and vice versa in the vi.

    What is the priority of the VI you're running?  I'd be concerned that maybe you've starved out the ethernet transmit thread or something.
    -Danny

Maybe you are looking for