LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

complementary counter signals

Solved!
Go to solution

Hi.

 

I need to generate two complementary signals of 200KHz and 45% dduty cycle 180° out of phase from each other.

 

I currently have CTR6 and CTR7 as outputs, with PF3 one connected to CTR6. I then configured CTR7 to be triggered off of PFI3, but I cannot get them to be 180° out of phase from each other. Any help is appreciated.

 

Thanks,

Joemar

0 Kudos
Message 1 of 12
(3,950 Views)

Joemar-

 

I think it may help to know what device you are using.  What is your physical setup?

 

Thanks,

 

Sean N

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 2 of 12
(3,937 Views)

You need to pre-load one of the counters with an initial value, corresponding to the difference in phase, prior to starting the counter.  You might be able to find sample code for this by searching the NI site for "pulse train delay."

0 Kudos
Message 3 of 12
(3,931 Views)

I am using a PXI-6602 and using CTR6 and CTR7 as outputs. Thanks

0 Kudos
Message 4 of 12
(3,918 Views)

Thanks for the delay suggestion. Tried it unfortunately the problem looks like both counters do not start at the same time. If I press RUN and STOP repeatedly, the counter the difference between the two pulses change.

 

I am running them in series in a single task, so I assume it is using the same clock.

 

Thanks

0 Kudos
Message 5 of 12
(3,916 Views)

You could feed that output of a single counter to a tansistor or TTL inverter gate (7404) to obtain and inverted signal.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 12
(3,910 Views)

Thanks, unfortunately I need some deadtime in between the two signals.

0 Kudos
Message 7 of 12
(3,906 Views)

It sounds like you may need to try a master-slave setup so that one task is waiting for the other to begin.  Once they are both started at the same time, then you can implement a delay.

 

Thanks,

 

Sean

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 8 of 12
(3,891 Views)

Here, try this.  The error routing isn't pretty but it'll do the job to help with sequencing.  The keys are to

use "arm start triggering" to sync their start times and to specify 1/2 period difference in their initial delay

times.

 

You'll need to adjust the device names for your board and may need to use a different DO / PFI pair

to do the arm start triggering.

 

-Kevin P

 

synced_delayed_pulsetrains.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 12
(3,870 Views)

Thank you guys for the suggestions. Special thanks to Kevin for creating the VI. Solution looks elegant but it a little bit more complicated than I would like, considering the PCB is already assembled and would not like to make changes if not absolutely necessary.

 

Initially I had CTR7 triggered on PFI3 (which is physically connected to CTR6) but that did not work for some reason, dont know why because that to me seems exactly the same as what I have below. Then I read somewhere that when you right-click on the I/O constant, there is an advanced option that allows you to pick CTR Internal Outputs. Now even if the two counters are on a different task (different clocks), they are in sync every time.

 

FYI, this is not the exact implementation I have since I needed to turn the counters ON/OFF at different times in the software, but this is essentially how I did it. I also changed the duty cycle to less than the original 45% spec.

 

Thanks again.

 

-Joemar

 

0 Kudos
Message 10 of 12
(3,858 Views)