({{, (RefLink[DeviceObject, paclet:ref/DeviceObject])[…] 
represents a device that can be accessed in a Wolfram Language session.}})

OpenersNotesSection(Spacer1)Details

For a device object dev, dev["prop"] gives the current value of a property prop for the device.

For appropriate properties, dev["prop"]=val can be used to reset the value of a property.

dev[{"(Subscript[prop, 1])","(Subscript[prop, 2])",…}]={(Subscript[val, 1]),(Subscript[val, 2]),…} sets values of multiple properties.

dev[] gives a list of properties that can be used to access capabilities of the device.

Typical properties available for devices may include:

Individual properties, as well as native properties, can usually be specified just by giving their names. In the case of a conflict, dev["NativeProperties","prop"] accesses a native property.

OpenersPrimaryExamplesSection(Spacer1)Examples  (8)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

(RefLink[DeviceOpen, paclet:ref/DeviceOpen]) returns a (RefLink[DeviceObject, paclet:ref/DeviceObject]) expression:

DeviceOpen["RandomSignalDemo"]

Use a (RefLink[DeviceObject, paclet:ref/DeviceObject]) to read data from a device:

dev=DeviceOpen["RandomSignalDemo"]

DeviceRead[dev]

OpenersExampleSection1(Spacer1)Scope  (4)

Use a (RefLink[DeviceObject, paclet:ref/DeviceObject]) to access a device for writing and reading:

dev=DeviceOpen["WriteDemo"]

DeviceWrite[dev,DateString[]];

DeviceRead[dev]

Query a device property:

dev=DeviceOpen["RandomSignalDemo"]

dev["Properties"]

val=dev["BufferLength"]

Assign a new value to this property:

dev["BufferLength"]=3

Verify the new setting and close the device:

dev["BufferLength"]

DeviceClose[dev]

Access a property with a qualifier:

dev=DeviceOpen["RandomSignalDemo"];

dev["Properties","BufferLength"]

Use a (RefLink[DeviceObject, paclet:ref/DeviceObject]) to read time series data from a device and then close the device:

dev=DeviceOpen["RandomSignalDemo"];

DeviceReadTimeSeries[dev,{1,0.1}]

DeviceClose[dev]

OpenersExampleSection3(Spacer1)Applications  (2)

Open a connection to the default camera attached to your system and read a frame from it:

dev=DeviceOpen["Camera"]

DeviceRead[dev]

Close the connection:

DeviceClose[dev]

Open a connection to a weather station and use its (RefLink[DeviceObject, paclet:ref/DeviceObject]) as an argument to (RefLink[DeviceConfigure, paclet:ref/DeviceConfigure]) and (RefLink[DeviceWrite, paclet:ref/DeviceWrite]):

dev=DeviceOpen["TinkerForgeWeatherStation"]

DeviceConfigure[dev,"LCDBrickletUID"-> "gLp"];

DeviceWrite[dev,"This is a string"];

DeviceClose[dev]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DeviceOpen, paclet:ref/DeviceOpen])  ▪  (RefLink[Devices, paclet:ref/Devices])  ▪  (RefLink[FindDevices, paclet:ref/FindDevices])  ▪  (RefLink[SocketObject, paclet:ref/SocketObject])}})}})

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

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Using Connected Devices, paclet:guide/UsingConnectedDevices])}, {▪(RefLinkPlain[Raspberry Pi, paclet:guide/RaspberryPi])}})}})