How to run GPIB communication in background for real-time processing with multiple instruments, Keithley plus NI?

6 ビュー (過去 30 日間)
How can I continuously read data from a GPIB communication (from Keithley SMU 2450) in the background (in the way that Data Acquisition Toolbox commands have "startBackground(s)" as opposed to "startForeground") ?
Details- I want to read voltage input continuously from a Keithley SMU 2450 through the GPIB port and have used fopen, fprint, etc commands before to do a single sweep and plot data, but I want to run it continuously now. I want to feed that data into a control loop and perform some analysis, then output continuous results to a NI PCIe 63xx board with analog output (using the Data Acquisition analog output real time commands, in the background). At the same time I want to be able to control other intruments with their own independent MATLAB codes.
Is there an analogous way to do the GPIB commands in the background? Or would I by limited to just using loops with the GPIB commands (with the whole analysis blocks also in the loops?) for continuous reading of data in real time data? Apologies, newbie at this, spent quite some time digging around and understanding the DAQ toolbox and simple GPIB commands.

採用された回答

Manish Annappa
Manish Annappa 2017 年 7 月 10 日
You can achieve this using 'BytesAvailableFcn' callback. In addition, you can use the 'BytesAvailableFcnCount' property set the number of bytes after which the callback function set in 'BytesAvailableFcn' is called. Refer to the link below for more information on 'BytesAvailableFcn'.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInstrument Control Toolbox Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by