-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
260 additions
and
222 deletions.
There are no files selected for viewing
This file contains 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
Binary file not shown.
Binary file added
BIN
+192 Bytes
app/instruments/lockinAmplifier/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file not shown.
This file contains 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
Binary file not shown.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
from abc import ABC, abstractmethod | ||
import random | ||
from time import sleep | ||
# from abc import ABC, abstractmethod | ||
# import random | ||
# from time import sleep | ||
|
||
#For MacOS this import will fail, thats why it is in try/catch block to bypass. | ||
try: | ||
import nidaqmx | ||
except Exception as e: | ||
print(f"Unexpected error: {e}") | ||
# For MacOS this import will fail, thats why it is in try/catch block to bypass. | ||
# try: | ||
# import nidaqmx | ||
# except Exception as e: | ||
# print(f"Unexpected error: {e}") | ||
|
||
class NIDAQBaseClass(ABC): | ||
@abstractmethod | ||
def measure(self): | ||
pass | ||
# class NIDAQBaseClass(ABC): | ||
# @abstractmethod | ||
# def measure(self): | ||
# pass | ||
|
||
class NIDAQ(NIDAQBaseClass): | ||
def measure(self): | ||
try: | ||
with nidaqmx.Task() as task: | ||
task.ai_channels.add_ai_voltage_chan("Dev1/ai5") | ||
data = task.read() | ||
print(f"Acquired data: {data:f}") | ||
return data | ||
# class NIDAQ(NIDAQBaseClass): | ||
# def measure(self): | ||
# try: | ||
# with nidaqmx.Task() as task: | ||
# task.ai_channels.add_ai_voltage_chan("Dev1/ai5") | ||
# data = task.read() | ||
# print(f"Acquired data: {data:f}") | ||
# return data | ||
|
||
except Exception as e: | ||
print(f"Unexpected error: {e}") | ||
# except Exception as e: | ||
# print(f"Unexpected error: {e}") | ||
|
||
class NIDAQDemo(NIDAQBaseClass): | ||
def measure(self): | ||
lower_limit = 0 | ||
upper_limit = 10 | ||
random_number = random.uniform(lower_limit, upper_limit) | ||
# class NIDAQDemo(NIDAQBaseClass): | ||
# def measure(self): | ||
# lower_limit = 0 | ||
# upper_limit = 10 | ||
# random_number = random.uniform(lower_limit, upper_limit) | ||
|
||
sleep(0.00001) | ||
print("Measurement is: ", random_number) | ||
return random_number | ||
# sleep(0.00001) | ||
# print("Measurement is: ", random_number) | ||
# return random_number |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.