Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import PyDAQmx
- #from PyDAQmx import Task
- import numpy as np
- import time
- import pdb
- import weakref
- from ctypes import *
- import sys
- sys.path.insert(1, 'nidaqmx-python')
- from nidaqmx import Task
- # Simple class that can be used to control one Digital output line
- class DO(Task):
- def __init__(self, dev):
- Task.__init__(self)
- self.do_channels.add_do_chan(dev)
- self.write(False)
- def __del__(self):
- self.write(False)
- def high(self):
- self.write(True)
- def low(self):
- self.write(False)
- if __name__ == '__main__':
- dig_0 = DO('/cDAQ1Mod1/port0/line0')
- dig_0.high()
Advertisement
Add Comment
Please, Sign In to add comment