LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change continuously the offset and the amplitude of an imported signal

I recently created an application in Labview 2010 in order to import a signal (with the 'Read from measurement File' express block) in order to create an output signal, by using DAQmx blocks. I would like to be able to change the amplitude or the offset of the signal during the running. So basically, I would like to have an output generated in this manner: y*=ay+b, where 'y' is an imported (fixed) signal, and ' a' and 'b'  are the amplitude and the offset that I would like to change continuously. Because I am quite novice in Labview programming, I have joinded to my question the Labview program I have developped.

Thank you for your help

0 Kudos
Message 1 of 6
(2,271 Views)

I added the two fields and the structure in the block diagram to do this. It is really very simple.

Tim
GHSP
0 Kudos
Message 2 of 6
(2,262 Views)

Thank you for your response. It is indeed very simple but this is not exactly what I need. I already tried something similar, but the problem is that when you select a value for 'a' and 'b' before the running, those parameters stay the same. I would like to be able to change 'a' and 'b' during my running if needed (for example, if I created a chirp, and then I notice during the running that I should increase its level in order to have a much stronger excitation). So, the solution would be -I think- to change the waveform stored in the buffer in the while loop when the user changes the values of 'a' and 'b', so that for the next iteration in the while loop, the waverform is updated with respect to the new values of 'a' and 'b'.

0 Kudos
Message 3 of 6
(2,245 Views)

I added an event structure and placed the write inside the while loop. When the user changes the A or B control it causes the loop to write to the analog output again.

Tim
GHSP
0 Kudos
Message 4 of 6
(2,238 Views)

Dear Tim,

Thank you for your help. Unfortunatly, it seems that the full develpment system is needed to use an event structure, and I only have the base package. I have however modified my previous program by using a double  while loop, to detect if a change of the 'a' or 'b' coefficients change (this is actually a way to detect an event). I have already tested this program and its working pretty well. Basically, the idea is that if the user changes the 'a' and 'b' coefficients, I reload the updated output signal in the buffer. 

0 Kudos
Message 5 of 6
(2,227 Views)

Yes event structures are worth the extra money all by themselves. I am glad to hear that you adapted to get this to work. Let me know if you have any other questions.

Tim
GHSP
0 Kudos
Message 6 of 6
(2,209 Views)