取消
显示结果 
搜索替代 
您的意思是: 

Syncing digital output and counter output with external trigger

已解决!
转到解答

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 

0 项奖励
1 条消息(共 17 条)
3,500 次查看

Please attach your code. We cannot debug an image.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 项奖励
2 条消息(共 17 条)
3,488 次查看

I am attaching the code for reference

0 项奖励
3 条消息(共 17 条)
3,432 次查看

Sure, attaching code for refernce.

Thanks

0 项奖励
4 条消息(共 17 条)
3,431 次查看

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

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 项奖励
5 条消息(共 17 条)
3,405 次查看

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

0 项奖励
6 条消息(共 17 条)
3,399 次查看

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

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 项奖励
7 条消息(共 17 条)
3,393 次查看

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.

0 项奖励
8 条消息(共 17 条)
3,355 次查看

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

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 项奖励
9 条消息(共 17 条)
3,350 次查看

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

https://www.ni.com/docs/en-US/bundle/pci-pcie-pxi-pxie-usb-6251-specs/page/specs.html#GUID-5BB1ED0F-...

I am attching the code and error message for your reference.

Thanks again.

0 项奖励
10 条消息(共 17 条)
3,342 次查看