07-08-2007 12:30 PM
07-08-2007 10:28 PM - edited 07-08-2007 10:28 PM

Message Edited by Troy K on 07-09-2007 02:36 PM
07-09-2007 08:21 AM
07-09-2007 10:25 AM - edited 07-09-2007 10:25 AM
You should be able to modify the counter example you found to have two counter pulses triggered simultaneously.
Similar to what I mentioned in my previous post, set up two counter operations on the one task. (The first 'DAQmx Create Virtual Channel.vi' automatically creates a task, the second one just adds another channel to the task.) Then because thay are the same task, they start at the same time (by the 'DAQmx Start Task.vi').
I don't have a USB6211 but it works OK when I simulate it.

This is just a slightly modified version of the 'Gen Dig Pulse.vi' you mentioned.
Once you get it working how you want, save it and call it as a sub-vi wherever/whenever you need to.
Message Edited by Troy K on 07-10-2007 02:27 AM
07-10-2007 01:44 PM
07-10-2007 09:20 PM - edited 07-10-2007 09:20 PM
You should be able to input your time in milliseconds and multiply the ms value by 0.001 to get the value in seconds to input to the CO function. The numeric controls are currently set to only display 2 significant digits, this doesn't mean it wont accept smaller or greater precision values. You can change it to 3 significant digits by right clicking on the control and selecting 'Format and Precision...', then increase the amount of significant digits...(see image).

One of the other Counter Output functions allows you to define the pulse times in timebase ticks, the counter has an 80MHz clock, so you should be able to define it down to 12.5 nanoseconds.
The delay I'm not sure about. How much of a delay? Perhaps if you could post your vi I'll have a look at it.
Message Edited by Troy K on 07-11-2007 01:21 PM
07-11-2007 01:52 PM
07-11-2007 07:11 PM
Hi Jaclyn, Troy,
I modified your code, Jaclyn to use the approach which I found successful where counter 0 is explicitly used as the trigger for counter 1.
I too found there is always find a fixed delay even when you define an initial delay of 0 for counter 1. The magnitude of this will depend on the timebase that is used. When you use time for the counter output instead of ticks, labview works out what time base to use. If you want to always be in control, then use the ticks version where you explicitly define the ticks. Using the 80Mhz timebase, the duriation of the delay with initial delay =0 was 50 nanoseconds (4 ticks) +/- 12.5 nanoseconds which is 1 tick.
Once you know what the dead time or fixed delay is , you could code this into your vi so that when you specify the gap between the pulses, you do something like the following
initial delay cntr1 = (pulse gap - dead time)/seconds per tick.
Comments on my approach are much appreciated. Let us know how you go.
Thanks Troy for your examples, was an approach I had not considered and I will test it at some point.
Cheers
Peter
07-11-2007 09:02 PM
It sounds like the counters/hardware aren't working how we would expect them to. Your approach Gryphon, seems like the only way to do it if you want to get perfectly timed outputs for the two counters.
I would have generated on the fly two custom digital waveforms based on the timing required and pumped it out of 2 digital outputs (as I suggested in my first reply). It adds a bit of complexity in generating the waveforms, but then at least you don't have to 'fudge' the timing to account for the hardware anomalies.
07-12-2007 08:42 AM