Jump to content

Which of these alternatives is to prefer?


Johan Svensson

Recommended Posts

...

alt1 - is using an array... wouldn't it nessesary to empety this now and then?

alt2 - Better? safer (in terms of memory handling)?

...

Hi,

Does alt1 write all data sampled during 1h? If so then I would recommend that you use alt2, as you don't want to loose data if the computer crashes after 45min. :(

If you are running late in the alt2 case, try to separate file writing into another loop, sending data through a queue (or an RT-FIFO).

You could also configure the DAQmx to return 1000 samples in one shot, and then write 1000 samples at the time to the file.

The loop time would then be 1s instead of 1ms, and sampling is performed by HW (i.e. with more precise timing).

/J

Link to comment

HI,

I have here two alternatives to create a spreadsheet file of measurement values and report header. This will be used as a sub-vi that should run continuously for about an hour.

alt1 - is using an array... wouldn't it nessesary to empety this now and then?

alt2 - Better? safer (in terms of memory handling)?

"sample rate": 1kHz

"samples to read": 100

[/

When you read for an hour, what is the sample rate?

Since I use databases to store data, I always wonder why anyone would choose to put the data in a spreadhseet. The greater the quantity of data the more I wonder.

Do you have a particular reason to be worried about memory handling?

These are not rhetorical questions, depending on the answers I have some thoughts to share.

Also, code is better than screen dumps for sharing LabVIEW. For instance, you have not shown the names of the vi's and functions and I cannot tell exactly which vi's and functions are in the image (my brain memory handling is not sufficient to guess what they are either). With code I could investigate further and try out potential better alternatives.

Mike

Link to comment
OK, sorry about the late answer...

I have listened to your advice and rebuilt my VI around a timed loop, but I'm not sure hot to config it correctly.

http://forums.lavag.org/index.php?showtopic=4876

New sample rate requiremets: 100 Hz at maximum, pehaps lower...

With the new solution I dont se any reason why there should be a limit in "log time"

Am I right ???

Of course there are always limits to everything:

100S/sec * 3600sec/min * 60sec/hr * 24 hr/day = 518,400,000 samples

That will gag an Excel file if such is your intended destination for the data. A brute strength approach to DAQ often runs into problems. Better have the right OS, database, and analysis software if you take this path. :thumbdown: :thumbdown:

Frankly, if you are graphing more than 100 to 1000 points you are wasting points. Beyond that you are going to be more interested in mathematical and statistcal properties of the data not the points themselves: time and frequency domain metrics like slope and frequency, extrema and inflections, mean, median, standard deviation, local extrema, spectrum, etc.

Once again (this is what Mike always says, and the regulars must be tired of reading it), I recommend that you tell us what you want to do in more detail. What are you reading and why? What decisions do you need to make based on the information? You can get really good answers to those questions here beyond mere progamming tutorials.

Mike

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.