Writing GPIB Commands in App Designer
4 次查看(过去 30 天)
显示 更早的评论
Hello Matlab Community,
I am trying to migrate a labview VI functionality to matlab App Designer. We previously collected data through labview, then plotted it to matlab. We are using an HP4396B Spectrum/Network Analyzer. The hardware is really old and can't communicate with modern drivers. I would mirror the type of programming this example uses - https://www.mathworks.com/help/instrument/examples/reading-inphase-and-quadrature-iq-data-from-a-signal-analyzer-over-tcp-ip.html#d120e1234 - There is an oscilliscope example - https://www.mathworks.com/matlabcentral/fileexchange/69847-oscilloscope-app - that scans for local instruments and connects to a desired resource. It has the ability to change channels while inserting specific parameters.
I would love something similar so my team can input desired start/stop freqeuncy ranges, update the settings, run a single sweep, then plot the data to a UIAxes. I am able to connect to the instrument in a startupFcn, but when it comes to using fprintf, nothing happens. For example the command [fprintf(app.obj1, 'FORM4;CORR 0')] does not write to my analyzer when viewing the Test and Measurement Tool Communicate tab.
Note, having the fprintf commands work in a regular *.m script, but does not execute when placing them in my *.mlapp script. Last week was spent researching and I can't find any YT video or documentation over the syntax.
Sorry if this answer was already asked.
Thanks!
3 个评论
Kristoffer Franzén
2021-4-28
I'm trying to migrate TestPoint functionality to Matlab for doing hall measurements among other things. I need to communicate with several instruments over GPIB. I'm trying to get them to return an id in the startupFcn but to no avail.
I wasn't really sure where in the generated code it's best practice to connect to the instruments, so I thought I'd shoot a question your way, seeing that you also connected at the startupFnc.
Now I gather this is the way to go. I'll sure check the code for the oscilloscope and my instruments.
Thank you for taking your time to answer and for good tips!
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!