From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-11-2008 05:37 PM
Hi,
A 9000x64 point array of doubles is going to be about 4.6 megabytes. Anytime LabVIEW has to make a copy of that much data, you'll have big performance hit. Also, to view a dataset with 9000 samples, your graph would need to be 9000 pixels wide. Unless you have a monitor that big, the normal way of viewing such a large data set is to decimate the data. There are VIs to do that under the waveform palette.
The From DDT is used only to convert the dynamic data type to something else, usually to a waveform. I'm not sure if the normal conversion VIs can do that with dynamic data.
What trouble are you having reading the counters? You can sample those at the same rate as your analog inputs. The only real requirement is that your input signal must be TTL (0 to 5v logic).
A continuous acquisition can be stopped after retrieving at certain number of data sets. The advantage to the continuous acquisition is that the sample clock does not stop between reading chunks of data. If you use the finite acquisition in a loop, then when you put your individual chunks together you will have gaps in time because the sampling stops after the last sample is acquired, and doesn't restart until your loop completes its processing. That may be acceptable for your application, but I just want you to be aware that a finite acquisition in a loop is not the same as doing a continous acquisition.
11-11-2008 10:52 PM
11-11-2008 10:52 PM
11-11-2008 10:53 PM
11-12-2008 12:50 AM
Hi Scrx,
I had a look at your code and notion that you build the XY graph with data from two different acquisition tasks. (daq assistant 3 and daq assistant 4).
These data sets are not simultanious measureed over time!
Besides that your code could be a lot more readible if you right click on the feedback terminals and select 'Change Direction' this will not change the program, only the graphical representation and will reduce crossing wires (sorry this is an 8.5 feature, but with wire moving you should get the same result in 7.1).
Again if you have performance issues ditch the express VIs they are not optimized code!
Ton
11-12-2008 01:23 AM
11-12-2008 01:54 AM
Forget Express VIs.
Have a look at the shipped DAQ examples for counters.
Ton
11-12-2008 12:55 PM
Hi,
I completely missed that you are creating a circular graph, that makes a lot more sense with the 9000 points. However, the fact remains that manipulating such large arrays is going to have performance consequences.
As for the counter, the reason you don't get precise samples is because you use an on demand sample timed by your while loop. The counter is free running, so the discreprancies you are seeing are related to when you are sampling the count value, not the actual count rate of the counter itself. In the case of your VI, your loop timing is controlled by the acquisition time of your finite task, and then on top of that all of the processing that occurs in the loop. Since data keeps getting added to the XY graph, the amount of data being dealt with in the loop continually increases, which causes the loop to take more time to execute. Additionally, loop timing is notoriously bad on Windows based systems. This is not the fault of Windows, it is not designed to run loops at a precise enough rate for data acquisition (real time operating systems address this problem). Even if you had an empty loop, it would not execute at a consistent interval.
Here are my recommendations:
1) Don't use the DAQ Assistant, use the DAQmx API instead. The API gives you a lot more visibility and flexibility in configuring DAQ tasks. Also, with more complicated applications, the DAQ Assistant tends to start having problems.
2) Use continuous sampling task to sample the counters, with the sample clock set to the analog input sample clock. This will guarantee the timing of the counter sampling in hardware.
3) Use continuous sampling for your analog input. You'll need it set that way for the continuous counter sampling to work since it will need a continous analog sample clock, and it will also give contiguous sets of data. Generally, if you need to acquire data in a loop, you should always use continuous. Finite is normally used for one shot acquisitions of a fixed duration.
4) You need to somehow cap the amount of data you are working with. Usually when you have a wire branch, LabVIEW has to make a copy of the data in the wire. This is normal dataflow behavior and allows parallel processing of data, but the price you pay is that you need a unique set of data for each action which is occurring in parallel. There are several instances of this in your VI, and I would not be surpised if that array is being copied at least 4 to 5 times.
11-17-2008 04:51 AM