Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
This code is meant to read off a data stream from a creep frame and continuously save it until told to stop by attached ui. The problem is I had to move it to a new computer and reinstall everything necessary. Now I am getting a error from line 30 which states startBackground(s);
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
here is the input code i used. a separate Ui is created where the controlling properties like time interval, radius, initial length, triaxality and displacement increment are told. along with a folder designated, and name of output file. What should happen is that once i press run, the program should start recording the data after file directory is selected. Instead as soon as file directory is selected I get the error.
here is the code
clc;clear;
% c is a struct
c.Date = clock;
c.Rate = 10;
%% Reading/Setting DAQ
s = daq.createSession(‘dt’);
s.addAnalogInputChannel(‘DT9804(00)’,’0′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’1′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’2′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’3′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’4′,’Voltage’);
s.Rate = c.Rate; % Background acuisition rate
%%
% Display graphical user interface
hGui = createDataCaptureUI(s);
% Add a listener for DataAvailable events and specify the callback function
dataListener = addlistener(s, ‘DataAvailable’, @(src,event) dataCapture(src, event, c, hGui));
% Start continuous background data acquisition
s.IsContinuous = true;
startBackground(s);
% Wait until session s is stopped from the UI
while s.IsRunning
pause(0.5);
end
delete(dataListener);
delete(s);
I looked up solutions to the error online. but they do not seem to apply.
the gui file doesn’t seem to be the source of the problemThis code is meant to read off a data stream from a creep frame and continuously save it until told to stop by attached ui. The problem is I had to move it to a new computer and reinstall everything necessary. Now I am getting a error from line 30 which states startBackground(s);
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
here is the input code i used. a separate Ui is created where the controlling properties like time interval, radius, initial length, triaxality and displacement increment are told. along with a folder designated, and name of output file. What should happen is that once i press run, the program should start recording the data after file directory is selected. Instead as soon as file directory is selected I get the error.
here is the code
clc;clear;
% c is a struct
c.Date = clock;
c.Rate = 10;
%% Reading/Setting DAQ
s = daq.createSession(‘dt’);
s.addAnalogInputChannel(‘DT9804(00)’,’0′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’1′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’2′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’3′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’4′,’Voltage’);
s.Rate = c.Rate; % Background acuisition rate
%%
% Display graphical user interface
hGui = createDataCaptureUI(s);
% Add a listener for DataAvailable events and specify the callback function
dataListener = addlistener(s, ‘DataAvailable’, @(src,event) dataCapture(src, event, c, hGui));
% Start continuous background data acquisition
s.IsContinuous = true;
startBackground(s);
% Wait until session s is stopped from the UI
while s.IsRunning
pause(0.5);
end
delete(dataListener);
delete(s);
I looked up solutions to the error online. but they do not seem to apply.
the gui file doesn’t seem to be the source of the problem This code is meant to read off a data stream from a creep frame and continuously save it until told to stop by attached ui. The problem is I had to move it to a new computer and reinstall everything necessary. Now I am getting a error from line 30 which states startBackground(s);
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
here is the input code i used. a separate Ui is created where the controlling properties like time interval, radius, initial length, triaxality and displacement increment are told. along with a folder designated, and name of output file. What should happen is that once i press run, the program should start recording the data after file directory is selected. Instead as soon as file directory is selected I get the error.
here is the code
clc;clear;
% c is a struct
c.Date = clock;
c.Rate = 10;
%% Reading/Setting DAQ
s = daq.createSession(‘dt’);
s.addAnalogInputChannel(‘DT9804(00)’,’0′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’1′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’2′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’3′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’4′,’Voltage’);
s.Rate = c.Rate; % Background acuisition rate
%%
% Display graphical user interface
hGui = createDataCaptureUI(s);
% Add a listener for DataAvailable events and specify the callback function
dataListener = addlistener(s, ‘DataAvailable’, @(src,event) dataCapture(src, event, c, hGui));
% Start continuous background data acquisition
s.IsContinuous = true;
startBackground(s);
% Wait until session s is stopped from the UI
while s.IsRunning
pause(0.5);
end
delete(dataListener);
delete(s);
I looked up solutions to the error online. but they do not seem to apply.
the gui file doesn’t seem to be the source of the problem property assignment, create array element, oop MATLAB Answers — New Questions