Skip to content

Instantly share code, notes, and snippets.

@joeyv120
Created September 9, 2021 18:41
Show Gist options
  • Save joeyv120/fc1ee5c6cfd9f189fbcdfb49cba4049f to your computer and use it in GitHub Desktop.
Save joeyv120/fc1ee5c6cfd9f189fbcdfb49cba4049f to your computer and use it in GitHub Desktop.
NI-DAQmx device reservation heist
"""Steal a network device for exclusive use regardless of reservation"""
import warnings
import nidaqmx as ni
# ignore warnings from nidaqmx (i.e. network device is already in the system)
warnings.filterwarnings('ignore', module='nidaqmx')
host = 'cDAQ9185-1E00AD8' # ip address or host name
cdaq = ni.system.device.Device(name=host)
cdaq.add_network_device(ip_address=host)
cdaq.reserve_network_device(override_reservation=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment