Query Instrument - non-numeric value
2 次查看(过去 30 天)
显示 更早的评论
Hi,
i'm writing data of voltage and current to an instrument with scpi commands and it works fine. Now i'm trying to print the meassured data at the power supply controller via a 'query instrument'-block to a display, but receiving the error Response from instrument was non-numeric.
These are my configurations:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1422263/image.png)
Is it possible to handle the response from the instrument with the 'query instrument' block?
Or is it possible to insert MATLAB-Code to my simulink model? Because with matlab code i received the meassured data, but i dont want to do it all by script, but with the simulink model.
THANKS IN ADVANCE!
0 个评论
采纳的回答
Harald
2023-6-30
Hi Tobias,
to answer the final part: you can use the MATLAB Function block to incorporate MATLAB code into Simulink models.
Best wishes,
Harald
4 个评论
Harald
2023-7-4
Hi Tobias,
you need to declare all functions that are not supported for code generation but used in a MATLAB Function block as extrinsic, so e.g. also
coder.extrinsic('serial')
Keep in mind that this would open a new connection every time the block is executed. This may not be desirable.
Thus, I prefer the other approach of creating the connection in MATLAB. What problems did you run into when you tried this?
Best wishes,
Harald
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Direct Interface Communication in Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!