01-05-2015 11:42 PM
Hey everyone/anyone,
I'm trying to do frequency measurements but it is SUPER slow.
I know it's because I'm taking 400 samples for each measurement with TCP/IP connections in each iteration.
But I would be very thankful if someone could take a look at the attached code (it's the engine room only) and let me know how I could make it run faster?
And/or anther method of frequency measurement? I wrote my own code for it using the number of loop iterations between stationary points, but the values are really unstable. Possibly because LabView doesn't run at a constant rate due to being a higher level language?
Love this forum btw, have spend hours and hours reading posts.
Cheers,
Appleseed
01-06-2015 06:08 AM
Appleseed36 wrote:
And/or anther method of frequency measurement? I wrote my own code for it using the number of loop iterations between stationary points, but the values are really unstable. Possibly because LabView doesn't run at a constant rate due to being a higher level language?
No, the points are unstable due to a non-deterministic OS and a non-deterministic data transfer method. Windows cannot promise any consistant time accuracy. I have seen random delays of 50ms just because Windows has to take care of something. And TCP/IP does not guarantee a time of delivery, just that delivery will happen.
If the other system reading this data at a constant rate? Can it send all of the data to you in a single packet? If you have the constant sample rate, that is what is really needed for a proper frequency measurement. And if you can get it all in a single packet, that will help reduce some of the TCP overhead.
01-06-2015 11:40 PM
Hi thanks for the response!
So it's a windows thing plus TCP/IP, that's disappointing. I guess that means that frequency measurement with just one cycle is impossible?
Yes I'm fairly sure it's reading the data from an external sensing system at a constant rate.
I saw a video of a guy do it what I'm trying to do with a microphone and it was super quick and accurate:
https://www.youtube.com/watch?v=DKQT4M7M2Fg
But I guess he was able to take around 800 samples in a single packet?
Looks like I need to talk to the sensing equipment manufacturer, otherwise I'm screwed.