11-15-2017 07:52 PM - edited 11-15-2017 07:55 PM
I am trying to generating a synchronized digital signal which is a voltage ramp from 5V to 0V. I started with the example provided in LabVIEW called "Correlated Dig Write with Counter.vi", but keep getting the error message, "Error - 200077 occurred at Property Node DAQmx Timing(arg 1) in DAQmx Timing(Sample Clock).vi:2". I use port0/line0 as the Output physical channel and use ctr1 as the counter.
I also tried writing my own version to output the voltage ramp, but I got the same error message. I put my code in the attachment. When I run my code, I use port0/line0 in lines and use OnboardClock as the source. Does anyone know how to solve the problem or what might be the possible problem? Thanks!!
Solved! Go to Solution.
11-16-2017 12:00 AM
Hi LEHPPD,
Which DAQ device are you using?
11-16-2017 09:40 AM
Hi 550nm,
Thank you for asking.
I use PCI 6602 which connected to the computer (OS: windows XP) through PXI-1033. I use port0/line0 as the lines that output the voltage ramp and use the OnboardClock as the source of the Sample Clock. The samples per channel is set to be 100.
11-16-2017 11:12 AM
The 6602 does not support hardware-timed digital i/o. You'd need hardware that does support it. Examples of common MIO boards that *do* support it:
- X-series MIO boards support the use of an onboard clock for hw-timed DIO
- M-series MIO boards support hw-timed DIO but not by (direct) use of the onboard clock.
There are other options too, but the MIO boards seem to be the most commonly owned. If you purchase new, you'll need to assess several aspects of compatibility (PXI vs PXIe, DAQmx driver versions that support both the board and XP, LabVIEW versions that support that driver, and so on.).
-Kevin P
11-16-2017 01:16 PM
The PCI-6602 does support single block DMA transfers. According to the datasheet, the maximum is 100 points at 5MS/s. Your setting into the timing VI is 10MS/s. For continuous operation, the maximum rate is 28kS/s.
Other Errors in your code:
Your code also generates a sine wave from 5v to 0v into a 100 point array of DBL. This array is converted to a U32 which will round each value into the integers 0 to 5, overflowing all the negative values. This integer array is written to your IO board as 1D U32 1Chan NSamp. With port0/line0 selected, you will output only the lowest bit (bit0) of the U32.
11-16-2017 02:51 PM
I'm quite sure the 6602 doesn't support hw-timed DIO. It *can* do hw-timed counter-based measurements (edge counting, pulse widths, encoder position) if you supply your own sample clock, but it *can't* do hw-timed regular DIO or buffered pulse train output.
That said, there are bigger problems in the OP's posted code and question. Michael_Munroe identified several issues with your use of datatypes. Another more fundamental problem is the whole idea of trying to linearly ramp a digital output.
That has no meaning. A digital output has 2 possible states, OFF and ON. Nothing in between. The API (correctly) provides *NO* means to output anything other than OFF or ON.
So what are you *really* trying to do? What other DAQ devices do you have available if the 6602 is incapable?
-Kevin P
11-16-2017 07:00 PM - edited 11-16-2017 07:05 PM
Hi Kevin_Price,
@Kevin_Price wrote:
Another more fundamental problem is the whole idea of trying to linearly ramp a digital output.
That has no meaning. A digital output has 2 possible states, OFF and ON. Nothing in between.
Thanks for pointing out that! I had a misunderstanding the function of "digital output". I think what I really need is the analog output that outputs the samples in some certain rate which reference to the onboard clock. I have another card PCI 6251 which has the fast enough sample rate and analog output. After I change the function from digital output to analog output, it works right now.