Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

small as 200 microseconds

I need to generate 2 digital output pulses at varying frequencies (repetition of 100Hz to 5kHz) and at varying pulse lengths (from 0,1us up to 2ms). I hoped this is posisble to do with counters available in USB 6216. Is necessary to have simultaneus pulse trains on two output, when the pulses in output are of oposite polarity.

 

I have trayed example from:

On our boards that support Correlated Digital I/O, it is possible to use a counter to generate a clock signal, then update the Digital I/O based on that signal.  The following example should be a good starting point to show you how this could be achieved in LabVIEW:

NI-DAQmx: M Series Pulse Width Modulation (PWM)

 

But this example generated me errors description after execution of step "6. Use the counter output as the sample clock. Configure a 10,000-point buffer. (May need larger for more DO arrays.) "

Error message:
Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi:1->Mseries_PWM_MultDO_OneCtr_getting_to_4DO.vi

Possible reason(s):
Measurements: Requested value is not a supported value for this property.
Property: SampTimingType
You Have Requested: Sample Clock
You Can Select: On Demand
Task Name: _unnamedTask<F> 

 

I did read the commetns on:

http://forums.ni.com/ni/board/message?board.id=70&message.id=11030&requireLogin=False

 

 

But I hope solution is possible for 2 outputs, I do not need 4 output signals.

 

Sincerely Yours,

Rytis Jurkonis

 

 

0 Kudos
Message 1 of 8
(4,830 Views)

Hi RytisJ,

 

The post you quoted sounds quite familiar... Smiley Happy

 

Unfortunately, as I mentioned in the other thread the 621x boards do not support Correlated Digital I/O, hence the error you are seeing.  Since you only need 2 lines of outputs, you will be able to generate the pulses with the counters, but updates to the frequency and duty cycle will be software-timed and non deterministic.

 

 

I would look at the following example for a starting point that will work with your hardware:

Change Counter Output Frequency on the Fly

 

 

I hope this helps!

 

 

Best Regards,

John

Message Edited by John P on 09-04-2009 05:53 PM
John Passiak
0 Kudos
Message 2 of 8
(4,819 Views)

Hello,

 

I work at same project, IN "NI USB-621x User Manualfound" found that  USB 6216 have external source and gate input pins isn't it possible to generate these signals at some pins and conect with wire. In that way we could get two sychronised pulse trains?

 

Thank you forward, 

 

schem.JPG 

0 Kudos
Message 3 of 8
(4,687 Views)

Hello Vytas,

 

From the first post, it sounds like you might just want to generate two pulse trains with varying duty cycles of opposite polarity.  If so, I would just start from the shipping examples included with the DAQmx driver.  These can be found in LabVIEW by going to Help » Find Examples.  From there, go to Hardware Input and Output » Generating Digital Pulses » Gen Dig Pulse Train-Continuous.vi.  What you want to do is set the initail delay of the first counter to be 0 and the high and low times as you want to see the signal.  For the one you want of the opposite polarity, you will need to set the initial delay to the size of the first pulse, then you will specify the high and low time to be the opposite of the first counter.  This will make it high when the other counter is low etc.  

 

In regards to the diagram, you can wire your signal to the gate of the counter to use it as a pause trigger (you can use another PFI line if you change the gate line through a property node).  This will cause the counter output to only generate while the gate is high / low depending on how you set it up.  I'm not sure why you have two counter input signals.  Please provide more information about your application and why these two input signals are necessary and I'd be happy to help out.

 

Regards,

Paul C.

0 Kudos
Message 4 of 8
(4,659 Views)

Yes, I want to make two pulse trains with varying duty cycles of opposite polarity. But I need them bouht  at same time. I will conect these two pulse train signals to two power swiches (then <1 on- 2 off> and otherwise) what will drive piezo transducer.

 

One more question. How can I run at same time two virual channels. (Run example "Gen Dig Pulse Train-Continuous.vi" and generat GATE signal)

0 Kudos
Message 5 of 8
(4,632 Views)

Hi Vytas,

 

We're going to have a problem outputting two pulse trains of varying duty cycles simultaneously on the 621x.  Since the updates to the counter outputs are completely software timed on these boards, there is no way to ensure that the changes occur simultaneouly between the two counters.

 

The best advice I can give would be to use an external inverter circuit with a single counter. 

 

 

If this isn't an option for some reason, one possible workaround would be to configure a Start Trigger to start both counters at the same time.  When you change the duty cycle, the counters will not update at exactly the same time, but after the update has completed on both counters they should be synchronized again since the frequency is not changing.  If you don't want to have moments when the counters are not synchronized, you could restart the tasks with a new trigger every time you need to change the duty cycle.

 

One other thing to mention is that our new X Series DAQ devices do support buffered counter outputs.  You could adjust the counter output parameters on the fly based off of a hardware timed signal, so we would not have the same problems.  Also, any multifunction board that supports clocked digital outputs (622x, 625x, 628x, 63xx) could be used to generate the necessary signals using Digital Output lines rather than counters (although your resolution would be limited by the update rate of the DO).

 

 

Best Regards,

John

John Passiak
0 Kudos
Message 6 of 8
(4,611 Views)

Hello, everybody 

 

Thank's for reply's it  was very helpful. I decided to generate two counter outputs (GATE and SOURCE) and use external circuit to get required signals:

 
SChemute_gal.JPG
 
 
And one more question. Is it possible to get counter0 continuous samle mode and counter1 output finite sample mode?
 
Then I do this I get just one pulse from counter1 no matter the amount I set .
 
Thank you forward, 
Message Edited by Vytas Bendaravičius on 11-26-2009 12:35 PM
0 Kudos
Message 7 of 8
(4,351 Views)

Hi Vytas,

 

On the 621x, Finite Counter Output tasks require the use of both counters.   You should be receiving an error if you try to run a finite counter output at the same time as a continuous counter output on your board.  However, from the diagram it looks like you might like both counters to run continuously at different rates which would indeed be possible.  Do you need to define the number of pulses generated on the Gate/Source signal?

 

Also, I noticed that the Source signal you want to generate is 10 MHz.  You may use the Frequency Generator (see 621x Manual) to generate such a signal if you want to free up the use of your two main counters so that you can generate a finite number of pulses.

 

 

Best Regards,

John

John Passiak
0 Kudos
Message 8 of 8
(4,312 Views)