06-26-2013 10:23 AM
Dear NI Forum,
I have a a rather basic problem I am struggling to solve. I would like my VI to continously look at a signal (in the case below a simulated signal) in a waveform graph and everytime I click on a certain button I would like to sample the signal. For this the event structure seems useful, but I'm not getting my test case to run. The indicator nicely displays the updated values, but the waveform graph just doesnt update continously.
Can anyone help me out here?
Best regards,
Raphael
06-26-2013 12:08 PM
Raphael,
You need to configure your simulated signal properties to actually simulate a signal.
Right-click the Simulate Signal Express VI and go to properties. Alter the number of samples per second (Hz). Your current number of samples is 1, which means that your graph will only plot one point at time. Then, you will never see a sine wave, for example.
Also, get rid of the event structure. You don't need it to stop your program. If you simply wire the stop button to the conditional terminal, it will work.
Why don't you just wire the simulated signal to a numeric indicator, without the button, instead of using a button to update this?
And consider adding a wait (ms) function.
Hope this helps.
Regards
06-27-2013 05:08 AM
Thanks for your answer.
I've already increased the number of samples per second. The reason I'm using the button to update the indicator is that in a later version, I want to continuously monitor a real signal, and record the signal into an excel file, every time I press a button. The problem I have now, is that the waveform graph only updates when I press the button, even though it is outside the case structure.
06-27-2013 06:20 AM
If you want to continuously log the file when a boolean is true, you can use a case structure to check if the boolean is true. If true, then you update you indicator or, as you plan to do later, start logging the values into an excel file.
The key is to set up your boolean's mechanical action to Switch When Released, which will only change again when you want to.
Regards
06-27-2013 10:02 AM
Does this help you?
06-28-2013 02:39 AM - edited 06-28-2013 02:40 AM
Thank you jaoapam, the case structure combined with the switch when released button was already very helpful. The indicator updates nicely as it should.
I'm already having problems again though, in the next step I would like to append the measured value to an array (everytime I click). In the case structure model however a shift register construction isn't possible so I'm not really getting anywhere. A linked tunnel is also not working properly. Do you have any ideas?
@Adilo: I'm afraid I can't open the file, as it is from a newer LabView version than the one I am using (2011 v11.0) 😞
06-28-2013 04:44 AM
This should work 🙂
06-28-2013 08:13 AM
Raphael,
Adilo's answer suits perfectly what you wanted.
I recommend that you give him some kudos 😄
Regards
07-01-2013 07:06 AM
Allright, thanks guys, with your help I've managed to get what I aimed for!
The result is a programm that monitors some signals continously and records their values into a spreadsheet everytime you press a button, adding headers for the columns in the case that a new file is created.