DeviceReadLatest[device]
returns the most recently collected default item from a device.
DeviceReadLatest[device,n]
returns a list of the n most recently collected items.
DeviceReadLatest[device,n,param]
returns the n most recently collected values of param.
DeviceReadLatest[device,n,{param1,param2,…}]
returns a list of the most recently collected values of the parami.
DeviceReadLatest
DeviceReadLatest[device]
returns the most recently collected default item from a device.
DeviceReadLatest[device,n]
returns a list of the n most recently collected items.
DeviceReadLatest[device,n,param]
returns the n most recently collected values of param.
DeviceReadLatest[device,n,{param1,param2,…}]
returns a list of the most recently collected values of the parami.
Details
- A device can be specified either by a DeviceObject or by a string representing a device class.
- Only devices from which data is continuously collected support DeviceReadLatest.
- DeviceReadLatest is a non-blocking function. It uses data already collected from a device, and does not request additional data.
- DeviceReadLatest[device,n] may return a list shorter than n elements if not enough pre-collected data is available.
- DeviceReadLatest[device,n] returns data with the oldest first in the list.
Examples
open all close allBasic Examples (1)
Continuously read random numbers from a demo device and plot the latest points dynamically:
dev = DeviceOpen["RandomSignalDemo"];task = SessionSubmit[ScheduledTask[DeviceRead[dev], .2]];Dynamic[ListLinePlot[DeviceReadLatest[dev, 50]]]Remove the task and close the device connection:
TaskRemove[task];DeviceClose[dev]Applications (1)
Configure a weather station device for reading the ambient illuminance:
dev = DeviceOpen["TinkerForgeWeatherStation"];
DeviceConfigure[dev, "AmbientLightBrickletUID" -> "ibF"];Collect 100 samples of data while manually orienting the sensor toward and away from a light source:
task = SessionSubmit[ScheduledTask[DeviceRead[dev, "Illuminance"], 0.1]];ill = DeviceReadLatest[dev, 100, "Illuminance"];ListPlot[ill, Filling -> Axis]Stop the scheduled task and close the connection:
TaskRemove[task];
DeviceClose[dev];Tech Notes
Related Guides
History
Text
Wolfram Research (2014), DeviceReadLatest, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceReadLatest.html.
CMS
Wolfram Language. 2014. "DeviceReadLatest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeviceReadLatest.html.
APA
Wolfram Language. (2014). DeviceReadLatest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeviceReadLatest.html
BibTeX
@misc{reference.wolfram_2026_devicereadlatest, author="Wolfram Research", title="{DeviceReadLatest}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DeviceReadLatest.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_devicereadlatest, organization={Wolfram Research}, title={DeviceReadLatest}, year={2014}, url={https://reference.wolfram.com/language/ref/DeviceReadLatest.html}, note=[Accessed: 12-June-2026]}