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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronising CTR or DIO lines

 

Hello dear community,

 

I would like to implement the following (s. attached pdf).

I have implemented the digital pattern on CTR0 with a retriggerable CO Task configured to acquire finite samples (s. Attachement). I am trying to implement CTR1 by using the same vi (triggered with CTR0) but i am encountering the problem, that retriggering occurs too quickly creating more than just the desired one pulse. CTR2, CTR3 should also have CTR0 as a start trigger.

With other words: CTR0..CTR4 should run synchronously.

 

Ideas are welcome !

 

P.S.

Please pardon that I already posted this text  in an older thread that I had started a while ago. Since the subject has shifted a bit in regard to that thread I decided to post a new topic.

Download All
0 Kudos
Message 1 of 5
(2,381 Views)

Please carefully define the expected timing of any input signals (both freq & pulse width), the required timing of any output signals (freq, pulse width, quantity), *exactly* what you need to "sync" and how closely.

 

If the LED signals are meant as precision-timed output signals, I'm pretty inclined to suggest you define them as part of a DO task.  The pattern and timing appears to be more straightforward that way.   But the particulars require quite a bit more detailed definition about the timing relationships of the various signals.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 5
(2,353 Views)

Thank you for replying.

The CTR0 Signal is a digital pattern with a varying 3-9 pulses (determined by the user). The width of the pulses can also be determined by the user and is usually in the range of 20ms-400ms. To create this pattern on CTR0 I use the internal time base (in the case of the DAQ-6363 I use the 20MHz timebase). The period of the digital pattern (including the time when the signal is low) is somewhere between 1sec and 3 sec.

As I tried to indicate in the image:

LED1 needs to be synchronous with each first pulse.

LED 2 needs to be synchronous with each second pulse

LED 3 needs to be synchronous with each 3 AND 4th (furtherahead maybe more) pulse.

 

Regards !

0 Kudos
Message 3 of 5
(2,342 Views)

I think buffered DO will end up being the most straightforward way to define this set of pulse timing patterns.

 

1. The easy way is to generate a constant freq pulse train with a counter and use it as a sample clock for the DO task.  All the output signals will come off digital port 0 (which allows hardware-clocking).  You should configure for continuous sampling with regeneration allowed so you only have to fill the DO buffer once and then let it run as long as you'd like.

   You'll have a trade off where better timing resolution will require a larger buffer of data to be defined.

 

2. A slightly more advanced way that could work on an X-series 63xx board: define a buffered counter output task on CTR0.  Place the pulses at the exact instants that any of the DO bits need to change.  Then define your DO buffer accordingly.

   This gets you excellent timing resolution *and* a (potentially) small data buffer.  But it gives you more complicated upfront work to define the pulse timing locations.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 5
(2,330 Views)

The way I solved this was by :

1. Generating a pulse train with a counter using the vi attached above.

2. Create one DO task for 3 physical lines. I used the onboard clock as a timing source and set the sample rate in a manner to create pulses that were of exactly the same pulse width as the counter pulses. The start trigger for the DO is the counter signal. In order to generate the DO pulses periodically I set the DAQmx Trigger Property to retriggerable. I used digital waveforms to output the desired "0" and "1" on the digital lines. Knowing how many pulses are generated with the counter i could "design" the output on the DOs with the digital waveforms perfectly.

 

 

Message 5 of 5
(2,308 Views)