Azzera filtri
Azzera filtri

GUI commands transition from R2007 to R2018

21 visualizzazioni (ultimi 30 giorni)
Irina
Irina il 4 Giu 2024
Risposto: Irina il 18 Giu 2024
Hello, I need to update data aquisition software from R2007 to R2018 and add PID controller. Script seems to work after transition from legacy based inerface to session based, but I have multiple errors when push bottons in gui:
Error using neurosys_4v5>DCLED_BUTTON_Callback (line 1051)
When using session based operations, use outputSingleScan.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in neurosys_4v5 (line 41)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)neurosys_4v5('DCLED_BUTTON_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Lines 1050 - 1053:
else
putsample(handles.out,[0 get(handles.DCLAMP_BUTTON, 'value')*str2double(get(handles.DCLAMP_VALUE, 'String'))...
handles.DC_OFFSET+0 handles.DC_OFFSET+0]);
end
Error using neurosys_4v5>loadstimulus (line 859)
When using session based operations, use outputSingleScan.
Error in neurosys_4v5>loadstimpushbutton_Callback (line 1072)
[handles] = loadstimulus(handles);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in neurosys_4v5 (line 41)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)neurosys_4v5('loadstimpushbutton_Callback',hObject,eventdata,guidata(hObject))
Lines 858-862:
else
putsample(handles.out,[0 get(handles.DCLAMP_BUTTON, 'value')*str2double(get(handles.DCLAMP_VALUE, 'String'))...
handles.DC_OFFSET+handles.L_gain*get(handles.tpl_checkbox,'Value')*handles.DCLED_ON*handles.DCLED-handles.DC_OFFSET*(handles.DCLED_ON > 0)...
handles.DC_OFFSET+handles.L2_gain*get(handles.tpl2_checkbox,'Value')*handles.DCLED_ON*handles.DCLED-handles.DC_OFFSET*(handles.DCLED_ON > 0)])
end
lines 1071-1073:
function loadstimpushbutton_Callback(hObject, eventdata, handles)
[handles] = loadstimulus(handles);
guidata(hObject, handles);
could you please tell where I can find any instructions how to update these commands & fix error messages for gui?

Risposta accettata

R
R il 13 Giu 2024
The issues are likely stemming from the switch from the older DAQ interface techniques (putsample) to the newer session-based interface in MATLAB, a change that occurred with versions released around 2016.
The commands have undergone some modifications, for instance, `outputSingleScan` is now used for executing a single sample DAQ session instead of `putsample(handles.out, [...])`. Thus, you should replace this with `outputSingleScan(handles.out, [...])`. For further details on the legacy functionalities, their new usage formats, and other relevant compatibility information, execute the command below in your MATLAB command window:
web(fullfile(docroot, 'daq/release-notes.html?searchHighlight=putsample'))
Additionally, for assistance in moving from the legacy to the session-based interface, consult the guide which lists the legacy functionality, new use format and other compatibility considerations at:
web(fullfile(docroot, 'daq/transition-your-code-to-session-based-interface.html?searchHighlight=Transition%20Your%20Code%20to%20Session-Based%20Interface'))
For documentation on `outputSingleScan`, refer to:
web(fullfile(docroot, 'daq/ref/outputsinglescan.html?searchHighlight=outputSingleScan&s_tid=doc_srchtitle'))
Also, as an important note, starting from R2020a, it is advised to utilize the DataAcquisition interface.

Più risposte (1)

Irina
Irina il 18 Giu 2024
Thank you, R! "putsample" error is fixed now. However, I still need help as all other errors are still there. For example, these two as I understood are related to new graphic system introduced in Matlab2014b:
Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in neurosys_ERG (line 40)
gui_mainfcn(gui_State, varargin{:});
Any suggestion how to fix these two?

Community Treasure Hunt

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

Start Hunting!

Translated by