Jump to content


Photo
- - - - -

Periodic trigger lossless version

openg periodic trigger

  • Please log in to reply
2 replies to this topic

#1 boone_93

boone_93

    More Active

  • Premium Member
  • 25 posts
  • Location:SE Wisconsin, USA
  • Version:LabVIEW 2012
  • Since:2003

Posted 17 August 2012 - 06:43 PM

*
POPULAR

I was using the OpenG Periodic Trigger in an application and notice that my time base was drifting. After spending some time on it and rewritting to make it a little more readable I made a change to fix what seems to be a time leak to me. The change is made where it gets the new time after a trigger has occurred. If someone would take a look and give me feedback that would be great. Could this be an update to the OpenG Time library?Attached File  Periodic Trigger.zip   24.33K   69 downloads
Dan

Don't code angry ...

#2 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 24 August 2012 - 06:07 PM

Hello Dan,

your code looks valid and for the (small) test I'v run it's OK.

I don't fully understand what the bug/fix is, could you describe that in more detail?

Ton

#3 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 28 October 2012 - 03:23 PM

OK, I figured out what the essential difference between the two implementation is.
The original OpenG Periodic trigger resets the phase upon every trigger. Your implementation is maintaining the phase.
I have a little table showing this:

PhaseDiff.png
Where I had a Time (ms) of 500 ms and waited 450, 100, 400, 100 and 10 ms. The column Next Trigger is showing the output state of the upper Shift Register which basically contains when the next rollover of the timer will happen.

I think we should add both implementations, making yours the default for new VIs, the old functionality should be maintained via deprecation. So currently already code isn't changing current behaviour.

Here's my proposal:
Periodic_Trigger_Losslessd.png

And it's documentation:
TriggerDocumentation.PNG .

Losing phase has functionality if you alter the 'Time to wait'. However we might need to auto-reset then as well.

EDIT:
Please note that you might get unexpected Triggers with Maintain Phase On:
Example_VI_FP.png

Ton





Also tagged with one or more of these keywords: openg, periodic, trigger