LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two digital channel output question

Solved!
Go to solution

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.

0 Kudos
Message 1 of 5
(2,660 Views)

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

0 Kudos
Message 2 of 5
(2,638 Views)

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

0 Kudos
Message 3 of 5
(2,635 Views)
Solution
Accepted by topic author dustindust

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

0 Kudos
Message 4 of 5
(2,622 Views)

Thanks. Jordan and Richard

 

Your suggestions both help me a lot.

0 Kudos
Message 5 of 5
(2,613 Views)