Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control an external device with counter output channel?

Hi, I am learning to use NI multifunction I/O board to trigger an external stimulator. I use matlab to control the NI board and now can send 5v voltage output through an analog output channel to trigger a stimulator. The problem now is that I have 6 stimulators to be triggered but the NI board only has 2 analog output channels. The NI board does have more counter output channels. I am wondering if it's possible to trigger external stimulators with these counter output channels? And how to control the counter output through matlab?

I would appreciate any help. Thanks.

0 Kudos
Message 1 of 6
(2,913 Views)

The best approach will depend on some things you didn't describe.  What DAQ device do you have?  At what rate do you need to "trigger" the external device?  Does the timing need to be very regular and precise, i.e., do you need hardware timing?

 

5V output signals can be generated as analog, digital, or counter output.  I like counters plenty, but digital output may turn out to be a better option depending on answers to questions above.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 6
(2,891 Views)

Hi Kevin, Thank you for help. The NI board I use is NI USB-6216. The timing of output signal to trigger external stimulators has to be randomly distributed between 1s to 5s, which I can control with inter-trial interval with matlab when I use anolog output. I will try to see if digital output channel works. 

Thanks again.

0 Kudos
Message 3 of 6
(2,881 Views)

It sounds like you're using software timing for your AO so you can approach DO pretty much exactly the same way.  Your device only has 2 AO channels and 2 counter channels, so you'd have to use *some* DO anyway.  May as well use DO alone, I would think, all 6 channels.  Save the AO and CO for things that DO can't do.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 6
(2,874 Views)

Hi Kevin, thank you for your advice. I did try to control external stimulators with DO channels and it works. I have another question, is it possible to change the single pulse duration of DO output? and how?

 

Thanks again.

 

0 Kudos
Message 5 of 6
(2,816 Views)

It appears that the USB-6216 is a reduced-functionality version of M-series device that does not support hardware timing for DIO.  (Most M-series devices support hardware timing but cannot generate their own sample clock.  They need to get it from an outside source.  NI commonly referred to this partial capability as "correlated DIO".)

 

So your only option will be software timing, but that's what I figured previously anyway.

 

Under Windows, software timing will usually be pretty good, but can never be counted on to be precise, deterministic, or reliable.  Just warning you.

 

A typical construct might be to string together 3 functions with sequencing controlled by the error in/outs.  First write a True, then call the "Time Delay" function to delay for the amount of time you choose, then write a False to complete the pulse.  Just bear in mind that the delay you *get* will sometimes be more than the delay you *ask* for.  Occasionally quite a bit more.

 

Kevin_Price_0-1592546305780.png

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 6
(2,812 Views)