LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to adjust a function generator on-the-fly in Labview 7.0

I'm using the 'Simulate Signal' vi in LabView 7.0 (with BNC-2090 board) to generate a triangle wave for output to a potentiostat. If the value of either the high or low potential is changed, however, the signal incorporates discontinuities as it recalculates the amplitude and offset. Does anyone know of a way to recalculate the phase shift on-the-fly so that those discontinuities and sudden jumps in signal no longer appear? I think there should be a way to do it using an array, but the 'simulate signal' vi seems like it would be much easier to use.
0 Kudos
Message 1 of 3
(2,663 Views)
I am not sure if there is any easy method of doing what you want. The simulate signal will generate x points at the settings you have it set up for. So if you change the inputs then there will be a discontinuity between the 2 waveforms. The main reason is due to the offset, not the amplitude.

If you change the amplitude there is not that big of a change. However the offset does produce one, and the easiest way to change that would be to disregard the last point of the previous waveform and the first one of the new waveform. In addition by setting the simulate signal to create an integer number of cycles, the data becomes smoother.
0 Kudos
Message 2 of 3
(2,663 Views)
I agree with Evan that this is not an easy task.

A PID loop could help with the discontinuity but hurt other things. Here are my thoughts.

PID at output of "Simulate Signal"
This would smooth the transition but would also round-off the max and mins. Probably not good.

PID to control Amplitude and offset
Once you have this tuned, it may do what you want if you can tolerate the delay.

Filtering
Here you have to tolerate some phase shift as in the above. You are also caught in a catch 22 because you do not want the dicntinuity when the settings change but meanwhile the triagle wave is an endless series of cusps.

Let us know what ends up working for you.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 3
(2,663 Views)