02-17-2010 01:30 PM
I am a new user and am confounded by the signal provided by simulated devices in MAX and cannot seem to find an answer anywhere. I am using Labview 8.2, MAX 4.2, DAQmx 8.5, cDAQ-9172 and the DAQ Assistant simulating a 9215 card. I understand that the simulation is a noisy sine wave, but what is the frequency of that wave? It seems that you can change it with the timing settings in the Assistant Configuration panel.
It would seem to me that the timing settings would relate to the way the 9215 samples the incoming signal, right? Instead it seems like those timing settings change the frequency of the signal itself. For example, in the DAQ assistant if I run the a test plot acquiring N samples and read 1000 samples at 1k Hz, I see one cycle of a noisy sine wave that takes 1 sec. If I read 100 samples at 1k Hz, I see one cycle of a noisy sine wave (with less resolution) that takes 100 ms. Doesn't this mean my signal frequency has increased 10 fold? I would have expected to see only a portion of a sine wave if the original frequency had stayed the same.
Also, when I run using continuous sample acquisition mode it seems like the time it takes to go from peak to peak is different again. Here it doesn't seem to make any difference in what the sample size is, but rather what the sample rate is. At 1k Hz it take about 10 secs and at 2k Hz it takes about 5 secs.
Please realize that as a newbie I am not far enough along to completely dissect the DAQ assistant VI to find out what is going on, although that will be next. So, I would appreciate any simple explanations as to why I am seeing what I am.
Solved! Go to Solution.
02-18-2010 12:42 PM - edited 02-18-2010 12:44 PM
Hi pfrank,
It's not documented, but the period of the simulated sine wave (measured in samples) appears to equal the task's input buffer size, at least for buffered tasks. The input buffer size is based on various factors (finite/continuous, samples per channel, sample rate). These are explained in the NI-DAQmx Help file that is installed on the Start Menu under National Instruments\NI-DAQ. Search for "How Is Buffer Size Determined?" (without the question mark)
Selecting N Samples causes the DAQ Assistant to set the sample mode to finite, so the buffer size is exactly equal to the samples per channel. If you select Continuous Samples instead, then the buffer size will be set to 10 kS because the sample rate is between 100 S/s and 10 kS/s, and the sine wave's period will be 10000 samples. If this doesn't make any sense, look at "How Is Buffer Size Determined?" in the NI-DAQmx Help.
DAQmx does not support providing your own simulated data for simulated devices. If you want control over the simulated signals, you'll need to add code to your application that replaces the data returned from DAQmx.
Brad
02-24-2010 10:32 AM
Hi, Brad.
It took me a while, but I finally figured it out thanks to your help. The sine wave period (in samples) is equal to the buffer size.
If the acquisition is finite (N Samples in DAQ Assistant), the buffer (and sine wave period in samples) is equal to the samples per channel. The time period of that sine wave would thus be the number of samples (buffer size) times the period between each sample (which is also the inverse of the sampling rate). To simplify (and using DAQ Assistant terms), the time period of this sine wave is (Samples to Read) / (Rate).
If the acquisition is Continuous, the buffer (and sine wave period in samples) is determined by a table (found per your suggestion in NI DAQmx help). The time period of that sine wave is the number of samples (buffer size from the table) times the period between each sample. This is the same as above which is (Samples to Read) / (Rate), although remember in this case the number of samples is determined by the table and not by your Samples to Read input.
The display of these waves in DAQ Assistant differ depending on whether you have selected N Samples or Continuous. For N Samples, you see one complete cycle of the sine wave and associated time period. For Continuous, you see a scrolling display with the display time period equal to what it takes your Rate to read your Samples to Read, or (Samples to Read) / (Rate).
Perhaps in the grand scheme of things all this doesn't make much difference, but it was bugging the heck out of me until now. Thanks, Brad!
pfrank
02-19-2014 09:04 PM
Thanks for posting Brad.
Finally we know how the simulated sine wave behaves!,
Do you have any idea why this idea is not documented?
Please keep using the forum
Erwin Franz
Erlab
03-17-2014 03:52 PM
Hi Erwin and forum users... I have read your post and i have a not asked question but i really want to ask. Due to similar topic about DAQ simulated signals: Is possible to measure from simulated DAQ module (e.g. 9203) two or more signals at same time?, i mean i tried to read ai0 and ai1 from the same module but i get the error:
Error -50103 occurred at DAQmx Start Task.vi:6
Possible reason(s):
NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
Task Name: _unnamedTask<39>
If that is normal for simulated signals from DAQ assistant i have no problem, the issue is if that problem would be present when i get the physical module to really get different signals and read it at same time. I hope you help me.
03-17-2014 04:01 PM
03-17-2014 04:14 PM
Thanks Dennis, I had a feeling you were going to answer that one.
Erwin: the exact behavior of the DAQmx simulated analog input signal is not documented because it's an implementation detail. If you want simulated data to behave in a certain way, you should add code to your application that replaces the data returned from DAQmx.
Brad
03-17-2014 04:50 PM
Thanks... There is one thing i don´t understand, how use i a single DAQ assistant to read multiple channels?? I can´t get the single task matter...
03-17-2014 05:26 PM
03-17-2014 05:47 PM
Ok, that was easy... And finally how i can read multiple cannels or change one for another according a case structure or similar?? I need to change the channel when user choose monitor some other variable... Thanks for your patience...