09-30-2023 05:57 PM
I am new to LabVIEW. I am trying to send two independent finite trigger pulses signal that have a delay with each other, that should be in sync with an external oscillator.
I am using an m series board. What will be the best way to implement this.
The external oscillator gives out 400KHz. I tried a simple approach using the error lines but the delay is not constant between the two signal.
I need the digital signal to start 100micro second before the counter output which should start few millisecond after the external trigger input(oscillator)
Thanks in advance
Solved! Go to Solution.
09-30-2023 06:16 PM
Please attach your code. We cannot debug an image.
10-02-2023 05:24 AM
I am attaching the code for reference
10-02-2023 05:25 AM
Sure, attaching code for refernce.
Thanks
10-03-2023 07:12 AM
I'm generally a big proponent of counter/timers, but they're kinda different from the other kinds of data acq tasks (AI, AO, DI, DO). So as someone coming in new to this stuff, you might want to just generate both pulse outputs using 2 distinct DO lines in a single DO task.
The main potential benefit of using a counter/timer would be more precise timing resolution. The DO task can only create pulse timing with integer multiples of the sample period, but that may very well be sufficient.
-Kevin P
10-03-2023 07:28 AM
Thank you for taking your time to answer. I want to generate n pulse of 500~1000ns, I am using the counter for this. The digital out is for the camera trigger(100 micro second). I am using an M series, and hence can't use two counters together as there are only 2 counters and we require two for generation of n pulses.
I am having a hard time starting the two processes together.
This must be in sync with the pulse from the oscillator - 400KHz
Thanks
10-03-2023 07:47 AM
The sync problem you have in your code right now is that the two tasks are free to start on *different* cycles of the external 400 kHz clock. You need them both to start on the *same* cycle. Here's how:
Configure the DO task to use one edge of the 400 kHz signal as the sample clock (as you already do) and to use the *other* edge as a start trigger. Configure the CO task to be triggered off the internal timing signal "/digitizer/do/StartTrigger". Then set up your task start sequencing differently so that the CO task is started *before* the DO task.
-Kevin P
10-04-2023 08:27 AM
Thank you for the guidance. I tried following it, but I encountered an "Error -200452 occurred at DAQmx Start Trigger (Digital Edge).vi:3930001 -
Possible reason(s):Specified property is not supported by the device or is not applicable to the task.". I am also attching a screenshot for reference.
For reference, I am using PCIe - 6251.
Thank you again for the help.
10-04-2023 09:16 AM
I double-checked with a simulated device and I guess my memory's getting rusty about M-series details...
It's ok, we can still get there from here. We'll just have to use a dummy AO task as a helper. The AO task will support the triggering and routing we need.
So NOW, configure an AO task to use the 400 kHz signal as a falling edge start trigger. You will start this task LAST. Don't configure DAQmx Timing for the AO task at all -- that'll let you fire up this dummy task without generating any new AO output signal.
Because of what I see about signal routing in MAX for a simulated M-series device, I'm going to further recommend that you use DAQmx Export Signal to route the AO task's start trigger to a PFI or RTSI line. RTSI is less likely to interfere with anything else you're doing.
Then configure both DO and CO to use the AO task's exported start trigger signal as their own respective start triggers. Also configure DO to use the rising edge of the 400 kHz signal as a sample clock. Start both of them FIRST. They will be synced when you later start the AO task that triggers them at the same time, off the same specific edge of the 400 kHz clock.
-Kevin P
10-04-2023 11:29 AM
Thanks once again for the guidance. I tried implementing the same. Unfortunately, encountered an error - "Error -200452 occurred at DAQmx Start Trigger (Digital Edge).vi:3930004.
Possible reason(s): Specified property is not supported by the device or is not applicable to the task.
Property: Start.TrigType"
This happened when I implement start trigger on digital line.
I went through the data sheet and did not see start trigger in external digital trigger for DO
I am attching the code and error message for your reference.
Thanks again.