LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling a continous Signal (Novice)

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

 

 

0 Kudos
Message 1 of 9
(3,452 Views)

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

 


 

Mondoni
Message 2 of 9
(3,433 Views)

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.

0 Kudos
Message 3 of 9
(3,411 Views)

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

Mondoni
0 Kudos
Message 4 of 9
(3,400 Views)

Does this help you?

0 Kudos
Message 5 of 9
(3,384 Views)

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) 😞

0 Kudos
Message 6 of 9
(3,360 Views)

This should work 🙂

Message 7 of 9
(3,353 Views)

Raphael,

 

Adilo's answer suits perfectly what you wanted.

I recommend that you give him some kudos 😄


Regards

Mondoni
Message 8 of 9
(3,339 Views)

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.

0 Kudos
Message 9 of 9
(3,314 Views)