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
3764f67e
Commit
3764f67e
authored
Apr 23, 2014
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test39: Reproduce behaviour found by Federico.
parent
9cef5a14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
32 deletions
+46
-32
test39.py
test/fmcadc100m14b4cha/python/test39.py
+46
-32
No files found.
test/fmcadc100m14b4cha/python/test39.py
View file @
3764f67e
...
...
@@ -242,8 +242,8 @@ def main (default_directory='.'):
# Acquisition parameters
ACQ_PAUSE
=
1
# pause between acq. stop and start, start and trigger
IN_RANGE
=
'1V'
IN_TERM
=
'O
N
'
IN_RANGE
=
'1
0
V'
IN_TERM
=
'O
FF
'
ADC_FS
=
{
'10V'
:
10.0
,
'1V'
:
1.0
,
'100mV'
:
0.1
}
##################################################
...
...
@@ -264,36 +264,7 @@ def main (default_directory='.'):
##################################################
# Acquire channel 1
##################################################
print
"
\n
Acquiring channel 1"
# Configure analogue input
fmc
.
set_input_range
(
1
,
IN_RANGE
)
fmc
.
set_input_term
(
1
,
IN_TERM
)
time
.
sleep
(
SSR_SET_SLEEP
)
# connect AWG to current channel
box
.
select_output_ch
(
1
)
time
.
sleep
(
BOX_SET_SLEEP
)
# Perform an acquisition
acq_data
,
trig_timetag
=
acq_channels
(
fmc
,
carrier
,
ADC_FS
[
IN_RANGE
],
ACQ_PAUSE
)
channel_data
=
acq_data
[
0
::
4
]
print
(
"Number of samples:
%
d"
%
(
len
(
channel_data
)))
# Calculate middle value
ch_max
=
max
(
channel_data
)
ch_min
=
min
(
channel_data
)
ch_mid
=
(
abs
(
ch_max
)
-
abs
(
ch_min
))
ch_mean
=
mean
(
channel_data
)
print
(
"Channel max=
%
d, min=
%
d, mid=
%
d, mean=
%
d"
%
(
ch_max
,
ch_min
,
ch_mid
,
ch_mean
))
non_cal_ch_mean
=
ch_mid
non_cal_ch_data
=
channel_data
# Plot channel
#plot_channel(channel_data, ch_mean, 32768)
##################################################
# Apply gain and offset correction
# Get ADC/DAC gain and offset correction values
##################################################
# Get ADC and DAC offset and gain correction parameters
...
...
@@ -386,10 +357,53 @@ def main (default_directory='.'):
print ""
"""
##################################################
# Apply DAC gain and offset correction
##################################################
# Write DAC gain and offset correction value to fmc class
print
"
\n
Apply DAC correction
\n
"
fmc
.
set_dac_corr
(
dac_corr_data
)
##################################################
# Apply a DC offset
##################################################
dc_offset
=
0xA000
fmc
.
set_dc_offset_corrected
(
1
,
IN_RANGE
,
dc_offset
,
print_value
=
True
)
##################################################
# Acquire channel 1
##################################################
print
"
\n
Acquiring channel 1"
# Configure analogue input
fmc
.
set_input_range
(
1
,
IN_RANGE
)
fmc
.
set_input_term
(
1
,
IN_TERM
)
time
.
sleep
(
SSR_SET_SLEEP
)
# connect AWG to current channel
box
.
select_output_ch
(
1
)
time
.
sleep
(
BOX_SET_SLEEP
)
# Perform an acquisition
acq_data
,
trig_timetag
=
acq_channels
(
fmc
,
carrier
,
ADC_FS
[
IN_RANGE
],
ACQ_PAUSE
)
channel_data
=
acq_data
[
0
::
4
]
print
(
"Number of samples:
%
d"
%
(
len
(
channel_data
)))
# Calculate middle value
ch_max
=
max
(
channel_data
)
ch_min
=
min
(
channel_data
)
ch_mid
=
(
abs
(
ch_max
)
-
abs
(
ch_min
))
ch_mean
=
mean
(
channel_data
)
print
(
"Channel max=
%
d, min=
%
d, mid=
%
d, mean=
%
d"
%
(
ch_max
,
ch_min
,
ch_mid
,
ch_mean
))
non_cal_ch_mean
=
ch_mid
non_cal_ch_data
=
channel_data
# Plot channel
#plot_channel(channel_data, ch_mean, 32768)
##################################################
# Apply ADC gain and offset correction
##################################################
g
=
adc_corr_data
[
IN_RANGE
][
'gain'
][
0
]
o
=
adc_corr_data
[
IN_RANGE
][
'offset'
][
0
]
print
"
\n
Apply ADC offset correction: gain=0x
%04
X, offset=0x
%04
X"
%
(
g
,
o
)
...
...
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