LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI example on synchronization of multiple channels..

Dear users, 

 

I have a question related with one of the NI examples available online. The attached image shows two simple channels (one AI and one DI). The AI Voltage task creates a < Get Full Terminal Name > function which basically takes the task created and a terminal ( i guess the ai/SampleClock) and makes it as one. Then it shares this < sample clock > with the other channel (DI) in its source. Then, it does the same with the trigger. which means it shares a digital start trigger with the DI task. Can anyone please provide me with some clarifications related with this example?

 

1) If we want to share start triggers (Hardware-based) and clocks with other channels, do we always need to use this < Get Full Terminal Name > function in one of the tasks and then share it with multiple tasks?

 

2) If we have two, three or five channels in one single task (i.e. voltage, voltage) and we have another one task Digital Input, how is this going to affect the DAQ? I guess its not going to make much difference. 

 

3) Is this method applicable for syncrhonisation of multiple modules (i.e. 3 modules)?

 

4) How do we know which PFI line shall we use for the trigger? A module can have multiple ones. Are there any basic criteria for the selection of it? 

 

Regards, 

Mari

0 Kudos
Message 1 of 7
(4,347 Views)

I cannot identify the DAQmx function you have indicated, and cannot find this example.  It should be possible to choose appropriate Property Nodes of your tasks to get the synchronizaion signals you need.  What device(s) are you using (what is "Dev1" in your system)?

 

Bob Schor

0 Kudos
Message 2 of 7
(4,285 Views)

Thanks for your kindly reply. There is an article for this below:

 

http://digital.ni.com/public.nsf/allkb/9D58153D1B5E5B66862574C8006A30FB

 

The example is shown below:

 

http://www.ni.com/tutorial/11549/en/

 

Do you suggest of using property nodes based on timing function to get the syncrhonisation? The device is a voltage input for a differential variable transducer. 

 

Thank you for your quick reply. 

0 Kudos
Message 3 of 7
(4,192 Views)

What, specifically, is "Dev1"?  Is it, for example, a USB-6009, a PXI-6052E, a cRIO module, or what?  What name does MAX give this device?

 

BS

0 Kudos
Message 4 of 7
(4,139 Views)

Hi Mari121311,

 

My name is George and I am an Applications Engineer working at National Instruments. I see that Bob Schor has already started to help you with your issue but hopefully I can provide some more assistance with your questions;

 

  • To synchronise multiple channels they all must share a sample clock and a start trigger, usually this is achieved by having one master channel and multiple slave tasks. In the example you mentioned the analog input channel is the master task and the digital input channel is the slave task. The “Get Full Terminal Name” function is not necessary for this but it is an example of how to share a reference for all the clocks and triggers so that they are all the same for each channel. You do not need to use this method but it is an option.

 

  • You are right that it does not matter what type of channel they are, i.e. digital or analog, as long as all the tasks share a sample clock and a start trigger they will be synchronised.

 

  • In the tutorial you linked in your post figures 6, 7 and 8 show some examples of ways to synchronise channels with different data types from different devices. Have a look at that section of the tutorial and let me know if you have any questions about it. The hardware you are using will determine the most appropriate software and hardware method for your application.

 

  • The best choice of PFI line will also depend on what hardware you are using and which module you want to use for your master task as different hardware has different functionality.

 

I hope this answers some of your questions. If there is anything you still don’t understand let me know and I will try to provide more information to help you towards a solution to your problem.

 

Regards,

 

George

0 Kudos
Message 5 of 7
(4,102 Views)

George,

 

Cheers for your reply. The attached image indicates a hardware trigger. I have a question and I would be greatfull if you could explain me the following diagram. Why the error our from the Input Task goes directly to the sample clock of the output task ? The same is happening with the start vi. Is this the way that you share sample clock and trigger?

 

Regards, 

 

 

0 Kudos
Message 6 of 7
(4,089 Views)

Hi Mari121311,

 

You are correct that both channels are synchronised in this example but the error wire is connected like that only as a way to enforce data flow. Each part of a VI will only run when they have received all the data they need to run. For example an addition function will only run when it has received both numbers to add together. By connecting the error wires in this way the start vi for the top channel has to start after the start vi for the bottom channel has finished and passed on the error information. For master and slave synchronisation to work the master channel, which in this example is the top channel, must run last as it starting is the trigger for all other channels to start. In other examples a flat sequence structure is used to force the master channel to run after the others have been set.

 

As for the rest of the example code it shows a basic way to synchronise 2 channels that could be scaled to handle more channels as well. Both channels in the example appear to share the same sample clock, in this case just referred to as “sample clock”, and are both set to be triggered by the same input which is determined by the source drop down box. This source should correspond to the input channel used. When an input is received the trigger will start both channels at the same time and because they run on the same clock they will continue to run synchronously. The input channel then writes data as a waveform and the output channel outputs some data until it has finished at which point the “Is task done?” vi causes the while loop to end.

 

I hope this clears up any confusion you have about hardware triggers and synchronising channels. I would recommend reading through the tutorial, especially the synchronising devices section, and the help files within LabVIEW and trying to adapt some of those examples to use your hardware. If you have any more questions relating to this problem let me know.

 

Regards,

 

George

0 Kudos
Message 7 of 7
(4,066 Views)