DeviceExecute[device,"command"]
executes the specified command on a device.
DeviceExecute[device,"command",params]
executes the command with the parameters params.
DeviceExecute
DeviceExecute[device,"command"]
executes the specified command on a device.
DeviceExecute[device,"command",params]
executes the command with the parameters params.
Details
- A device can be specified either by a DeviceObject or by a string representing a device class.
- DeviceExecute is a blocking function; when called, it communicates with the device and does not return until it has the data it needs.
- The parameters params can be given either as a list of raw parameters or as an association or list of rules giving names and values of parameters.
- DeviceExecute returns a Wolfram Language version of the result of executing the specified command on the device.
Examples
open all close allBasic Examples (2)
Open a demo device and execute a command on it:
dev = DeviceOpen["FunctionDemo"]DeviceExecute[dev, "Date"]Specify a device class to execute the same command:
DeviceExecute["FunctionDemo", "Date"]Execute a command with a specified parameter:
command = "DayName";params = {Today};DeviceExecute["FunctionDemo", command, params]Applications (2)
Open a weather station and write a string to its LCD screen:
dev = DeviceOpen["TinkerForgeWeatherStation"]DeviceConfigure[dev, "LCDBrickletUID" -> "gLp"];DeviceWrite[dev, "This is a string"];Use DeviceExecute to clear the screen:
DeviceExecute[dev, "ClearLCDDisplay"]Write a string of bytes to a Sphero serial device and use DeviceExecute to check if a response is available:
dev = DeviceOpen["SerialDemo", "*Sphero*"]DeviceWrite[dev, FromCharacterCode[{255, 255, 0, 1, 5, 1, 248}]];DeviceExecute[dev, "SerialReadyQ"]Flush the buffered data and check that the buffer is empty:
DeviceExecute[dev, "ReadFlush"]DeviceExecute[dev, "SerialReadyQ"]Tech Notes
Related Guides
History
Text
Wolfram Research (2014), DeviceExecute, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceExecute.html.
CMS
Wolfram Language. 2014. "DeviceExecute." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeviceExecute.html.
APA
Wolfram Language. (2014). DeviceExecute. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeviceExecute.html
BibTeX
@misc{reference.wolfram_2026_deviceexecute, author="Wolfram Research", title="{DeviceExecute}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DeviceExecute.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_deviceexecute, organization={Wolfram Research}, title={DeviceExecute}, year={2014}, url={https://reference.wolfram.com/language/ref/DeviceExecute.html}, note=[Accessed: 12-June-2026]}