LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change DAQmx sampling rate during execution?

Solved!
Go to solution

Hello guys. I am using LabVIEW in Frequency Response Function measurements. My application requires the sampling rate to change as a function of the frequency of the signal during the execution.

 

I was trying to do this with a "event structure" and it works well when I change the rate manually via front panel control but it dos not work when I configure the sampling rate to vary automatically (just a frequency sweep). Pictures below:

 

Why does not the event structure feel the change in the value of "rate"?

 

Thanks in advance for your help.

 

Lucas

 

 

Download All
0 Kudos
Message 1 of 6
(4,016 Views)
Solution
Accepted by Lucas.Arruda

Hi,

In the "automatic" mode of changing the sampling rate, the calculated rate is written in the local variable (as shown in the code).  Event structure does not recognize change in value in the local variable as a event.

 

Inorder to make the event structure recognize the change in value of an indicator as event: Write the new value to "Value (Sgnl)" Property node corrosponding to the rate indicator (shown in the figure below).  This will make event structure accept value change in indicator as event.

 

Note: Employ architectures such as producer-consumer for such applications which makes the application legible and expandable.

Post back if any queries.

 

 

 

rate_Sgnl.jpg

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 2 of 6
(4,000 Views)

Thank you very much JK1, it should definetly work. The problem is that I just can't find this property node shown in the figure. Sorry, I'm pretty new in Labview. Where can I find this node?

 

 

 

Edit: Never mind. Just found it!

0 Kudos
Message 3 of 6
(3,986 Views)

Smiley Happy

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 4 of 6
(3,983 Views)

It didn't work. Did I do something wrong? Picture above.

 

It is strange this spare "rate" control. This very simple program has no control, the frequency varies programmatically.

 

Regards,

Lucas

0 Kudos
Message 5 of 6
(3,975 Views)

It worked! Smiley Very Happy

0 Kudos
Message 6 of 6
(3,943 Views)