03-28-2006 01:03 PM
03-28-2006 02:55 PM
The names "Source", "Gate", "Aux", "Out" do refer to specific signal types. The way these signal types map to actual connector pins is hardware-dependent, though there is a specific default pin that will be used if nothing else is specified. Certain counting modes (position encoder mode) will require physical wiring connections to default pins. Other modes will allow more flexible signal routing.
Yes, it is possible to "gate" the output of one counter with the output of another.
As a LV guy, I can't comment on the VB.net syntax. But in addition to configuring the signal routing, one must also configure the counter in question to "pay attention to" the gate signal. Under LV and DAQmx, this would be known as "Pause Triggering." Without setting up "Pause Triggering", the counter treats the signal at its gate as irrelevant. You can think of a Pause Trigger as a level-based Enable signal.A "retriggerable" counter would use its gate signal differently. It would be edge-sensitive and wouldn't respond to a constant-high signal.
Sometimes it's not clear how to map DAQmx terminology down to the underlying counter hardware. Under traditional NI-DAQ, you basically were forced to understand how the counter hardware worked with "Source", "Gate", etc. signals. DAQmx largely removed that requirement. As a result, most simple operations and many intermediate ones are easier to setup, but other less common tasks can be a bit confusing. I've had trouble finding the correct property to set when trying to do period measurement with an external clock.
At the hw level, the Source increments the count register. The Gate is a control input, either a level-based Enable, an edge-based sampling clock, or an edge-based trigger. Aux is typically only used for position measurement. Out seems self-explanatory, though there are various non-default output modes that can prove handy at times.
Under DAQmx, the Source is defined differently for different counting modes. For edge counting, you wire in a signal identifier. For period measurement or pulse generation, it wants to use an internal clock. Similar for Gate. Sometimes you set it up as a pause trigger, sometimes as a sampling clock, sometimes as a digital start trigger.
Hope this helps some. Have fun with the 6602, it's a pretty nice piece of hw!
-Kevin P.
03-28-2006 03:24 PM
03-28-2006 03:50 PM
One of the nice things about DAQmx is the ease of flexible signal routing. If I'm guessing right about the example you mentioned, here's how I'd setup the counters in LV and DAQmx. I would expect that it'd be done in a similar manner but with different syntax with VB.net:
1. Configure the master counter for pulsetrain generation but don't start it yet.
2. Query the master counter's task for the "output terminal" property.
3. When configuring the other 6 counters, pass this "output terminal" into their DAQmx Timing calls where it's known as the "Sample Clock source" (or something similar).
4. Start the 6 counters. Their count registers may start incrementing if they are receiving Source pulses, but no count values are being buffered yet.
5. Start the master counter. This acts as the sampling clock. The 6 counters start buffering data.
6. Note that the very first value in the 6 counters' buffers represent # of Sources from when they started until the first sample clock edge. Since the counters weren't sync'ed to start on a digital trigger, their start times were offset by some software execution time and they are NOT perfectly in sync. However, you can subtract these initial values off every buffered value to get a "change since first sample clock" measurement that will be in sync for all 6.
-Kevin P.
11-12-2010 10:45 AM
I agree Pelesi ; it is hard to go through NI documentation for dotNet (and I use NI products for over 14years now) !!!
I stilll haven't found how to generate a finite pulse train on a PCI-6601 .....
I guess that I will have to use 2 counters: one as continuous pulse generation of my target frequency ; and a second timer that will gate the first one, and that will pulse only once at a much slower frequency than the 1st one.....
11-13-2010 01:06 PM
Holy moly. 4 years later someone is still complaining.
Anyway, I may as well upload the code I ended up with. It's not the best UI, and not the best software in general, but it allows some pretty flexible use of a 6602. Maybe it will help someone.
It's a VS2005 VB.Net project.
Please keep in mind:
1. I can't run this software right now (don't have a 6602)
2. I haven't run it since 2007
3. I can provide very limited assistance, if any. And no, the comments are probably not very good.
4. The program was designed for timing two lasers to synchronize it with a camera. It was also designed so both the lasers and camera could be synchronized to an external pulse. My forum posts here were from when I was writing this thing.
I hope it helps!
04-05-2011 04:51 AM
Hello Pelesi,
Sorry to have taken such a long time to answer you. I am not using the forum often.
Let me just tell you that I am IMPRESSED by your code. I think that NI should provide it as a VB.NET sample code for the 66xx family.
There is everything required to create IO task. It is much better than the documentation.
Now I will have to find my answer in your code; such as : why the dividing value can only be a even number ???
Thans you very much for this beautifull code.
Anthony