Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
total_control_app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Drechsler
total_control_app
Commits
c965df9f
Commit
c965df9f
authored
Oct 22, 2018
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daq found now should work better: it tries to read a value from DI 0 to check the daq .
parent
703b32d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
ADoutputs.py
ADoutputs.py
+23
-3
No files found.
ADoutputs.py
View file @
c965df9f
...
@@ -7,6 +7,8 @@ Created on Wed May 30 15:27:17 2018
...
@@ -7,6 +7,8 @@ Created on Wed May 30 15:27:17 2018
#from __future__ import absolute_import, division, print_function
#from __future__ import absolute_import, division, print_function
import
warnings
import
warnings
from
messages
import
show_warning
daqfound
=
True
daqfound
=
True
...
@@ -20,15 +22,29 @@ try:
...
@@ -20,15 +22,29 @@ try:
ao_range
=
ULRange
.
BIP10VOLTS
ao_range
=
ULRange
.
BIP10VOLTS
except
:
except
:
warnings
.
warn
(
'Warning: either the daq was not found, or there was some error with the mcculw drivers. '
)
warnings
.
warn
(
'There was some error with the mcculw drivers. '
)
daqfound
=
False
try
:
d_props
=
DigitalProps
(
0
)
port
=
next
(
(
port
for
port
in
d_props
.
port_info
if
port
.
supports_output
),
None
)
ul
.
d_bit_in
(
0
,
port
.
type
,
0
)
print
(
'daq found'
)
except
:
#daqfound = False
warnings
.
warn
(
'daq not found'
)
#%%
#%%
class
daq_DO
(
object
):
class
daq_DO
(
object
):
def
__init__
(
self
,
out_num
):
def
__init__
(
self
,
out_num
):
global
daqfound
global
daqfound
#ul.ignore_instacal()
self
.
board_num
=
0
self
.
board_num
=
0
self
.
out_num
=
out_num
self
.
out_num
=
out_num
if
daqfound
:
if
daqfound
:
...
@@ -47,6 +63,8 @@ class daq_DO(object):
...
@@ -47,6 +63,8 @@ class daq_DO(object):
self
.
board_num
,
self
.
port
.
type
,
DigitalIODirection
.
OUT
)
self
.
board_num
,
self
.
port
.
type
,
DigitalIODirection
.
OUT
)
except
ULError
as
e
:
except
ULError
as
e
:
self
.
show_ul_error
(
e
)
self
.
show_ul_error
(
e
)
print
(
'puerto: '
,
self
.
port
)
print
(
self
.
port
.
type
)
if
daqfound
:
if
daqfound
:
def
set_out
(
self
,
bit_value
):
def
set_out
(
self
,
bit_value
):
...
@@ -64,6 +82,8 @@ class daq_DO(object):
...
@@ -64,6 +82,8 @@ class daq_DO(object):
class
daq_AO
(
object
):
class
daq_AO
(
object
):
def
__init__
(
self
,
out_num
):
def
__init__
(
self
,
out_num
):
global
daqfound
global
daqfound
#ul.ignore_instacal()
self
.
board_num
=
0
self
.
board_num
=
0
self
.
out_num
=
out_num
self
.
out_num
=
out_num
if
daqfound
:
if
daqfound
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment