Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC ADC 100M 14b 4cha - Testing
Commits
357badd0
Commit
357badd0
authored
Jun 04, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test18: Uses common modules, added exception handling.
parent
09bf87da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
36 deletions
+52
-36
test18.py
test/fmcadc100m14b4cha/python/test18.py
+52
-36
No files found.
test/fmcadc100m14b4cha/python/test18.py
View file @
357badd0
...
@@ -5,17 +5,26 @@
...
@@ -5,17 +5,26 @@
# Author: Matthieu Cattin <matthieu.cattin@cern.ch>
# Author: Matthieu Cattin <matthieu.cattin@cern.ch>
# Licence: GPL v2 or later.
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.ohwr.org
# Last modifications: 4/6/2012
# Import system modules
import
sys
import
sys
import
rr
import
time
import
time
import
os
import
os
from
numpy
import
*
from
pylab
import
*
# Add common modules and libraries location to path
sys
.
path
.
append
(
'../../../'
)
sys
.
path
.
append
(
'../../../gnurabbit/python/'
)
sys
.
path
.
append
(
'../../../common/'
)
# Import common modules
from
ptsexcept
import
*
from
ptsexcept
import
*
import
rr
import
calibr_box
# Import specific modules
from
numpy
import
*
from
pylab
import
*
from
calibr_box
import
*
import
find_usb_tty
import
find_usb_tty
from
PAGE.Agilent33250A
import
*
from
PAGE.Agilent33250A
import
*
from
PAGE.SineWaveform
import
*
from
PAGE.SineWaveform
import
*
...
@@ -24,21 +33,10 @@ from PAGE.SineWaveform import *
...
@@ -24,21 +33,10 @@ from PAGE.SineWaveform import *
"""
"""
test18: Test calibration box
test18: Test calibration box
Note: Requires test00.py to run first to load the firmware!
"""
"""
# Calibration box vendor and device IDs
BOX_USB_VENDOR_ID
=
0x10c4
# Cygnal Integrated Products, Inc.
BOX_USB_DEVICE_ID
=
0xea60
# CP210x Composite Device
# Agilent AWG serial access vendor and device IDs
AWG_USB_VENDOR_ID
=
0x0403
# Future Technology Devices International, Ltd
AWG_USB_DEVICE_ID
=
0x6001
# FT232 USB-Serial (UART) IC
RS232_BAUD
=
57600
NB_CHANNELS
=
4
NB_CHANNELS
=
4
AWG_SET_SLEEP
=
0.3
AWG_SET_SLEEP
=
0.3
...
@@ -51,13 +49,26 @@ def set_awg_freq(gen, sine, freq):
...
@@ -51,13 +49,26 @@ def set_awg_freq(gen, sine, freq):
def
main
(
default_directory
=
'.'
):
def
main
(
default_directory
=
'.'
):
# Constants declaration
TEST_NB
=
18
# Calibration box vendor and device IDs
BOX_USB_VENDOR_ID
=
0x10c4
# Cygnal Integrated Products, Inc.
BOX_USB_DEVICE_ID
=
0xea60
# CP210x Composite Device
# Agilent AWG serial access vendor and device IDs
AWG_USB_VENDOR_ID
=
0x0403
# Future Technology Devices International, Ltd
AWG_USB_DEVICE_ID
=
0x6001
# FT232 USB-Serial (UART) IC
RS232_BAUD
=
57600
try
:
# Objects declaration
# Objects declaration
usb_tty
=
find_usb_tty
.
CttyUSB
()
usb_tty
=
find_usb_tty
.
CttyUSB
()
awg_tty
=
usb_tty
.
find_usb_tty
(
AWG_USB_VENDOR_ID
,
AWG_USB_DEVICE_ID
)
awg_tty
=
usb_tty
.
find_usb_tty
(
AWG_USB_VENDOR_ID
,
AWG_USB_DEVICE_ID
)
box_tty
=
usb_tty
.
find_usb_tty
(
BOX_USB_VENDOR_ID
,
BOX_USB_DEVICE_ID
)
box_tty
=
usb_tty
.
find_usb_tty
(
BOX_USB_VENDOR_ID
,
BOX_USB_DEVICE_ID
)
gen
=
Agilent33250A
(
device
=
awg_tty
[
0
],
bauds
=
RS232_BAUD
)
gen
=
Agilent33250A
(
device
=
awg_tty
[
0
],
bauds
=
RS232_BAUD
)
sine
=
SineWaveform
()
sine
=
SineWaveform
()
box
=
calibr_box
.
CCalibr_box
(
box_tty
[
0
])
box
=
CCalibr_box
(
box_tty
[
0
])
# Calibration box version 2
# Calibration box version 2
for
i
in
range
(
NB_CHANNELS
):
for
i
in
range
(
NB_CHANNELS
):
...
@@ -75,10 +86,14 @@ def main (default_directory = '.'):
...
@@ -75,10 +86,14 @@ def main (default_directory = '.'):
print
"Channel
%
d = AWG, others = 100mV Vref"
%
(
i
+
1
)
print
"Channel
%
d = AWG, others = 100mV Vref"
%
(
i
+
1
)
raw_input
(
'Press ENTER to continue...'
)
raw_input
(
'Press ENTER to continue...'
)
sys
.
exit
()
except
(
CalibrBoxOperationError
)
as
e
:
raise
PtsError
(
"Test failed:
%
s"
%
e
)
# Calibration box version 1
# Calibration box version 1
"""
print('
\n
=== 10V range ===')
print('
\n
=== 10V range ===')
box.select_output('10V')
box.select_output('10V')
print('Box gpio:
%
X')
%
box.get_config()
print('Box gpio:
%
X')
%
box.get_config()
...
@@ -94,6 +109,7 @@ def main (default_directory = '.'):
...
@@ -94,6 +109,7 @@ def main (default_directory = '.'):
print('
\n
=== AWG ===')
print('
\n
=== AWG ===')
box.select_output('AWG')
box.select_output('AWG')
print('Box gpio:
%
X')
%
box.get_config()
print('Box gpio:
%
X')
%
box.get_config()
"""
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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