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

5 次查看(过去 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 CenterFile Exchange 中查找有关 Instrument 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