DeviceClose[device]
closes the connection to a device and frees related resources.


DeviceClose
DeviceClose[device]
closes the connection to a device and frees related resources.
Details

- Devices are represented by a DeviceObject or by a string giving the name of a device class.
- DeviceClose closes any open streams to and from the device and releases external resources associated with the device.
Examples
open all close allBasic Examples (2)
Applications (3)
Open a connection to a serial device and then close it:
Open a connection to a weather station device, read in temperature data, and then close the connection:
Open the default camera attached to your system and close it after five seconds:
See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2014), DeviceClose, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceClose.html.
CMS
Wolfram Language. 2014. "DeviceClose." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeviceClose.html.
APA
Wolfram Language. (2014). DeviceClose. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeviceClose.html
BibTeX
@misc{reference.wolfram_2025_deviceclose, author="Wolfram Research", title="{DeviceClose}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DeviceClose.html}", note=[Accessed: 14-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_deviceclose, organization={Wolfram Research}, title={DeviceClose}, year={2014}, url={https://reference.wolfram.com/language/ref/DeviceClose.html}, note=[Accessed: 14-August-2025]}