08-25-2008 04:25 AM
Hi
I want to synchronize two parallel VIs . If anybody know this please help me.
Wije
Solved! Go to Solution.
08-25-2008 04:28 AM
Hi Wije,
can you explain a bit more? You can use the rendevous vi´s. If you have to send data between these loops, then you can use queues.
Hope it helps.
Mike
08-25-2008 10:48 AM
08-25-2008 07:50 PM
Hi Mike
Thanks a lot concern about my problem. Actually I need synchronice two DMM using same external trigering source. So I programme two DMM using parallel VIs. See attachment. I gave same voltage input to the both DMM and detected digitized signal. But at display there is a phase differance due to time delay with parallel VIs. Hilight excecution shows that although the two parallel VIs not run same time. This time delay between parallel VIs create phase differance even for same signal. So I want to synchronize trigering section in programe as shown in attached figure. I checked manual and examles. But I have no Idea how to put these VIs in queue operations. Your help in this mattter highly appriciated
Wije
08-25-2008 08:09 PM
Are those subVI's set to be reentrant? If they are not reentrant, then each instance of the subVI will have to wait until the other instance is done running. You would probably want to use the rendezvous VI's just prior to the arm trigger so that the different paths will wait until both rendezvous's are reached. Then let the Arm trigger be reentrant so that each instance can be run simultaneously.
If that doesn't work well enough, then it may be necessary to put the rendezvous's inside the Arm trigger subVI right before whichever piece of code is the true point you need to synchronize.
08-25-2008 08:35 PM
Reentrant or not, the trigger VIs cannot run simultaneously. Commands over the GPIB bus are sequential.
I see you have asked this question before. Did you try the sequence recomended here? Is the external trigger running continuously? If it is, then once you arm one dmm, it will probably trigger before you arm the second dmm in your scheme. Even if you arm the two dmm's sequentially, the trigger may happen fast enough that the same thing will happen. External triggering schemes are most effective when a single trigger occurs after you have armed both instruments. Have you been able to set the instruments up manually? If you manually are one, does it trigger before you have a chance to arm the second? If it does, then the program is doing exactly the same thing and I don't think there will be much you can do to change it.In order to get simultaneous acquisitions, you can set both for a software trigger and then issue a GET (Group Execute Trigger).
Provide some details on the external trigger.
08-28-2008 08:09 PM
Hi Dennis
Thanks for your comments about my problem. Actually I did your sequence recommened procedure and results same. Actually Two DMM can synchronize using Master Slave relationship. In this method sample triggering can be set by programe and after arm triggering of both DMMs the second DMM trigger by 1st DMM using Ext out time signal with fixed time delay. But I want to use external PLL circuit running frequency of 61.44 kHz to take samples of both DMM. In this method I cannot find fixed relationship of Trig Events between two DMM. If any suggesion is higly appreciated.
Wije
08-29-2008 12:28 AM
Hi Wije,
You could even make use of semaphores as well to synchonise the multiple loops.
that is readyly available in the LAbVIEW libraries.
Sundar.
08-29-2008 09:10 AM
Yes, one instrument can sometimes be used to trigger a second but there is some finite delay between the first instrument being triggered and then sending out the pulse to trigger the second.
As I said, with the continuous trigger signal, as soon as you arm the first, it will trigger before you can arm the second. Once both are armed though, subsequent acquisitions will be synched. This would require the instrument to have a continuous trigger mode. Discard the first acquisition from both instruments and from then on, you should be okay. Of course, this all depends on the instruments having this support. The last time I needed to do something like this, I used an NI DAQ board which made things much simpler.
p.s. To all of those suggesting the LabVIEW synchronization options, I don't think this is an issue with LabVIEW at all but a hardware synchonization issue. No amount of LabVIEW coding will allow you to program two different GPIB instruments at the same time.
08-29-2008 09:11 AM
SUNDAR.N wrote:Hi Wije,
You could even make use of semaphores as well to synchonise the multiple loops.
that is readyly available in the LAbVIEW libraries.
Sundar.
Could you please explain in a little more detail how you would use semaphores to do this?
Semaphores are used to PREVENT sections of code from running simulataneously. If you know of a way to use semaphores to force sections of code to run simulataneously, I would like to see how you would dot that.