Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite Pulse Train TIO-Timing Specs

p^3.s.
finally got half way clever, changed my single pulses--which i knew were working properly on falling edge--to trigger on positive edge.
when i do this, i see the timing of finite pulse train and single pulses are exactly the same.
 
thus, I am confident my issue is that I am not setting the gating counter start trig polarity properly to falling edge in the VI.
if anyone could please explain/show how to do it correctly, much appreciated.
 
guess now that I think about it, I could just change all my timing to trigger off a positive edge and it wouldn't do me any harm, so long as my trigger pulse is very precise in it's pulse width.
 
I'd rather do things the proper way and have all pulses/data acq start off of the falling edge.
 
Again, I don't just want to throw an inverter in my electronics, cuz rewiring will be a headache.
 
gracias amigos.
 
0 Kudos
Message 11 of 16
(1,645 Views)
I think I see something....

Inside "Finite Pulse Train... -jev4.vi" where you configure the start trigger for the gating counter.  You choose between "positive" and "negative" to set polarity.  If you dig into the detailed help for "Counter Set Attribute" you'll find the following:

"attribute ID 28 (start trigger polarity) sets the polarity of the start trigger signal. Valid values for this attribute are low to high and high to low. These attribute values are specified using the attribute value type control."

I'm a little surprised you didn't get an error though.  I'm guessing that when you attempted to set the polarity with the "negative" keyword, it simply ignored you without issuing an error and kept the default polarity of "low to high".  I think you're exactly on the mark -- the problem seems to be in your pulse train trigger config.  Thanks for the description and troubleshooting info -- I wouldn't have ever gone into it far enough to find that little problem if you hadn't marched me right up to the doorstep.

Hope this fixes things for you...

-Kevin P.


P.S.  One thing that still puzzles me a bit is that I thought I remembered needing to also call "Counter Set Attribute" to enable the trigger.  Or maybe that was only for triggered counter input measurements, which was just about the only counter triggering I did. 



Message Edited by Kevin Price on 05-01-2007 10:43 PM

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 12 of 16
(1,643 Views)
Top o' the morning to ya-
So....I made the change to set the attribute to either be "low to high" or "high to low".
Didn't work(!)
 
Then I added a set attribute for Start Trig and set it to "enable".
This made the pulses disappear all together (!).
 (I posting a jpg of my block diagram that tried and failed...)
 
Hmmm...so it appears I still haven't set my start trigger correctly and am really wondering how to do it properly.
 
I looked at more examles (the ones packaged with LV), in particular "Generate Pulse Train - Strart Trig (NI-TIO).vi"
In it there is a subVI "counter Start trig.vi" which is supposed to do what I want.  The essential elements are that it sets the trigger to "enabled" and sets the start trig polarity.
 
Kevin, given your previous finding about setting the attribute to "hi to low" or "low to high" I was surprised to see this VI is using "positive" and "negative" for the attribute value.
Is the documentation wrong? the example has a bug? 
(jpg of this also attached.)
 
In summary, if someone can clear up how to actually set the start trigger properly, please clue me in.
 
many thanks.
jon
Download All
0 Kudos
Message 13 of 16
(1,635 Views)
Hello Jon,

I believe you have found the problem.  It makes sense that you are getting 1ms extra delay when your trigger pulse is 1ms.  Your code is triggering off the rising edge.  Try setting the gate polarity instead of the start trigger polarity, and set this property to negative.

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
0 Kudos
Message 14 of 16
(1,617 Views)
Well, I'll be darned...just made the change and we finally nipped this one at the bud!
 
Thanks you very much to everyone for your help along the way!
 
I would have never guessed to set  attribute gate polarity. 
If I might make one suggestion, the documentation--for me--was quite nebulous.
 
From the LV help:

attribute ID 3

attribute ID 3 (gate polarity) sets the polarity of the counter gate. Valid values for this attribute are positive and negative. These attribute values are specified using the attribute value type control.

For some reason I never took this to mean that it sets which edge (rising or falling) triggers the counter.  (Hence I was stuck on trying to set "start trigger polarity" which seems to be a much more sensible name....Maybe you could update/ammend the documentation for this, and other attribute IDs. 
 
Anyway, thanks again to all of you.
0 Kudos
Message 15 of 16
(1,615 Views)
Thanks Jesse!  I'd have never got there from here while thrashing about with the start trigger configuration.  Only now, after you mentioned it, do I recall using a gate input for retriggerable single pulse generation in traditional NI-DAQ.  Even so, I don't think I'd have made the connection to this single-triggered finite pulse train app.

(Maybe part of the object lesson is that whenever feasible, DAQmx is the better way to go.  Wouldn't make sense to switch at the very tail end of the project discussed in this thread, but is certainly preferred for new development.)

-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 16 of 16
(1,610 Views)