05-30-2016 05:13 AM
Hi,
I have 2 x USB 6210 on 2 x USB ports on my laptop. (Windows 7, Labview 2010). My goal is to syncronize these two boards.
I put the same sinus (50Hz) voltage signal on their first input channel (AI0), to have and to see them in the same graph, and synchronised.
I put code in 2 different while loops. I tried with daq assistant, and daqmx (see attachements).
I hopped "DAQmx Start trigger" to do something good, but no luck.
But there is always a delay between them, some miliseconds on graph. And never the same delay, if ai run the program again.
If I light the yellow bulb when running, i see one of the "while" loop running, and then the other one, not in parallel.
Is there a way to have them synchronised, immediately, after I run the .vi ?
Thanks.
Solved! Go to Solution.
05-30-2016 07:45 AM - edited 05-30-2016 07:58 AM
First of all, one big problem with your VI is that you use an infinite loop, moreover you init and stop the DAQmx task at EVERY iteration. This is silly to do. Move the init and stop parts out of the loop, see example below.You specify a single physical channel, so why do you use the DAQmx Read function as "NChan NSamp", use "1Chan".
Did you have a look at the many DAQmx examples shipped with LV? Also, you do not use the error wires, which is not good. First understand the basic DAQmx things, and after that you can start to deal with syncing (in your VI you just have simply two totally independent parallel loops, how do you expect that the DAQmx tasks will be synced?).
I modified you VI to have first only one loop properly setup. Give me some time, I look for some example how to sync two USB DAQ boards...
edit1: I have changed the "Finite samples" to "Continuous samples"
05-30-2016 08:11 AM
I have found an example but I think this is not applicable for your hardware (only PCI and PXI stated in the help).
Anyway, give it a try, there are different modes for different HW in this VI, try the M-series option first, lets see if it works (i guess it will not). I try to find USB device specific method to do such task, I post again if I find one...
So, for the example, go to LabVIEW main window --> Help --> "Find Examples..." --> Type "synchronization" into the search field, and hit enter.
Double click on the first example ("Analog Input - Synchronization.vi"):
05-30-2016 08:40 AM
Have a look at this example too:
05-30-2016 09:23 AM
Based on the video, I have created this example VI. Could you test it? Do not forget, you need to connect the PFI0 to PFI0 and PFI1 to PFI1 BNC terminals with BNC cables between the two modules (you can chose other PFI connectors depending on your terminal devices, but then you need to change the corresponding PFI channels in the VI too).
05-30-2016 09:54 AM
05-30-2016 09:59 AM
mikeporter, the VI above your post does fulfil your description? I am just asking since I never tried such method. I have right now an USB-6212 device, but only one, so I cannot try to technique...
05-30-2016 10:28 AM
05-30-2016 10:30 AM
05-30-2016 10:31 AM
Hmm, I am not sure if mikeporter sees my posts? Did you reply to my question, or at all to this particular post? It seems you cross-mixed some different posts?