Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Gen Digital Pulse Train Finite Retriggerable - Initial Delay is only for first trigger

Alan,

Thanks a ton ; the 3rd post VI is working . As you can see this is a steep learning curve for me. I have more questions popping up

1)

I understand from your message that M series has 2 ctrs so what if I want to extend the above application and create more train of pulses say one which has a different intial delay and more/less number of pulses. Can't I reuse the counters along with different input triggers.

 

2) How is the digital output different from counter output .  Could you please explain this with an example say the working  of a constant write digital channel burst . Can we use it for generating pulses .

3) From what I know the counter is nothing but a time keeping device however it is labelled as a physical port too . I am not sure how to relate these causally .Also it seems strange that even when I am just using a single port the other one is busy too (looks like a waste!!). Also I am curious about the significance of source of ticks during pulse generation . Is the concept of this in any way related to counters..

4) When we say counter 1 internal O/P does it mean that there are 2 o/p 's possible one for internal use the other as an external port (I just want to confirm this idea)

Thanks for your patience

Ams

0 Kudos
Message 21 of 32
(3,523 Views)
Ok, 1)  You can certainly "re-use" the counters.  Meaning, you can change the pulse specs on the counter outputs and re-start.  You can not use more than two of them at any one time.
 
2) The digital circuitry is separate from the counter circuitry.  You can use digital output to produce a pulse train.  Keep in mind that with your device (PCI-6251), you have 8 clocked digital lines.  The rest are software timed only.  Here's a couple references to clocked digital:
 
3) As far as I know, Finite Pulse Train is the only counter operation in NI-DAQmx that requires both counters.  All other operations use only one counter.
When generating a pulse train based on ticks as opposed to time, you specify an external source, "source of ticks", and then you can choose how many ticks of your external source you want your pulse train to be high and low.
 
4) Counter 1 Internal Output is the output of Counter 1, internal to the device.  There is one internal output signal per counter.  There are not two different outputs for each counter.
 
-Alan
0 Kudos
Message 22 of 32
(3,495 Views)

Dear Alan,

The links you sent have provided useful information however there is not much information explaning the difference in circuitry of a Digital I/O and a counter

1) I have attached a VI in which we have a digital IO however as can be seen there is no control for initial delay , duty cycle etc..Is there a way to have that kind of flexibilty may be by inserting a simulate signal somewhere 🙂 . I guess the clocks would only give a sample rate.

Besides the above the attached VI on running gives an error of property "start trigger is not supported" (Why?)  . I hope top make this work (with your help) and then insert a retriggable in it.

2) You had explained that for a finite retriggable pulse both counters are used , I assume that would be tru only if I am using a counter output and will not be true if I am using a digital output.

3) Is it true that counter ckt has an inbuilt clock (well I did need one when I modified your pause trigger VI to use ticks) and that a digital IO must have a clock.

4) I was trying to generate a continuous pulse using ticks option (in order  to understand how ticks work) but for some reason it does not allow me to put a value of greater than 1 in the low ticks option and gives me an error for any value of less than 2 ticks so I can't any way to run it for ticks . It seems to work fine for time and frequency option. (I have attached this VI too)

 

Thanks

Aman

 

0 Kudos
Message 23 of 32
(3,427 Views)

Alan,

The first point attachment is in this message.

0 Kudos
Message 24 of 32
(3,427 Views)
Ok, both counters and digital lines are TTL logic (5V - 0V), but the similarities pretty much stop there.  The difference is the functions they can perform.  Counters can be used to produce pulses or pulse trains, measure frequency or pulse width, etc.  Digital l/O lines can be used in a couple different ways, but it really comes down to writing (or reading) a 'high' or 'low' value to them at desired times.  Yes, writing alternating highs and lows can create a pulse train, but you can't simply ask for a duty cycle and frequency on a digital line.  Additionally, with M Series, there is no dedicated digital timing engine.  So, if you want timed digital I/O, you will be required to use a timing source from somewhere else.  This timing source could be an analog input or output sample clock, a counter signal, an internal timebase, an external (to the board) signal, etc.  The example in my last post uses a counter output as the clock source.  Without a timing source, you are limited to software timed digital I/O, meaning, the timing of writing highs and lows to the digital line will be determined at the software level, and therefore at the mercy of the OS.
 
So, to summarize, you can't set up a finite pulse train task using a digital I/O line.  You must use timed digital output. 
 
As far as using a counter with the "ticks" option, you must have a clock source.  You tell it how many ticks of the clock source you want your pulse to be high and low.  I believe you are correct that you can't use fewer than 2 ticks, but I'm not sure what you are talking about when you said you can't put a value of greater than 1, thats certainly not correct.
 
-Alan A.
0 Kudos
Message 25 of 32
(3,356 Views)

Alan, 

1) What is the difference between a timing source and a clock. I know the difference that clock speeds can be made cause I reconfigured your VI to work with ticks.

2) The VI attached in my 09-01-2006 03:44 PM post is the one that does not allow low ticks to be greater than one . You could take a look at it. I am curious to know the reason
 
Aman
0 Kudos
Message 26 of 32
(3,280 Views)
1) I'm not quite sure what you are asking here.  "Timing source" and "clock" could have different meanings given the context they are used in.
2) This is a LabVIEW type issue.  First of all, you are using double data type for number of ticks.  This doesn't make any sense, because number of ticks must be an integer value.  Secondly, the control was probably previously set up to have a max value of 1.  I would recommend deleting your current controls, then right-clicking on your low ticks and high ticks terminals and selecting Create>>Control.  This will give you controls of the appropriate data type and range.
-Alan A.
0 Kudos
Message 27 of 32
(3,270 Views)

Alan,

I need a clarification. Based on our previous interaction I understand that Digital I/O lines can create a pulse train however we cannot ask for a duty cycle , retrigger on a digital I/O . The same can be achieved only by using counter ckt (for some hardware reason which I don’t know but would like to) as your previous example showed.

 

In a previous message you have also mentioned that one must use a timed digital output to create a finite pulse train .I would like to confirm that counter and a timed digital O/P are the same thing.

Aman

0 Kudos
Message 28 of 32
(3,192 Views)
Hello Aman,

If you look inside the DAQmx Help (Start >> Programs >> National Instruments >> NI-DAQ >> NI-DAQmx Help).  If you search for counters under the index tab you will find a document called counter parts in NI-DAQmx.  This document explains the parts of a counter, including the count register.  The parts of a counter allow it to generate pulse trains at a specific frequency and duty cycle.

A digital output does not have the same circuitry.  It simply loads a value from a buffer and displays a high or low value. 

Finally, if you want to generate a timed digital pulse train, you need to acquire or generate a clock.  If you use a counter to generate a pulse train, a clock is not required. 

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
0 Kudos
Message 29 of 32
(3,159 Views)

Jesse,

Jesse,

Thanks for the reference on counters

 

I understand that a timing source of some sort is needed to generate a pulse train; that could be a counter or in case of a digital O/P or Analog O/P a clock.

 

1)      I observed that in a DAQmx Timing (used in waveform buffer generator for example) there is just a sample clock ; there is no indication of clock source however when I try to use ticks option in the create channel to create pulses (using counters) I am needed to specify the clock source..is this because that in the former case the DAQmx timing automatically picks up the clock source (or is sample clock in itself an independent variable clock) and the user needs to be concerned with only determining the clock rate ??

2) Can you please elucidate the relation between clock source; clock sample rate; samples per buffer and cycles per buffer ; what is the signifigance of each and how they relate to the final frequency of the pulse train. ( I believe that clock source sets the sample rate i.e how fast the high’s and low’s are created ; is there a buffer fill rate too I mean could there be a conflict on how fast a buffer is filled up and how fast it is read out etc..)

 

Aman

 

0 Kudos
Message 30 of 32
(3,150 Views)