05-04-2011 11:22 AM
Hi, everyone
I need some helps on design two digital channel output
In brief, I want to use a PCI-6731 output with BNC2110. Two digital
output channel will be used, e.g. Dev1/port0/line0:1. I hope line0 could
output a steady finite samples in frequency f1 (e.g. 10kHz), and total
number of samples like N1 (e.g. 1E6); in the mean time, I hope line1
could output finite samples in frequency f2 = f1/M (e.g. 2kHz), and
number of samples like N2 = N1/M (e.g. 2E5). In another words, I expect
line0 and line1 output same time length samples sequence with different
frequency and also different number. Please note that parameter should
be expected to be controllable, and sometime f2 and N2 are not exactly
integer (then we need take round value).
Thanks for your help in advance.
Solved! Go to Solution.
05-05-2011 08:11 PM
Hello,
I would take a look at the examples in the Example Finder in LabVIEW (Help >> Find Examples). Browse to Hardware Input and Output >> DAQmx >> Digital Generation >> Write Dig Chan.vi. You can either configure tasks in Measurement & Automation Explorer and call them through DAQmx VIs, or you can create tasks directly within LabVIEW using DAQmx Create Task.vi. You can also use Round to Nearest to round an input to the nearest interger.
I hope this helps direct you in the right direction.
Jordan
05-05-2011 09:00 PM
It would be easier to use the 2 counters to do this, since that is exactly the kind of thing they are designed for. Are the counters available? You can make a general digital output do what you want, but it is more work. Look at the examples and just make sure you use the same time base for both counters to keep them synchronized.
Richard
05-07-2011 07:10 PM
Attached is a vi that does what you want, I think. It used two digital outputs clocked by one of the counters. The digital outputs are fed waveforms that are generated by making two frequencies with an integer ratio. You can change the part of the code that generates the waveforms as you wish, and use the rest to do the output.
Richard
05-08-2011 11:56 PM
Thanks. Jordan and Richard
Your suggestions both help me a lot.