I'm trying to convert a square waveform to logical true or false pulses which are used to change the phase of a sine carrier waveform by 180 degrees for each logical change. The desired output should look something like this.
However, with my current setup I'm not getting what i'm expecting. Is my square wave to Boolean setup wrong?
I seem to be getting only a True value out of it. Any help would be greatly appreciated.
(Try to define typical default data for all controls before attaching so we can try to reproduce your result.)
Your problem is due to the overuse/misuse of express VIs and dynamic data. You have a signal of phase vs. time, but are reducing it to a single boolean (i.e. a single phase!), losing all information except for the phase for the first data point.
Start with that information and see how far you get. Do you have the VI that produces the "desired output"? Compare the code!
I was able to get some progress by using the formulas for phase modulation. The Writing in red is my interpretation of them (not sure if correct).
the results look correct for the most part.
Did you solve the problem yet?
First of all, all that business with "select" and the phase and the subtraction can be deleted. Makes no sense. All you need is the multiplication with 1 or -1 according to the modulator. It also make no sense to wire a random enum to the amplitude input. A numeric seems more appropriate for that.
I am not sure why you make most controls into type definitions. Any reason, except making testing harder for us because you did not include them. Also fill all controls with your typical default values. The current default values are useless.
If you configure the simulations to "run as fast as possible", you might want to place a small wait somewhere.