09-12-2017 05:15 PM - edited 09-12-2017 05:17 PM
I made up an example to work from. It's made by combining and slightly modifying a few different shipping examples. It ran just fine on an X-series board with 4 counters. I'm not sure the 660x board supports configurable A/B source terminals for an Up/Down encoder. If not, just specify whatever the default PFI pins need to be instead of what I used.
I have a master clock at 100 hz to simulate the chopper wheel. Two counters are configured to generate 5 msec period retriggerable single pulses. They have opposite trigger polarity. Their outputs cause a 4th counter to count up and down as they pulse. If all is working well, this count should simply dither back and forth between adjacent counts.
-Kevin P
09-12-2017 05:47 PM
Thanks very much!
Yes when converting from Legacy to DAQmx - the old code was using Continuous set-up, so I think carried over. I will compare and respond.
09-12-2017 05:53 PM
Yep - the original DAQmx code was calling the NI Timing VI with Continuous Set and I wasn't calling retriggerable property - translating from the old Legcay Help File descriptions is rough.
I will make the changes and see if it works. If Initial Delay works and we can specify the High Period with a short time for the low then this will be great.
Thank you,
Ryan
09-13-2017 07:42 PM - edited 09-13-2017 07:43 PM
Ok - setting up the tasks without using the DAQmx Timing - Continuous solved the double width issue!
We got mostly good behavior from the system, see image 0461
Until - NOISE! See image 0462 and the retrigger would happen too often on one or the other channel, but at least the delays were being applied at the front and the edges were mostly correct.
To me this seems like noise on the line (you can see a difference in the Yellow chopper wheel signal) is the culprit now.
BUT! You can add a Digital debounce Filter built into the PFI Lines of the Counter. Thus for the Start Trigger (Chopper Wheel) we can add Start.DigEdge.DigFilter.Enable and Start.DigEdge.DigFilter.MinPulseWidth
Hoping this cleans up the behavior seen in 0462 image. Waiting to hear back.
09-15-2017 10:26 AM
Seems like using the Digital Filters on the Trigger lines cleaned it all up and with the delay and off time set to the same - all but the very first pulse are using the low time only as the offset from the front edge trigger.
09-15-2017 11:14 AM
The last screenshot looked like it might be running with the 0.5/4.5 msec pulse params. If it'd be better for the leading edges of your pulses to be closer in timing to the original chopper wheel triggering edge, the 0.0001 / 4.9999 msec params I suggested should work fine too. I got the idea that you were experimenting with the longer idle time & initial delay of 0.5 msec mainly to try to troubleshoot the original problem.
-Kevin P
09-15-2017 11:37 AM
No, the delay after the trigger edges is desired.