04-18-2011 07:07 AM
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
04-18-2011 07:34 AM
I added the two fields and the structure in the block diagram to do this. It is really very simple.
04-19-2011 01:29 AM
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'.
04-19-2011 06:43 AM
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.
04-22-2011 02:49 AM
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.
04-25-2011 06:16 AM
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.