06-17-2013 07:44 AM
I have aattched the Vi in which I am giving a ramp function to a laser diode and getting the data from 2 photodiodes. But I get the error 200457 and then it shows the error at add.vi that waveforms have different dt values but I am giving the same sampling frequency(500000) and number of samples(1000) for both the waveforms. How can I resolve this error.
Also I am running this vi for 500 iterations so based on fs of 500000 and no. of samples of 1000 I get the total time scan of 1s. But when I give run.vi and stop.vi inside the for loop total time scan increases to 3s. What is the reason for that ?
06-17-2013 10:49 AM - edited 06-17-2013 10:56 AM
One difference between you two tasks for reading data I've noticed is that one DAQmx read is set at 1Chan NSamp mode, while the other is set at 1D Wfm NChan NSamp. Is it for some reason neccessary that these be different? My guess is that these differences is what's causing the error when you try to add them.
In reference to the second part of your question, your loop slows down when you add more things to be done within it, as the loop cannot re-iterate until all tasks inside are done. So adding another vi or anything, even a something like a math function within the loop will cause the loop to run slower. But a side note--why are you using the start.vi--is it neccessary for your program? And why do you have the start.vi (whether neccessary for your particular program or not) for one task before the for loop, and one after? The one after the for loop does you no good--you've already gone through all your loop iterations in which you are reading from that device before you get to it.
Hope this helps.
06-17-2013 10:59 AM
IN my vi the chaneel set at 1chan1samp is DAQmx write and other one is DAQmx read ( N channels for is for multiple inputs). I don't think that is the reason for that.
06-17-2013 11:12 AM - edited 06-17-2013 11:13 AM
I apologize--I didn't look close enough at your vi to see that one was write and one was read. That wouldn't be the problem. Adding indicators to the data wire before one of the waveform additions and one right after that addition, it does appear you are ending up with a larger dt after the addtion process for some reason. You get 0.001 dt before, and then 1.00 dt after.
06-17-2013 11:25 AM
How do you set the indicators ?? If you run the vi with highlight execution on, you will see that it first shows the error at DAQmx write.
06-17-2013 11:34 AM
What error are you getting at DAQmx write--and does it show up the first iteration? I was getting an error on the first iteration, and so changed the clock used for the write sample clock. I just figured you had a different clock source that I didn't have--such as that on your device.
06-17-2013 11:41 AM
It doesn't pop up the error as it does in sum.vi. But it shows -200457 error on second iteration
06-17-2013 11:43 AM
You are generating waveforms that have a Frequency of 500,000 Hz for 1000 samples. You feed that into the Feedback node initializer terminals. Then you do a DAQ read which is based on 1000 samples per second. So your dT's do not match when you try to add together the newly acquired data to that in the feedback node.
06-17-2013 11:54 AM
I have specified 1000 for samples per channel in DAQmx read. It is not samples per second. So shoudn't it be correct as I have set the no. of samples as 1000 everywhere else. Even then I removed that value but getting the same error.
06-17-2013 12:00 PM
I tried replacing your feedback nodes with shift registers and got the same error.