When I turn off interactivity with my Axes, I get the error "Dot indexing is not supported for variables of this type."

1 visualización (últimos 30 días)
When I uncomment the disableDefaultInteractivity I get the error "
function scansAvailable_Callback(app, src, ~)
% Callback function executed on DAQ object ScansAvailable event
% Check if the app object is still valid
if ~isvalid(app)
return
end
% Read data from the DAQ object
[app.data, timestamps, ~] = read(src, src.ScansAvailableFcnCount, 'OutputFormat', 'Matrix');
% read in slopes&intercepts from the live script
app.sl = evalin('base','slopes');
app.int = evalin('base','intercepts');
% Calibration
if app.calibrate
% calibratedData = double;
calibratedData = calibrateData(app,app.data, app.sl, app.int, app.indices);
else
% If calibration is turned off, use raw data
calibratedData = app.data;
end
% Logging
if app.LogRequested
logDataToFile(app, timestamps);
end
% Store continuous acquisition data in FIFO data buffers
buffersize = round(app.DAQ.Rate * app.TimewindowEditField.Value) + 1;
app.TimestampsFIFOBuffer = storeDataInFIFO(app, app.TimestampsFIFOBuffer, buffersize, timestamps);
app.DataFIFOBufferch1 = storeDataInFIFO(app, app.DataFIFOBufferch1, buffersize, calibratedData(:, app.indices));
% Plotting (Update the plot every N data points received)
updatePlotInterval = 10; % Adjust this value based on your preference
if mod(src.ScansAvailableFcnCount, updatePlotInterval) == 0
updateLivePlot(app);
end
end
function updateLivePlot(app)
% Update the live plot
% Display information for debugging
disp('Debugging Information:');
disp(['LiveAxes class: ', class(app.LiveAxes)]);
disp(['TimestampsFIFOBuffer size: ', num2str(size(app.TimestampsFIFOBuffer))]);
disp(['DataFIFOBufferch1 size: ', num2str(size(app.DataFIFOBufferch1))]);
% Plot the data
plot(app.LiveAxes, app.TimestampsFIFOBuffer, app.DataFIFOBufferch1)
app.LiveAxes.Interactions = [zoomInteraction];
% Adjust the x-axis limits if there's enough data
if numel(app.TimestampsFIFOBuffer) > 1
xlim(app.LiveAxes, [app.TimestampsFIFOBuffer(1), app.TimestampsFIFOBuffer(end)])
end
% disableDefaultInteractivity(app.LiveAxes)
end
I get the error on the line below:
case 'configuration'
app.RateEdit.Enable = 'on';
app.RateSlider.Enable = 'on';
app.DeviceDropDown.Enable = 'on';
app.MeasurementTypeDropDown.Enable = 'on';
app.RangeDropDown.Enable = 'on';
app.StartButton.Enable = 'on';
app.LogdatatofileSwitch.Enable = 'on';
app.StopButton.Enable = 'off';
app.TimewindowEditField.Enable = 'on';
switch app.DAQ.Channels(1).MeasurementType
case 'Voltage'
% Voltage channels do not have ExcitationSource
% property, so disable the corresponding UI controls
app.TerminalConfigDropDown.Enable = 'on';
app.CouplingDropDown.Enable = 'on';
app.ExcitationSourceDropDown.Enable = 'off';
case 'Audio'
% Audio channels do not have TerminalConfig, Coupling, and ExcitationSource
% properties, so disable the corresponding UI controls
app.TerminalConfigDropDown.Enable = 'off';
app.CouplingDropDown.Enable = 'off';
app.ExcitationSourceDropDown.Enable = 'off';
case 'IEPE'
app.TerminalConfigDropDown.Enable = 'on';
app.CouplingDropDown.Enable = 'on';
app.ExcitationSourceDropDown.Enable = 'on';
The app runs normally when it is commented out but, When I hover my mouse over the graph during live collection it lags out the plot. Sometimes it will work but then the colours on the graph will continually change. Does anyone have any suggestions for this?
Dot indexing is not supported for variables of this type.
Error in LiveDataAcquisition_MultiChannel_SingleCal_ChatGPT/setAppViewState (line 228)
switch app.DAQ.Channels(1).MeasurementType
Error in LiveDataAcquisition_MultiChannel_SingleCal_ChatGPT/StartButtonPushed (line 685)
setAppViewState(app, 'configuration');
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, ...
Error using daq.ni.AsyncIOInputChannel/closeStream
Error while evaluating Button PrivateButtonPushedFcn.
I have also added the error message that I get. I am working off of one of the examples "Live data acquistion" but modifying its useage so the data displayed can be "calibrated" and so that in the UI the user can collect from multiple channels and pick how many.
Thanks

Respuesta aceptada

Connor
Connor el 21 de Feb. de 2024
this has now been resolved though I am not sure how lol

Más respuestas (0)

Categorías

Más información sobre Data Acquisition Toolbox Supported Hardware en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by