필터 지우기
필터 지우기

Live data capturing AND recording from NI dynamometer in app

조회 수: 8 (최근 30일)
Dennis Premoli
Dennis Premoli 2022년 8월 5일
댓글: Walter Roberson 2022년 8월 6일
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!
Thanks.
  댓글 수: 3
Dennis Premoli
Dennis Premoli 2022년 8월 5일
편집: Dennis Premoli 2022년 8월 5일
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 ?
This^
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 2022년 8월 6일
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 =
600000
bytes_per_run = bytes_per_second * run_time
bytes_per_run =
1080000000
Gb_per_run = round(bytes_per_run / 2^30,1)
Gb_per_run =
1
... that would be quite do-able. You could pre-allocate for the largest expected run, or you could use https://www.mathworks.com/matlabcentral/fileexchange/8334-incremental-growth-of-an-array-revisited?s_tid=srchtitle

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by