10-24-2007 08:46 PM
10-25-2007 05:10 PM
Hi,
I believe you may be running into a couple different issues here. You were using Traditional NI-DAQ with Measurement Studio 6, with .Net you're probably using NI-DAQmx. There is a bit of a learning curve when transitioning, but hopefully we can help you out. We certainly didn't eliminate functionality, it is just organized differently and for me the transition to .Net itself makes thing fun. You can change the duty cycle on the fly with:
myCOChannel.PulseDutyCycle = <new duty cycle>
the and the frequency with:
myCOChannel.PulseFrequency = <new frequency>
I believe there are other ways, but I'm more of a DAQ programmer than .Net. You can use these calls after you start the task. Hope this helps - please post if you have any additional questions.
Andrew S
10-25-2007 05:27 PM
10-26-2007 10:26 AM
Hey Derek,
I'm not sure how you are trying to implement this, but I've attached a modified example that works for me - again probably not great .Net programming but it works. I did notice that in order to change the duty cycle you need to set the frequency right after it, this may be what you were running into.
Cheers,
Andrew
10-26-2007 01:40 PM
Derek,
The thing Andrew observed is that for some reason, writing a new duty cycle value doesn't cause it to be commited to the counter hardware until/unless a frequency value is also written. This is true even if the new freq value is the same as the previous. See this kb article.
-Kevin P.
10-26-2007 02:10 PM