DeviceWriteBuffer[device,vals]
fills the buffer on a device with the values vals.
DeviceWriteBuffer[device,paramvals]
fills the buffer associated with the parameter param with the values vals.
DeviceWriteBuffer[device,{param1vals1,param2vals2,…}]
fills the buffers associated with the parami with the corresponding values valsi .
DeviceWriteBuffer
DeviceWriteBuffer[device,vals]
fills the buffer on a device with the values vals.
DeviceWriteBuffer[device,paramvals]
fills the buffer associated with the parameter param with the values vals.
DeviceWriteBuffer[device,{param1vals1,param2vals2,…}]
fills the buffers associated with the parami with the corresponding values valsi .
Details
- A device can be specified either by a DeviceObject or by a string representing a device class.
- DeviceWriteBuffer is a blocking function; when called, it communicates with the device and does not return until it has finished writing data.
- DeviceWriteBuffer[device,vals] returns vals, even if for some reason the write operation fails.
Examples
open all close allBasic Examples (2)
Write a list of strings to the buffer of a demo device and retrieve the result:
dev = DeviceOpen["WriteDemo"];DeviceWriteBuffer[dev, {"This", "is", "a", "list"}];DeviceReadBuffer[dev]DeviceClose[dev]Write a list of values to the buffer associated with a specified parameter:
dev = DeviceOpen["WriteDemo"]DeviceWriteBuffer[dev, "date" -> DateList[]]Read the buffer to verify successful writing:
DeviceReadBuffer[dev, All, "date"]Applications (2)
Open a serial connection to an Arduino running a custom program called sketch:
dev = DeviceOpen["Serial", "/dev/ttyACM0"]Write a string to the device buffer to light up an LED connected to the Arduino board:
DeviceWriteBuffer[dev, "LED On"];Write a sequence of bytes to temporarily put a Sphero robotic ball in the sleep mode:
dev = DeviceOpen["SerialDemo", "*Sphero*"]str = FromCharacterCode[{255, 255, 0, 34, 5, 6, 0, 5, 0, 0, 0, 205}];DeviceWriteBuffer[dev, str];Tech Notes
Related Guides
History
Text
Wolfram Research (2014), DeviceWriteBuffer, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html.
CMS
Wolfram Language. 2014. "DeviceWriteBuffer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html.
APA
Wolfram Language. (2014). DeviceWriteBuffer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html
BibTeX
@misc{reference.wolfram_2026_devicewritebuffer, author="Wolfram Research", title="{DeviceWriteBuffer}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_devicewritebuffer, organization={Wolfram Research}, title={DeviceWriteBuffer}, year={2014}, url={https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html}, note=[Accessed: 12-June-2026]}