LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga Square Gen messes up Sine Wave Gen

I am trying to generate several sine waves on AO0-6 (PXI-7831) which works quite acceptably until I add the single square wave that I also need to generate. I am using Sine Wave Generator and Square Wave Generator subVIs.

When the Sq generator is not in the program everything seems fine. When it is present but the duty cycle is 0 everything is fine. When the duty cycle is not 0 it modulates all the other Analog output pins despite not being connected to them.

 

Judd
0 Kudos
Message 1 of 3
(2,120 Views)

It looks like you're already aware of the loop-throttling behavior of the Square Wave Generator, so I suspect there is a problem with contention for the AO7 resource since you're writing to it in both loops. Try removing that IO node from the sine wave loop and see if that clears things up.

0 Kudos
Message 2 of 3
(2,096 Views)

I wasn't aware of the loop throttling this was a second attempt.

I had everything in one loop and that didn't work either.

I prefer one loop  I want to keep (or adjust) phase relationship when the frequencies are the same.

 

Thanks

I missed that I hadn't pulled AO7 out of the first loop. I will try that fix.

 

I have come up with another solution:

I created two more sine wave generators. At 0+(output) in one I turn on the AO7 output and in 0+(output) in the second I turn off the square ware. By phase shifting the second one it allows me to control the duty cycle. it should also allow me to phase shift the square wave (by shifting the phase in both sine generators.) But that doesn't seem to be working yet although that may be due to the measuring intruments not being set up correctly too.

 

Judd
0 Kudos
Message 3 of 3
(2,071 Views)