Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

CLAD Hardware Section Q3

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

timmy
0 Kudos
Message 1 of 6
(3,802 Views)

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 6
(3,740 Views)

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

timmy
0 Kudos
Message 3 of 6
(3,735 Views)

Take a close look at this tunnel.

Capture.PNG

 

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

 

Spoiler
500  +/- 2 (accounting for quantization errors and floating point math artifacts)

 

 

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?


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 6
(3,731 Views)

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

timmy
Download All
0 Kudos
Message 5 of 6
(3,709 Views)

Hi,

I tried to reproduce the block diagram ( A and D) and find out that both causes a buffer underflow!

am I missing something?

 

Download All
0 Kudos
Message 6 of 6
(3,604 Views)