Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6361 - How to generate trigger signal on specified channel

I want to send trigger signal for another USB 6361 card using PFI15 output.

I've looked at "Multi-Device Sync-AI and AO Shared Timebase & Trig DSA" from NI Examples and didn't quite understand it.

 

 

Do I have to just put DAQ Timing Property Node with SyncPulse.MinDelayToStart on the line of DAQ Card that I want to be master and it will generate a trigger?

 

DAQmx Start Trigger should be connected to slave card with PFI15 port specified as a source or do I need to use GetTerminalNameWithDevicePrefix.vi with "ai/StartTrigger" string constant connected?

 

 

0 Kudos
Message 1 of 11
(5,424 Views)

Dear Dide,

 

If you're just getting stated on synchronization in LabVIEW, i'd recommend to read a bit about the topic. You will find useful information specifically on these links:

 

http://www.ni.com/white-paper/5471/en/

<link no longer exists>

 

The main idea of running tasks in sync is to have both devices share one of the following in a master-slave connection:

 

  • The sample clock or
  • The master timebase and a start trigger.

Since USB does not have a dedicated bus for transmitting these signals, you will have to explicitly state which signal should be connected to which digital I/O. You can use advanced DAQmx functions for this, such as the Export Signal.vi and Connect terminals.vi .

 

If you get stuck or have other questions, let me know.

 

Kind regards:

 

Andrew Valko

NI Hungary

 

Andrew Valko
National Instruments Hungary
0 Kudos
Message 2 of 11
(5,413 Views)

Do I have to just put DAQ Timing Property Node with SyncPulse.MinDelayToStart on the line of DAQ Card that I want to be master and it will generate a trigger?


No, that's specific to DSA synchronization and doesn't apply to the 6361.

 


DAQmx Start Trigger should be connected to slave card with PFI15 port specified as a source or do I need to use GetTerminalNameWithDevicePrefix.vi with "ai/StartTrigger" string constant connected?

On the master device, export the start trigger to the desired PFI line using DAQmx Export Signal.  Physically wire this PFI line to some PFI line on your slave device.  On the slave device, select the appropriate PFI line for your start trigger source.

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 11
(5,405 Views)

I build up a VI based on examples from <link no longer exists>

 

x.PNG

 

I think I got the idea but it is still not working properly. I'm trying to synchronize two tasks using PFI ports (PFI14 is phisycally connected to PFI15) as each of them was run by different card (I don't have the other card right now), it should be possible I guess. So the Write.VI is waiting and after timeout returning an error. It seems like it wasn't trigerred? 
Can You tell me what is wrong in this VI ?

 

0 Kudos
Message 4 of 11
(5,381 Views)

Dear Dide,

 

 The code looks like a good starting point, but there are a few things I'd like you to consider.

 

  • If you synchronize tasks with a sample clock, there is no need to share a Start Trigger anymore.
  • Since your devices are separate USBs, the Sample Clock must also be routed through explicitly with PFIs, just like what you did with the Start Trigger in your code.
  • When syncing tasks, you must ensure that the slaves are all started before the master task. In other words, when our master sends the trigger or first clock, all the slaves should already be waiting for it, otherwise, they will not trigger, or will synchronize to a different edge.

And finally, an advanced tip:

If you want to eliminate all delays in synchronization caused by wire propagation (its only about 2ns/m, but for some applications even this is too high) or gating delays, one great way of doing it is to use counters. With a counter, you can generate a continuous pulse train or a single pulse to one of the PFI lines, and you can route this signal with cables of equal length to all devices to be used as a clock or trigger. That way, you can make sure that the signal arrives to each card at the same time, down to the nanosecond.

 

I hope these pointers will help you get started.

 

Kind regards:

 

Andrew Valko

NIH

 

Andrew Valko
National Instruments Hungary
Message 5 of 11
(5,376 Views)

So I ended up making up this application:

lvhelp.PNG

Works really great if I wire "Dev2/ai/Start Trigger" constant to Analog Output Start Trigger source, but If I wire trigger source as shown on the image (simulating triggering through digital input by another device) I get nothing on the analog output. Seems like writing task is not triggered.

Do You have any idea why it doesn't work? (of course! - PFI 15 and PFI 14 are phiscally connected using a short wire) 🙂

 

0 Kudos
Message 6 of 11
(5,283 Views)

I've already tried to send also a Sample Clock through PFI 12 -> PFI 13, but I still got nothing on Analog Output.

0 Kudos
Message 7 of 11
(5,277 Views)

Are you writing an empty array as shown in the screenshot?  That would be a problem.

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 11
(5,268 Views)

I knew someone will point it out. I just put it for the screenshot I also removed some other piece of code that is not essential for the problem.

 

Replacing empty array is not a solution.

0 Kudos
Message 9 of 11
(5,262 Views)

Dear Dide,

 

Let's identify the problem more specifically. The Output triggering can fail for two reasons:

 

  • Trigger from AI is not sent properly (routing not successful)
  • Trigger in AO is not received properly (routing not successful or signal too distorted)

Try using an Edge Counting task connected to PFI15 to see if the starter edge is sent correctly.

If you have routing issues, you can take a more direct approach with DAQmx Connect and DAQmx Disconnect. Connect PFI15 with ai/start trigger. Don't forger to disconnect the terminals in he cleanup phase as well.

 

Let me know if this helps.

 

Regards:

 

Andrew Valko

NI Hungary

 

 

Andrew Valko
National Instruments Hungary
0 Kudos
Message 10 of 11
(5,245 Views)