12-31-2017 05:44 PM
I have two questions regarding DAQ setup and sample question.
1.In sample paper, hardware section question 3. I can understand that in option A values 5> and <-5 are coerced and replaced to 5 or -5 respectively otherwise passed unchanged to daq write. In option B values 5> and <-5 are replaced with zero and rest passed unchanged to daq. In C simply make the value half and in option D its opposite then the rest and will pass any value 5> and <-5. If I am wrong please correct me about any of these perceptions.
Now the question is which one will cause a buffer underrun error. The answer is D but I don't know why, if any one can explain.
2.I am trying to copy the code but I am getting error that physical channel does not exist on this device. Although its configured in virtual daq setup. You can see it in MAX. Attached is the screen shot of error and above question.
Thanks
01-02-2018 08:19 AM
I will guide you towards the why. A buffer underflow error occurs when there are fewer samples to write that time to write them. (Basically you tried to update to a value that hasn't been written yet.) Keep thinking about what is different with Distractor D
Your code is looking for AI0 That is Analog INPUT Channel 0 on a Voltage Output Device.
You have a typo
01-02-2018 03:11 PM
Hey Jeff,
In option D all I can understand is that it's writing values 6,7,8,9,10 and -6,-7,-8,-9,-10.
I still don't get it how this reads values faster than it writes.
You are right it was a typo mistake but now I am getting another error that "generation cannot be started because the output buffer is empty". You can see the error in attached image files (error code 200462).
Thanks
01-02-2018 04:58 PM - edited 01-02-2018 05:03 PM
Take a close look at this tunnel.
Given the AI voltage task will simulate 1 second sine wave with 1000 points per second exactly 1 cycle with a p-p amplitude of -10 to +10 V:
What is the approximate size of the array out of this tunnel on each iteration
Your error is because you start the generation task before the loop and have never written anything to the output buffer. Look up "Autostart" in the DAQmx Help file. You have not correctly duplicated the code prior to the loop.
There is also a great DAQmx series in the badging piolot program but I don't have a link on hand. /\/\/\ Anyone?
01-03-2018 07:14 PM
Hi Jeff,
After getting rid of the error 200462 by using DAQmx write timing property and setting sample per channel. Now it's generating error 200278 for all of the choices. It looks like that because of the while loop DAQmx read and write function starts again and keep looking for the samples but we had already set the buffer for 1000 samples. So DAQmx read generates error. Then I used a DAQmx read property with available samples per channel. On first run it gives 1000 out as available samples (everything ok) and after that it gives 0 as available sample on every run so DAQmx read vi starts giving error. Is there anything I am missing.
I have seen the NI badging pilot program its good.
Thanks
02-02-2018 07:47 AM
Hi,
I tried to reproduce the block diagram ( A and D) and find out that both causes a buffer underflow!
am I missing something?