Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

use counter to control many channels in microsecond

Solved!
Go to solution

Hi Everyone,

i wanna use one (or more) counter(s) to control for example 10 channels. The first target is, that every channel can output a digital signal one by one every 10 microsecond. And second is, that one channel output a high level digital signal and after 50 microsecond will be low.

Cloud you give me some suggestions. Thank you 🙂

0 Kudos
Message 1 of 7
(2,859 Views)

This sounds to me like a job for a hw-timed digital output task rather than a counter task.   What DAQ hardware device(s) do you have available for this app?

 

If using a desktop DAQ board, I'd steer you toward something like a PCIe-6323, which is not limited to 8 hw-timed DO lines and which can derive its own sample clock for DO.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 7
(2,843 Views)

Thank you for your fast response. I have just 3 USB-6259 devices. It is limited for many functions. Do you mean, that i should try the HW-DO modi?

0 Kudos
Message 3 of 7
(2,839 Views)

I have 3 USB-6259 ,just these. And the timepoint of the output best is variable. For example, I need to control 4 DO,DO0,DO1,DO2,DO3. DO0 output at 10 us and continues for 20us. DO1 output at 15us and continues for 30us. And so on.  

 

0 Kudos
Message 4 of 7
(2,838 Views)
Solution
Accepted by topic author HighFivce

Your USB-6259 devices ought to be able to work, but it's an M-series device where DO tasks can't produce their own sample clock.  That's not too big a deal because you can still drive hw-timed DO by generating a clock with one of the counters.  To learn more, search for "correlated DIO".

 

Note that only the lines on port 0 can be hw-clocked.  All 4 DO lines will need to be part of the same task, so you'll need to define all 4 states at each sample time.

 

For example, let's suppose you generate a 1 MHz pulse train with a counter that you use as the DO task's sample clock.  You'd have 10 samples of all DO lines LOW (microseconds 0-9).  Then you'd have 5 samples with only DO0 HIGH (microseconds 10-14).  Then you'd have 15 samples with both DO0 and DO1 HIGH (microseconds 15-29).  Then another 15 samples with only DO1 HIGH (microseconds 30-44).   And so on, as you work out how to add in the timing for DO2 and DO3.

 

I wouldn't be surprised if there's an example around somewhere for building up multi-line digital patterns like this, but I didn't find anything relevant in a quick search.  The code for doing it isn't terribly complicated though, just watch out for off-by-one errors due to quantization or rounding.   (Here, off-by-one errors are likely to show up as digital state changes that happen 1 sample earlier or later than they should.)

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 5 of 7
(2,830 Views)

thank you very much, i will try it.

0 Kudos
Message 6 of 7
(2,828 Views)

Thank you very much! 

I just need to convert at first my time plan in T/F array. 

0 Kudos
Message 7 of 7
(2,813 Views)