({{, (RefLink[DeviceReadTimeSeries, paclet:ref/DeviceReadTimeSeries])[device,{t,dt}]
repeatedly reads default items from the specified device at interval dt for a total time t, returning a time series of the resulting values.}, {, (RefLink[DeviceReadTimeSeries, paclet:ref/DeviceReadTimeSeries])[device,{t,dt},param] 
repeatedly reads the parameter param and returns a time series of its values.}, {, (RefLink[DeviceReadTimeSeries, paclet:ref/DeviceReadTimeSeries])[device,{t,dt},{(Subscript[param, 1]),(Subscript[param, 2]),…}]
repeatedly reads the (Subscript[param, i]) and returns a time series of their values.}})

OpenersNotesSection(Spacer1)Details

The time parameters dt and t can be (RefLink[Quantity, paclet:ref/Quantity]) objects containing units. If they are given as pure numbers, they are assumed to be in units of seconds.

(RefLink[DeviceReadTimeSeries, paclet:ref/DeviceReadTimeSeries]) is a blocking function that does not return until it has collected data for time t.

A device can be specified either by a (RefLink[DeviceObject, paclet:ref/DeviceObject]) or by a string representing a device class.

A component of a (RefLink[TimeSeries, paclet:ref/TimeSeries]) object ts corresponding to (Subscript[param, i]) can be obtained from ts["PathComponent",i].

For string parameters, a component can typically be obtained from ts["(Subscript[param, i])"].

OpenersPrimaryExamplesSection(Spacer1)Examples  (5)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Open a demo device:

dev=DeviceOpen["RandomSignalDemo"]

Capture a three-second time series at 0.1-second intervals:

DeviceReadTimeSeries[dev,{3,0.1}]

Plot the time series:

DateListPlot[%]

Repeatedly read a list of parameters from a device and plot the resulting time series:

ts=DeviceReadTimeSeries["RandomSignalDemo",{2,.1},{"Real","Integer"}];

DateListPlot[ts]

Plot a time series for the given parameter:

DateListPlot[ts["Real"]]

OpenersExampleSection2(Spacer1)Applications  (1)

Generate a time series by reading illuminance data from a TinkerForge Weather Station every 0.1 second for five seconds while continuously changing the device orientation:

dev=DeviceOpen["TinkerForgeWeatherStation"]

DeviceConfigure[dev,"AmbientLightBricklet"-> "ibF"];

ts=DeviceReadTimeSeries[dev,{5,0.1},"Illuminance"]

Extract the measured values of the illuminance:

ill=ts["Values"]

Plot the illuminance values:

ListLinePlot[ill,PlotRange-> All]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

For a list of parameters, (RefLink[TimeSeries, paclet:ref/TimeSeries]) components can be accessed by their names:

ts=DeviceReadTimeSeries["RandomSignalDemo",{1,.1},{"Real","Integer"}]

ts["Real"]

ts["Integer"]

Collect a time series from a device and perform some analysis:

ts=DeviceReadTimeSeries[DeviceOpen["RandomSignalDemo"],{1,.1}];

{Mean[ts],MinimumTimeIncrement[ts]}

Plot the interpolated path function of the time series:

Plot[ts["PathFunction"][t],{t,First[ts["Times"]],Last[ts["Times"]]}]

Rescale the time series to run from 0 to 10:

TimeSeriesRescale[ts,{0,10}];

%["Path"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DeviceReadList, paclet:ref/DeviceReadList])  ▪  (RefLink[DeviceReadBuffer, paclet:ref/DeviceReadBuffer])  ▪  (RefLink[DeviceStreams, paclet:ref/DeviceStreams])  ▪  (RefLink[DeviceExecuteAsynchronous, paclet:ref/DeviceExecuteAsynchronous])  ▪  (RefLink[TimeSeries, paclet:ref/TimeSeries])  ▪  (RefLink[EventSeries, paclet:ref/EventSeries])  ▪  (RefLink[AudioRecord, paclet:ref/AudioRecord])  ▪  (RefLink[NetworkPacketRecording, paclet:ref/NetworkPacketRecording])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Developing Device Drivers, paclet:tutorial/DevelopingDeviceDrivers])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Scientific Data Analysis, paclet:guide/ScientificDataAnalysis])}, {▪(RefLinkPlain[Using Connected Devices, paclet:guide/UsingConnectedDevices])}, {▪(RefLinkPlain[Raspberry Pi, paclet:guide/RaspberryPi])}, {▪(RefLinkPlain[External Operations, paclet:guide/ExternalOperations])}, {▪(RefLinkPlain[Weather Data, paclet:guide/WeatherData])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/44-importing-and-exporting.html])(WebLink[: Importing and Exporting, https://www.wolfram.com/language/elementary-introduction/44-importing-and-exporting.html])}})}})