Jump to content
Gan Uesli Starling

cDAQ Command-Query & Reply Update Speed

Recommended Posts

I have a LabVIEW program, which when operating with simulated input data is blazing fast during mock-up. As soon as I hooked into a real cDAQ on Windows, however, the update speed fell off to 4 seconds. That's awful slow. I don't really have a whole lot of channels. I have read tasks for Volts of maybe 5 channels, write tasks for both On./Off for maybe 10 channels (simultaneous) and write tasks for 4-20mA of only 5 channels. How may I improve on that? Is it maybe a priority issue in Windows or to do with USB? What? How to improve? Thanks in advance.

Share this post

Link to post
Share on other sites

I'd be curious to see how your tasks are created and the type that they are.  Are you starting and stopping tasks all the time?  I'd suggest setting them up to be continuous, and then just read the values that essentially are in the buffer, then close when you need to modify the task or the application is done.

I think you're going to have to do some debugging and figure out where the extra slow downs are occurring, and maybe write some test code to test the performance of doing the same thing, different ways.  I've not seen a the type of slow down you describe, and it sounds pretty extreme.  Oh are you connected to any USB hub?  If this is a desktop try the USB ports on the back of the computer instead of the ones on the front.  Any other computers you can test with?

Share this post

Link to post
Share on other sites

Yes, I am starting and stopping the tasks every time on each iteration of the loop. Such is the examples in the books I have seen. So I've always just done that.

Should I instead start them outside the loop, then carry them through round-and-round, stopping only outside the loop? Not really sure what that would look like.

Share this post

Link to post
Share on other sites

Glad you figured it out.  The Open, Operate, Close paradigm (with operate taking place in a loop) is pretty common in LabVIEW and is often see for File I/O, VISA, and other hardware stuff.  I'm guessing with simulated hardware an Open and a Close just takes much less time than communicating with actual hardware.  There are times when open and close can take place in the loop, but it is generally useful when you only call the operate once in a great while, allowing for the hardware to be used for some other task.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Manudelavega
      Hi, I have contacted NI sales services but it's a great frustration as usual, so I will try to get some support here
      Basically for a project I need 2 CAN ports and I decided to go with XNET and Compact DAQ. I have 2 solutions I try to choose from:
      Solution 1 --> One 4-slot chassis with 2 NI-9862 modules (one port per module)
      Solution 2 --> One 1-slot chassis with 1 NI-9860 module (this module has 2 ports)
      I am confident that solution 1 will work well since I already had a project in the past with one 4-slot chassis (cDAQ-9174) and one NI-9862 module. But going with solution 2 will allow me to cut cost significantly. I just want to make sure it will be absolutely seamless and transparent for the software. Does anybody have experience with the NI-9860? Can it be considered as the equivalent of 2x NI-9862 as far as the software is concerned (LabVIEW driver) or does it remove some performance/flexibility/other?
    • By volatile
      Lets pretend I wanted to simulate a solar panel using a cDAQ, a programmable power supply and a light sensor. Id have to measure the voltage from the light sensor and the PSUs current, use those values to find the respective operating point on my light/voltage/current-curve and update the PSUs settings. Lets also say I wanted to do this for multiple systems in parallel, all connected to 1 analog input and 1 analog output module in 1 cDAQ.
      What would be the best way to achieve the quickest response time? Simply reading and writing single samples seams to be pretty slow (though I can encapsulate everything neatly this way).
      Is there a better way?
    • By FJ_Sanchez
      I've been struggling with this problem for months now... I want to use a cDAQ9171+NI-9234 with an Advantech PC (AIMB-580). I have 3 computers like this and all with the same problem. I plug the USB cDAQ-9171, Windows detect the device and loads the proper driver (cDAQ-9171), it is displayed in MAX but self-test or reset always fails with error. At the same time, NI Devive Loader service hangs up. If I try to restart or stop this service it cannot complete the operation, the only way to finish this operation is to unplug the usb cable from the PC, then the service restarts correctly. Additionally the windows' event logger shows the next error message:
      In one PC I re-installed Windows, installed DAQmx 14 and the problem was still there, this is with a Windows fresh-install... After this, I removed DAQmx 14 and installed DAQmx 9.8 (supplied in CD) and the it worked!!! I upgraded to DAQmx 9.9 and it was still working, so I stoped there as it was all I needed (9.8 has some bugs with NI-9234 that 9.9 solves).
      One thing to note, when it works, Windows first install cDAQ-9171 driver, but then inmediatly it changes to USB flash firmware updater, after this it returns again to load cDAQ-9171 and detects the NI-9134. When it don't work it only installs the cDAQ-9171 and doesn't load anything more...
      I tried in a second PC to repeat the process, but I have been not able to repeat the success, only the fail... I get the same error every time I plug the USB and I have not idea of what else try... I have disabled UAC, cleared the MAX data, reinstall windows 2 times, tried with DAQmx 9.8, 9.9 and 14. Forced USB flash firmware updater as Windows driver, changed BIOS settings (disable hyper-threading, VT extensions, USB legacy, etc.). I am almost sure that it is some kind of weird incompatibility or similar, the thing is that NI device loader always hangs-up. In the next days I'm going to try to copy the same exact configuration of BIOS from the working PC, just to be sure.
      Any recommendation?
    • By rifenbug
      I am designing a new project and I need to know if I can get away with purchasing 2 9181 chassis instead of one 9188 chassis.  I will be using a 9213 for thermocouple readings and a 9208 for 4-20mA current readings.  The signals dont nee to be syncronized and will only have to read once a minute or so.  My question is whether or not I can read the signals from both chassis at the same time through MAX and easily imput into a LabVIEW program.  


      I am currently using a single 9188 to accomplish the same tasks at a different location but am trying to cut costs on the next project.  The 9184 is not an option due to the software version I am running. 

    • By Thang Nguyen
      I am working on a project with requirement of measuring current. The system includes both the AC current transducer CR4211-15 (Input 0/15AAC, Output 0/10VDC) and a Fluke i5S (Input 0.01/5AAC, Output 400mV/A).
      I use cDAQ9184 with NI-9205. I tested with a light and using MAX to monitor the signal but the signal really noise from the AC transducer and clamp. 
      Please take a look at the pics I attached which is the screenshot from MAX.
      I hope anyone with exp can give me a help.
      Thank you!
      Thang Nguyen

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.