Created
September 9, 2021 18:41
-
-
Save joeyv120/fc1ee5c6cfd9f189fbcdfb49cba4049f to your computer and use it in GitHub Desktop.
NI-DAQmx device reservation heist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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