LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling frequency in timed loop

Hi Guys. I used timed loop, is it my current sampling frequency from Figure 1 is 10kHz? if I want to change for example to 2.5kHz, should I just change 100 constant to 400?

 

Thank you.

0 Kudos
Message 1 of 13
(4,806 Views)
First things first, what hardware are you running this code on?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 13
(4,750 Views)

Hi Mike,

 

NI myRIO-1900. I am using Audio in and Audio out jack plugs.

 

 

0 Kudos
Message 3 of 13
(4,745 Views)
Then, yes you are correct, but you have a problem in the form of those two express VIs. The way the code is written, the analog input and analog outptput tasks will be opened and closed with every iteration.

What you need to do is open those tasks one time before the loop starts and then close them when the loop stops.

Mike....

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 13
(4,664 Views)

Hi Mike,

 

How I can make loudspeaker and microphone work before the loop starts when they are inside the loop? Can you suggest the way, because I didn't understand why we need that and how it can be changed. 

 

Thank you Mike.

0 Kudos
Message 5 of 13
(4,640 Views)
You have to take apart the functionality that is in the express VIs.

First right click on each one and select the option to open their front panel. You will get a warning about conversions, just say OK.

Second, these conversions will create two new VIs. Save them somewhere in your project.

Third, open each one and look at what it does. In general, you should see the code open a reference, read or write to it and then close it.

Fourth, you need to recode things so the open operations occur before the loop starts and the closes happen after the loop stops.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 13
(4,634 Views)

There is no option to open front panel, only this options

Download All
0 Kudos
Message 7 of 13
(4,599 Views)

@mikeporter wrote:
Then, yes you are correct, but you have a problem in the form of those two express VIs. The way the code is written, the analog input and analog outptput tasks will be opened and closed with every iteration.

Sorry Mike, but that is wrong.  We are dealing with a myRIO here, which behaves exactly the same as a cRIO.  The IO is directly off of an FPGA.  There is no task to open and close.

 

Though, I would question the actual sample rate.  If the scan engine is being used, then the channels are actually sampled more like 100Hz.  Please attach your entire project (put it into a zip file first) so we can get a little more insight to how things are set up.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 13
(4,542 Views)

Hi Crossrulz,

 

This is a full program that I use. Active Noise Control with FxLMS. Together with code I attached picture (set up of hardware)

 

Thank you

0 Kudos
Message 9 of 13
(4,525 Views)

The important information I was looking for is in the project file.  You failed to include that.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 13
(4,510 Views)