06-07-2008 06:46 PM
06-09-2008 01:47 PM
igor79,
You could first initialize the terminal count of ctr0 to its maximum value minus the specified number of quadrature counts. This will cause the terminal count to exceed its maximum value and output a pulse on ctr0internaloutput when the specified number of quadrature counts is reached. If the trigger source of ctr1 is specified as ctr0internaloutput then ctr1 will pause when the terminal count of ctr0 is exceeded. If you wanted this to be a re-triggerable application then you would have to reset the terminal count of ctr0 to its maximum value minus the specified number of quadrature counts every time the maximum terminal count is exceeded.
06-09-2008 10:50 PM
Thank you for reply G Lo,
Unfortunately, It does not seem to work for me. The closest what I found to initialize terminal count for position encoder counter (it is ctr1 in my case, configured as X1 linear) is to specify initial position. By polling position counter ctr1, I can see that position approaches and crosses zero as driver approaches and reaches destination, so I seem to calculate difference right (2^32/[counts/m] - distance2go_m), but ctr0 (motor pulse train) does not pause.
I also tried to configure ctr1 as usual edge counter and specify initial count accordingly. Still it crosses maximum value and continues through zero without issuing signal.
I know that I can pause the ctr0 all right, as I do that in another part of my program (proximity sensor issues pause trigger to ctr0 if no-no zone is entered, and it works). Is it possible that ctr1 pinout is not right (I use pfi13 as default ctr1-out)?
Thank you for your time,
Igor
06-10-2008 03:53 PM
Igor79,
I tested the simple edge counter case that you described and it seems to work fine. You mentioned that PFI13 is connected to ctr1-out but you would need to set the source for the pause trigger as "Ctr1InternalOutput". No external connections need to be made between these two counters if the trigger source utilizes the internal output.
06-10-2008 09:43 PM
G Lo,
I am afraid I'm missing something obvious here. I set up pause trigger using Daqmx_Trigger_Property_Node, where Pause.DigLvl.Src can take values PFI0..15, Onboard clock etc. , but ctr1InternalOutput is not on the list there. I know that no external connections are needed, I just assumed (probably naively) that PFI13 refers to ctr1InternalOutput because it's marked as ctr1 output for 6212.
My another assumption that might also be naive is that ctr1 outputs a signal when maximum counts is reached automatically. Do I actually have to set-up additional CO Pulse Ticks task or something like to arrange that?
Thanks a lot!
Igor
06-11-2008 09:50 PM
Igor,
I have attached the two VIs that I was using to test the simple count edges case. You should run the Gen Dig Pulse Train-Finite-Retriggerable.vi first and then run the Count Digital Events.vi because it will send the pause trigger when the terminal count is reached. I also looked at the Device Routes for the 6212 and you should be able to route ctr1internaloutput or ctr0 internaloutput to its respective trigger source terminal. Please let me know if you are succesful.
06-11-2008 09:57 PM
G Lo,
I have LV8.2.1 - could you please save the vi's for older version?
06-12-2008 06:15 PM
Igor,
Not a problem. Please let me know if these VIs don't open in 8.2.
06-12-2008 11:20 PM
06-13-2008 07:15 AM
I *think* I know why you couldn't find the option for /dev1/ctr1InternalOutput. It's due to a "feature" that I've found kind of annoying.
By default, those controls only show the options that NI has pre-determined as the most common choices. Many of the internally-routeable timing signals didn't make the list. What you need to do is right-click on the constant and pick the menu choice to "show advanced terminals". THEN you get to see the complete list. Unfortunately, to the best of my knowledge there is no global setting to change this. It needs to be done on each individual control/constant 1 at a time.
-Kevin P.