From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I can't generate multiple waveforms with different phases.

Solved!
Go to solution

Hi community!

 

I've created a simple general-purpose waveform generator (see "Signal Generator.vi"). When I try to put two of these generators in the same VI ("Test bench not working.vi") I am not able to independently change the phases of the two signals. Only one of the two phase knobs actually modifies both signals, whereas the other one has not effect at all.

 

However if  I copy and paste the exact same block diagram two times in the same VI, rather then importing the generator's VI, everything works fine ("Test bench working.vi").

 

It seems to me that the two generators are sharing anything but  the phase variable. I am new to LabView and I can't figure out what's going on and how to fix it. Can you please help me understand?

 

Thanks a lot

0 Kudos
Message 1 of 5
(2,546 Views)
Solution
Accepted by topic author M.D.

Hi,

 

this is because multiple instances of the basic function generator vi won't work independently - they share information.

To fix this wire a true-constant to the reset signal input of the basic function generator vi in your signal generator vi.

 

Best Regards

Florian

Message 2 of 5
(2,532 Views)

Thank you Florian, it works indeed. But now I am wondering why in the second scenario ("Test bench working.vi") everything just goes fine, even if there are two istances of the basic function generator and no reset signal inputs. Any suggestions? 

0 Kudos
Message 3 of 5
(2,528 Views)

Indeed, it shouldn't be working in that scenario either. Maybe it just appears to be because by chance the basic function generators are executed in a different order.

There is no order forced by dataflow, hence you have a race condition and cannot predict the order of execution.

0 Kudos
Message 4 of 5
(2,523 Views)

Oh, I see. Thanks again 🙂

0 Kudos
Message 5 of 5
(2,521 Views)