Clear Filters
Clear Filters

Live data capturing AND recording from NI dynamometer in app

5 views (last 30 days)
Hi everyone,
as I'm embarking on quite a large project, and am new to this side of MATLAB, I wanna make sure I take the correct road from the get go.
The goal is to have a MATLAB app that displays a live plot of dynamometer force data (NI and connected directly to the pc), AND incrementaly storing that data in a global variable. As in, I want to plot the dyno data as it comes in, but also store it for later use.
Currently, I am stuck, as I can either live plot OR store it, but not both simultaneously.
That said, I have been looking into background v foregorund and 'readwrite' stuff, but I'm kind of lost there. Any pointers would be great!
Dennis Premoli
Dennis Premoli on 5 Aug 2022
Edited: Dennis Premoli on 5 Aug 2022
Is there a maximum recording size, such that the variable could be pre-allocated?
No, the data gathered is frrom a machining process, therefore dependant on RPM, feed and the size of the material. All of these could change, drastically changing the time required for a full data capture. (We're talking even like 30 minutes runs).
What sampling rate are you hoping for, and what latency is acceptable for plotting?
Sample rate is unoptimised as of now adn we don't ahev a set target per se (but high in general). We are currently running at 25kHz but this could be turned down (relatively) if filesizes become stupid.
The live plotting doesn't need to be instantaneous or anything. A refresh every 0.5-1s seems reasonable?
Or are you using something like an NIDAQ chassis connected by way of USB ?
Truth is, we know this is possible to a good degree of polish as a similar app has been produced and shown to us. Unfortunately we don't have access to its source code to just lift it and apply to ours :/
Walter Roberson
Walter Roberson on 6 Aug 2022
The space requirement would be... let's see... making some wild guesses...
I speculate that you will want a precision at least as high as 0.1 rpm, and that you might want to measure more than 6553 rpm, so I speculate that you might not be able to pack the readings into 2 bytes... but maybe you can
format long g
sample_rate = 25000;
number_of_dynamometers = 2; %?
samples_per_dynamometer = 3; %? X Y Z
bytes_per_sample = 4;
run_time = 30 * 60; %seconds
bytes_per_second = sample_rate * number_of_dynamometers * samples_per_dynamometer * bytes_per_sample
bytes_per_second =
bytes_per_run = bytes_per_second * run_time
bytes_per_run =
Gb_per_run = round(bytes_per_run / 2^30,1)
Gb_per_run =
... that would be quite do-able. You could pre-allocate for the largest expected run, or you could use

Sign in to comment.

Answers (0)


Find more on Startup and Shutdown in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!