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

5 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Manish Annappa
Manish Annappa el 10 de Jul. de 2017
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'.

Más respuestas (0)

Categorías

Más información sobre Instrument Control Toolbox Supported Hardware en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by