Keep in mind however, that generating a finite pulse train of more than one pulse will use two counters on your device. Refer to the "Counter Pairs" topic in DAQmx help if you would like to know more about this.
it appears that both timers are being used even with only one pulse train being generated with the code above. (the shutter hooked up to ctr0 started opening as I was moving the stepper motor with ctr1)
Is there a way to avoid using both timers ( I only have 2, PCI-6014) and generate a single train with a pre-determined pulse count?
That is correct, both counters will be used when generating a finite pulse train. If you are only concerned with the pulse being generated on the output (and not the fact that the second counter is being used internally) you can tristate the output terminal for the unused counter, which will keep the single pulse from showing up on the connector. But if you need to use that second counter, you have two options:
1) If your pulse generation is slow enough, you can use either poll the output state or TC reached properties to determine when your desired pulses have been generated and then manually stop the counter. This option would be very CPU intensive and if the signals are too fast, would be prone to error.
2) You could generate the finite pulse train using one of your analog outputs, by outputting a 0-5V square wave and use this as your finite pulse train.
[q]you can tristate the output terminal for the unused counter[/q]
Gus: could you elaborate on the meaning of the word "tristate" ? I am assuming you are referring to turning off the actual ouput to the device breakout box, if so, how would i do that in the software (MS.NET in particular)
You are correct, I was referring to turning off the actual output to the device breakout box. You can do this in software by calling the "DAQmxTristateOutputTerm(const char outputTerminal[]);". You would want to call this on the "CtrXOut" pin where X=the counter you are not generating the output of your finite pulse train on. Let me know if you have any trouble doing this.
I have tried to lookup the "Tristate" property info in MS.NET 7.1, and I am finding it is only present on the DIChannel and DOChannel, nothing about the COChannel, which I am trying to tristate.
I found no evidence of "DAQmxTristateOutputTerm" in my help files for .NET or C++, perhaps they changed it?