11-19-2007 11:08 AM
11-28-2007 01:32 PM
11-29-2007 10:26 AM - edited 11-29-2007 10:28 AM
11-29-2007 04:05 PM
08-11-2008 02:33 PM
08-12-2008 11:12 AM
08-12-2008 11:28 AM
Hi Paul,
Thanks for quick reply. Could you recommend some NI DAQ card which is hardware-timed? I tried to search them in NI USB DAQ products but failed to find any. Thanks.
-Tao
08-12-2008 11:39 AM
08-18-2008 09:10 PM
Thanks, Paul. I talked to my advisor and he agreed we would buy another NI DAQ card. I really appreciate your continuous help on my work.
Here is another question for "scan out". Basically, it is similar to "scan in". We built a series of registers in the chip, and driven by two non-overlap clocks rating at 200ms per cycle, these registers output a series of data (could be '0' or '1') one by one from a single pin. So every data will be held on the line for about 200ms.
Now I want to use USB-6008 to read these data in the Labview, and for test purpose, I just connect the output and input lines together. You can see from the vi file which I will attach in this post, I use line0 and line1 of port0 to output the non-overlap clocks, and use line2 of port0 to output a series of data. For simlicity, I create a spreadsheet file of 0s and 1s every other row. To view the waveform, I connect those 3 lines to analog input lines ai0, ai1 and ai4. To test scan out function, I connect line2 of port0 to line0 of port1, and use line0 of port1 to input the data appearing on its line and write those values into another spreadsheet file.
It would be simple to just use software timed sampling, reading the digital input every 200ms. And since I want to sample when the data is settled, I use a "stacked sequence" to wait for 100ms before sampling and then wait for another 100ms. In this way, I believe the sampling will always be done at the midpoint of a data if the input and output tasks are started simultaneously. However, when I run the vi file, I find sometimes the output and input are the same, while sometimes are not.
Since I view from the virtual oscilloscope the output is what I want, I can only guess that the output and input task are not simultaneous, so that the sampling is being done at the edge of data and errors are casused. To verify, I output a spreadsheet file of all '1's or all '0's and such errors never happen (because actually there is no rising/falling edge now).
So my question is, how to make those 4 tasks start simultaneously? I tried "flat sequence" and put those 4 "start task"s in one frame, but it seemed not to work.
I know the best way to do the sampling is to use ck1 or ck2 as an external clock, and make the digital input to read the value every rising or falling edge of such clocks. However, it seems that USB-6008 does not support external clock? I want confirm it with you. And I also tried many other ways such as "change detection" or "triggering", but I failed all of them. So, could you tell me is there any ways to realize such function (sample at the rising/falling edge of clock) using USB-6008?
Thank you very much!
Tao
08-19-2008 12:33 PM - edited 08-19-2008 12:36 PM
Hi Tao,
The only way to gaurentee that the four tasks start at the same time is to use a hardware trigger that starts them all. The problem is that the 6008 cannot use a start trigger on a digital task. The 6008 is just not designed to do this type of operation. Without being able to start them with a hardware tirgger, you're left with trying to start them in software at the same time. The best way I can think of is the flat sequence structure as you have already tried. Even the m-series cards I suggested would have difficulty with this type of application hardware timed because they only have one digital trigger system. You might look at some of our Digital I/O cards that have multiple trigger lines for digital tasks. This would allow you to hardware start both your digital output and digital input tasks on the same trigger. There is one that that you might try. From looking at your code, it looks like your only forcing the 100ms wait prior to the read on the first iteration of the for loop. On subsequent iterations your doing the wait in parallel. Try fixing it with the below modifications and see if it doesn't work better.
I hope this helps,
Paul C.