From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-05-2010 04:33 PM
Hi,
I'm using NI-6229 board and I got problem with pulse generation by a DO channel, that the duty cycle set value for 'CO Pulse Freq' does not work (or it fails to write the waveform to the digital channel).
I ran the VI file 'Gen Dig Pulse Train-Continuous' (given by the example finder) with duty cycle set to 0.1, but it still gives 50% pulse width square wave.
Does anyone know how to solve it?
Thanks
Jiahua
11-08-2010 12:54 PM
Hi lijh-
Are you looking at the counter output or a separate digital output? You shouldn't be getting a 50% duty cycle if you are looking at PFI 12 (CTR 0 out). Is this the channel you are looking at?
Have a great day!
11-08-2010 02:22 PM
Hi Jiahua,
What you have posted is not the shipping example.
Create Digital Waveform.vi is not part of the counter shipping example. The sub-VI is meant to be used to generate a dummy digital waveform for a Digital Output task. The graph on your front panel is going to look the same regardless of what you set the duty cycle to, since this graph actually has nothing to do with the configuration of the counter task. The subVI queries the number of channels in the task (which is 1 in this case) and outputs that many channels of digital waveform data in a ramp pattern (e.g. 0000 0001 0010 0011 0100 ...). So, with only one channel you'll just see what looks like a 50% duty cycle square wave.
The actual output on the counter (PFI 12 for ctr0 by default) should be whatever duty cycle you set when the task is first started.
Best Regards,
11-09-2010 12:17 AM
Hi, John
Thanks for the explanation of Create Digital Waveform.vi!
My initial problem is PWM control activated by a DO but not CO channel. I found an example 'Correlated Dig Write With Counter.vi' but the output waveform doesn't respond to the duty cycle set value if I add one to the 'CO pulse output' function. Do you know how to solve it?
Thanks,
Jiahua