"ServerID must be a string" problem
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nikolay Panasetsky
le 30 Nov 2015
Commenté : Nikolay Panasetsky
le 30 Nov 2015
I can not read the data from the dialogue box to connect the OPC server. The error occurs: "ServerID must be a string"
Here's the code:
function Newhost_Callback(hObject, eventdata, handles)
prompt = {'Host name:'};
dlg_title = 'Input';
num_lines = 1;
defaultans = {'Matrikon.OPC.Simulation.1'};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans);
da = opcda('localhost', answer);
connect(da);
0 commentaires
Réponse acceptée
Walter Roberson
le 30 Nov 2015
inputdlg() always returns a cell array, not a single string.
da = opcda('localhost', answer{1});
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!