Slow loop with DAQmx read

Hello,
I am trying to read 8 channels at once using the NI9213 and DAQmx (see image attached). With this setup, the loop takes ~500ms each iteration. What can I do to improve this?
Thanks,
JP
Solved!
Go to Solution.
Attachments:
slowloop.PNG ‏21 KB
tim.vi ‏20 KB

You have not coded any timing so it's running at default speeds.  Look at the DAQmx examples like Thermocouple - Continuous Input.vi.  Your module even has a high speed mode you can use for really fast acquisition.  Read the manual.
BTW, NOT connecting your error wires WILL byte you in the butt eventually.  Always connect them so you can monitor errors while debugging.
Using LabVIEW: 7.1.1, 8.5.1 & 2013

Similar Messages

  • Replace AI read.vi with DAQmx read.vi

    Hi,
    I'm trying to replace AI read.vi with DAQmx Read.vi. The old VI, "AI read.vi", is returning two data: 'scaled data' and 'binary data'. However, the new DAQmx read.VI has only one output. Can anyone tell me how to get both data in new DAQmx read.vi?
    Thank you for your support.
    Best,
    Jay  
    Attachments:
    POT9.230.VI ‏252 KB

    duplicate thread
    Stick to your original!

  • Error 200278 and error 200279 with DAQmx read

    Good day everyone,
    I have been trying to write a code which generates a sine wave and a trigger signal and send them out to two different devices. I am trying to phase lock device-1 on a certain phase angle of the operating signal  (sine wave) of the device-2.
    The device-1 which receives the trigger signal also generates a trigger signal at the same time it receives the trigger. It also can not work with trigger signal with a frequency which is greater than 4 Hz.
    I got that part to work and then I realized that I need to make sure that the responses of the devices have the same phase difference. So I added another part to the code which reads the trigger signal generated from the device-1 and the sine wave generated by the code (which basically goes to the device-2).
    I did not have any loop in the code at the beginning, and I just set the sampling frequency and sample rate and I though that it would work at the rate which I want. Unfortunately it did not. So I added a while loop to control the speed of the writing and reading process, and slow it down to 4Hz which is the limit of device-1.
    I have tried the reading process with finite sample and continuous sample on the sample clock and I got Error 200278 and Error 200279 correspondingly. Attached please see the main VI and subVIs. There are some subVis for writing data to the file which are not attached.
    I really appreciate it if you can help me to solve this problem and get the code to work in a way that the whole process works at 4 Hz frequency.
    I am not sure if my code is completely optimized. Any suggestion to optimize the speed of the code and the way it acquires data is also highly appreciated.
    Regards,
    Pooya
    Attachments:
    Trigger_Seq_R1.vi ‏115 KB
    time.vi ‏23 KB
    wavegen.vi ‏33 KB

    Hello Pooya,
    You need to add some wait delay in your while loop. Try adding a Wait Until Next Millisecond Multiple to your while loop with a constant wired in.
    You are acquiring data too quickly. Here is a link that discusses this in general.
    Regards,
    Jeff L.
    Applications Engineer | National Instruments

  • Simultaneous save of a fast loop and a slow loop with multiple mx inputs.

    I am attaching my app in hopes that someone might help me. In the app I have two loops. One takes in data from 2 inputs (temp and voltage and I would like to add one more voltage on another channel), the other runs very slowly through the comm port to a mass spectrometer. I can not find a way to graph all the data in one simple file and just as annoyingly is the lame attempt to read temperature in both loops. This method ensures that my Mass spec slow loop data will have its own temperature readings but it errors sometimes do to the way I have the MX input. I tried doing all the saving using queues but the slower mass spec loop was not offering up data quickly enough causing the dequeue loop to wait for data and then the upper quick loop queue to pile up. So i have two issues/options -#1 figure out how to save data from both loops to a single file, and fix the temp inputs so they wont crash each other. Or #2 use the queue method but not have to wait for data from the lower slow loop. Any ideas? Really what I am trying to do is not complicated, the slow acq rate of the ms kinda ruins things. It spits out data whenever it feels.
    THanks
    Attachments:
    TPDS1.vi ‏697 KB

    Hello Tim,
    A producer-Consumer solution using queues should solve your problem. I have attached below a starter for what I am refering to. There are two producer loops, each of wich will enqueue the data and a tag for the data. The data and tag are clusterred so that you can check the tag whenever you dequeue the data.
    In the consumer loop, you can check the tag every time that you dequeue an element and act according to the tag. You can even dequeue directly to file and save both the data and the tag, that way when you read the file, you can check the tag and act accordingly.
    Hope it helps.
    Attachments:
    Acquisition.zip ‏36 KB

  • Slow Printing with Adobe Reader 8.1.2 on Terminal Service

    When I want to print something on a Terminal Server without admin rights its very slow, when I print with admin rights its fast. Can someone told me where is the problem with the rights?
    Thanks

    It could be that the Printer Setting has been set to ensure that the Duplex Printing would no longer be applied and its overriding the Printer Dialog settings.
    You could check the Printer setting to ensure that duplex printing is enabled.

  • Compare two DAQmx Read modes

    For a continuous DAQmx acquisition, generally a start VI is put before a loop structure to request DAQ board to begin  continuously  reading data into buffer,  and  within loop  a DAQmx read VI is used to  continuously  retrieve data from buffer.
    My question is, for the DAQmx Read VI, is there any performance difference between  'Nchanel N Samples'  and 'NChannel  1 Sample'?  My understanding is, the former  read all data  available in  buffer,  so maybe we can use larger value for  waiting until ***ms function, and for the latter, since only one data is read in each loop, we need to use smaller waiting value, to catch up with the board acquisition speed, therefore meaning the loop structure need to be executed much faster.
    For my application, read only one data in each loop is easier for teatment, but I am concerning whether more frequent loop execution may cause decrease of performance. Any suggestion?
    Thanks.
    -Dejun

    I don't agree with you, Dennis, but maybe I am wrong
    Even though I use '1Sample' within a loop, there is still a hardware timing Vi before the loop, so the timestamp of each data point should still be determined from hardware timing, this is my understanding. The difference between '1Sample' and 'NSample' is just how many data are read from buffer in each loop execution. As to the timestamps of data in the buffer, they are already determined by the hardware timing, and therefore should be independent of how they are read in loop structure (1Sample or NSample).
    Message Edited by Dejun on 08-30-2007 05:16 PM

  • Is DAQmx Read limited to 9 digital channels?

    I'm trying to read multiple digital channels with DAQmx Read (Digital 1D Wfm NChan NSamp). The output the DAQmx Read vi is a 1D array of digital waveforms. If I put that output through Array to Cluster the resulting cluster seems to be limited to 9 elements, data[0] through data[8]. Is the DAQmx Read output limited to 9 digital waveforms? I'm using Labview 2009.
    Solved!
    Go to Solution.

    Converting an array to a cluster to use unbundle to break out the elements of the array is a hack.
    You should be using Index Array to get the elements.  You can resize that function so that you can have additional outputs.  You won't even have to wire up any constants for the indices usually.  The top element will be element 0, the next element 1, element 2, and so on down to the bottom of the function.

  • Slow loop times with 6024E and LV2009

    Hello all,
    I have searched the forums back and forth, in addtion to the knowledge base, but I am still confused as to the slow loop times I am experiencing.  I have a 6024e PCMCIA DAQ card with a very simple VI created in LV 2009.  I am using the DAQ Assistant to collect 1 thermocouple channel on a SCXI Chassis 32 channel thermocouple module.
    The problem is that the loop times in labview is about 3 seconds.  The DAQ Assistant acquisition mode is set to "on demand".  The target sample rate is about 1 to 2 samples per second.  I have read in previous posts that the repeated creation of the task using the DAQ Assistant with the acquisition mode set to "on-demand" can slow things down.
    What really has me confused is that using this exact same method of setting the DAQ Assistant acquisition mode to "on-demand" has worked fine on the same hardware when using one of the earlier v8 versions of LabView.  I don't understand what has changed and why the loop times are so much slower.  I planned to pull the newest LV2009 off the computer and put a previous v8 version on just to confirm my observations.  In addition, I pulled up a copy of the VI that was written in one of the v8.x versions and it used the DAQ Assitants with the acquisition mode set to "on-demand" and had a loop time of 0.100 seconds.
    Any help would be appreciated.  I have been working on this all day today with no sucess.
    Thanks in advance,
    Steve

    H_baker,
    I did have the patch applied at the time I was experiencing the problems.  The DAQmx driver version was the version that was supplied on the DVD that we received for LV2009.  I believe the actual version number was something like 8.9.5.
    The loop time was determined as follows:
    A simple vi I was written in a while loop.  The data acquisition was conducted using the DAQ assistant sampling 1 channel on the SCXI thermocouple module in a SCXI 1000 chassis.  Inside the loop of the vi the getdatetime function was placed and wired to an indicator on the screen.  The vi was then ran.  Observation showed that the loop time was typically 3 seconds and sometimes 6 seconds by keeping track of the datetime indicator on the front panel.
    The problem appears to be resolved now.  I had pulled off the LV2009 installation and put back on the 8.6 installation.  Recreated the vi and everything worked fine. As a sanity check I went ahead and reinstalled LV2009.  Recreated the vi again and everything works fine now.  The only real difference between the two installations is that I am using the latest NIDAQmx drives (I believe version 9.0.5).  It could have been just some sort of transient issue that resolved itself either by reinstallation or by rebooting.   Not sure.  I was just initially very concerned given that another posting had mentioned loop times of 3 seconds just like I was experiencing.
    Thanks,
    Steve

  • Can read TEDS in MAX but not with DAQmx VIs

    Hi,
    I have a cdaq 9181 with a 9234 accelerometer module.  I have 3 teds equipped accelerometers connected to ai0, ai1, and ai2 repectively.  In MAX, when I reserve the chassis I can read all three teds, no errors.  When I do the same thing in labview (ie reserve the chassis, create a daqmx task, associate teds data with each physical channel, all with daqmx VIs) I can only read two out of three teds.  The third one throws a "no teds sensor detected" error.  This code has been in use for about four months now, though I just rewrote the calling VIs, and hasn't displayed this problem.  I've attached a snippet of the task building VI for reference.
    Any ideas what's going on?
    Thanks.
    Using LV2012 and MAX 5.3.1 running on Windows 7 32 bit.
    CLAD
    Attachments:
    Build Daq Task Snippet.png ‏58 KB

    Nope.  That's a delete from array, length 1, index 3.
    In any case, I eliminated that block since the string array wired to the for loop controls how many devices the VI attempts to configure.  Same result, verified it was trying to configure ai2.  Here's the updated snippet:
    CLAD
    Attachments:
    Build Daq Task Snippet v2.png ‏54 KB

  • Is there any way to read 2 tasks at once (with DAQmx)

    Ok, I don't belive there is... but that is a problem I want to solve.
    I use about 10 sensors of the same kind, but I only have 2 signal amplifiers. So I have the possibility to read from 2 channels. (Ok, I could create a task that reads from 2 channels)
    I need to read from the 2 channels, but I change the sensors often so I would have to create a task for every possible combination of sensors, and I cannot do that (because the sensors should be calibrated separately in MAX).
    I tried to use two DAQmx in a flat sequence structure with 2 instances, but it didn't work... as you probably know.
    How to do?
    EDIT:
    Maybe there is a way to combine two tasks into one before connecting it to DAQmx-read?
    Message Edited by Johan.svensson on 09-13-2006 01:20 AM
    Message Edited by Johan.svensson on 09-13-2006 01:20 AM

    See here

  • Win 7 slow boot - login in with fingerprint reader

    Hi
    I have a T400s (2.4 GHz and 4 GB) with an Intel SSD and WIn 7 RTM with latest Lenovo beta drivers.
    I have the fingerprint reader activated for login and my boot time of 35 seconds is now split about half in the fingerprint login and half in the rest of the boot process.
    Or described in another way if the machine is powered off and I swipe my finger to start the machine it takes about 17 seconds before the login prompt (the finger) is shown.
    Then the machine shows "waiting" for 15-20 second during which my personal login icon flashes by before it completes the login and almost immediately shows the desktop.
    I am surprised by the very slow login with my finger already swiped. It would be much faster to disable the fingerprint reader and log in using a password. Anyone encountered this problem and knows how to fix it?
    Other problems with the boot I have found (and solved) is the use of a solid color as the Windows background which for some reason costs about 15 second in boot time!!? I also had to reflash the firmware of my SSD to gain an additional 10 seconds at the start of the boot process.
    Mats
    Thinkpad T400s, X61s, X41, 600

    Hi Mats,
    I have a similar, if not, the same complaint. I have a T500 running Win 7, which was just upgraded from NT.
    My complaint - and it goes under the topic of usabiltiy - is that it takes anywhere from a couple of seconds up to 20 seconds before a valid fingerprint scan is accepted. If it's a scan doesn't match, there's immediate feedback of an error. I wouldn't mind the delay so much if the was some immediate feedback. If I click the "other credentials" button, I can see that the machine is "validating".  If I enter my password, boom, I'm immediately logged in.
    This is annoying.  Under NT, there was not such problem.  Your post is from 1 1/2 years ago. It's surprising that no one else is complaining about this. I guess most just say "forget it - I'm just using my password." But I know the process works and works nicely.  (I've run the ThinkVantage System Update as recently as Feb '11. So, the drivers are current.)
    Hey, anyone from Lenovo listening?!!
    Regards, Ed

  • Unable to open files associated with Adobe Reader - program goes into a loop

    i am unable to open any file associated with adobe reader or adobe pro.  when i double-click the file, adobe reader opens up but it goes into a loop. 
    adobe reader opens, then a progress window opens, as if the file will open but adobe closes and opens again and the same cycle repeats itself until i manually close the program.
    any advice?
    update:
    i can open regular .PDF files when i double-click the icon and i can also open .PDF files when i open adobe reader first and then choose open file.  it's just the .FDF files that are the problem (so far).
    the file in question happens to be an .FDF extension, which is an internet generated form. i attached a screen shot of the screen that pops up, goes away, and pops up again that creates the loop.
    the white out section is the server name where the file was saved to.  but i also get the same symptoms when i am in internet explorer, hit the generate form button.

    hey ankit,
    sorry i didn't see a notification that you replied to this discussion.
    "1. Generate a new PDF and a FDF file. Try opening the same and see if it behaves the same way."
    yes, it does behave the same way, it's just a continuous loop until i have to kill the process.
    "2. Check if you have access to the PDF that is being used by the particular FDF."
    by this do you mean the correct permissions?  if that is what you mean, then yes, the permissions are set correctly.
    "3. If possible, please send me the FDF and the associated PDF that is behaving in this way on your system."
    i really wish i could but the information in the form is sensitive and cannot be sent. 
    as an update though, i reimaged the customer's workstation, installed Adobe Reader 10.1.1 and it worked perfectly (finally).  HOWEVER, after about two weeks the same symptoms returned! 

  • Why is the DAQmx Read VI so slow?

    Hello everybody.
    I'm using Labview 8.5.1. and NI DAQmx 8.6 and I'm wondering what the DAQmx Read VI is actually doing.
    What I want to measure is a 1kHz signal. To do this, I'm using a VI similar to the attached one (a pulsed 1kHz signal serves as trigger and as sample clock).
    The time the DAQmx Read VI needs to perform is 250ms longer than the acquisition time you would expect (e.g. instead 100ms to measure 100 samples at 1kHz the time is usually around 350ms, for 1000 samples it is ~1250 ms). The time does not depend on the number of channels in the task.
    So my question is what actually happens when the DAQmx Read VI is called. What I would like it to do is: Wait for the next trigger signal, then acquire the specified number of samples, then read the samples from the buffers and return them. Is there any way to force this behaviour?
    Thanks a lot for your answers, I highly appreciate any help!
    Solved!
    Go to Solution.
    Attachments:
    daqmxAcquisitionTime.PNG ‏20 KB

    Rene,
    For your application and hardware, you should be using DAQmx Control Task.vi to commit your task before your while loop.  Inside the loop, then you'd start/read/stop the task.  DAQmx uses a state machine to control task configuration and run time.  As written, when you cal DAQmx Read, DAQmx will see that you have a task which has never been configured.  As such, it will look at all the settings you make on the task, verify their correctness, reserve all resources necessary, write the configuration to hardware, then start your task.  Once the data specified has been read, it will unwind this state machine to put the task back in an unconfigured state.  As such, every time you call Read, DAQmx if going through all of it's state transitions.  If you were to commit your task before the loop, DAQmx would not re-verify your settings or need to re-program hardware each time through your loop.  That being said, there will still be some addition time each iteration of the loop where you will need to stop and restart your task, and during this time you could miss a trigger.
    If it is truly not acceptable for you to miss a trigger, you might consider moving to a design in which you continuously read data, and then use software triggering to  keep track of the relevant sections of data.  One other alternative would be to look at the X Series line of DAQ devices, as these devices support retriggering in hardware (ie... They can retrigger without you needing to stop and restart your task).
    Hope that helps,
    Dan

  • Error -200429 DAQmx read (counter u32 1ch 1samp).vi -append- Edge count in for loop

    I am receiving error -200429 DAQmx read (counter u32 1ch 1 samp).vi <append>. This is occuring on the second loop of a for loop.
    I have a sequence inside the for loop that is using four DAQmx assistant vi's for edge count at various times in the sequence. All four of these count fine the first time through but at the beginning of the second loop the first edge count receives this error and does not count.
    Any ideas?

    The code you have supplied is similar to the converted subvi but this code will give an empty task error on the DAQmx Create Channel vi.
    Notice on the Daqmx create task vi that there is nothing wired to the "Task to copy" or the "Global virtual channels" connectors - I believe this is why the task is empty when sent to the Daqmx create channel vi.
    The code we are currently using is a modification of a previous code used before a recent upgrade. It may be better in your/NI eyes to re-write this into a State machine but time constraints and resources do not allow that at this time - All other parts of the current program work except for the counter on the second iteration. Would rather not reinvent the wheel at this point. 
    If the task is being cleared was the issue then the other three should also not execute. The issue appears to be the "First Call"
    I have attached a zip file of the complete program as it is now written to give you a better idea of the whole picture.
    Attachments:
    Test Machine current code.zip ‏657 KB

  • Reading Data from a Queue - Store in Fast Loop, Display in Slow Loop

    Here's my BD below.  I am queueing data in a faster loop (either 100 ms or 50 ms) and sending that data to a 250 ms loop.  I need to be able to display the data in the slower loop (so that the FP doesn't have to update every 50 ms).
    Problem I'm having:  How do I empty the data?  It builds and builds and eventually I'm looking at a chart that has data that's 1 minute old.  I've tried writing my own flush code (attached).  I've tried to use variables to pass data and use an array to parse...not working.  Any help would be appreciated.
    Nathan - Certified LabVIEW Developer
    Solved!
    Go to Solution.
    Attachments:
    FlushQueuebyNathan.vi ‏21 KB

    If you need all of the data to go into the chart, I would use the flush queue and write to the chart in a FOR loop (autoindexing with the elements array from the flush queue).  You may set the Defer Front Panel Updates before the FOR loop and reset it after, but I'm not sure that will buy you that much.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for