Commit 974e0152 authored by Matthieu Cattin's avatar Matthieu Cattin

test41: Fix hex2signed function, selects right box output channel.

parent 652fe9d6
...@@ -88,9 +88,9 @@ def fmc_adc_init(spec, fmc): ...@@ -88,9 +88,9 @@ def fmc_adc_init(spec, fmc):
# Converts two's complement hex to signed # Converts two's complement hex to signed
def hex2signed(value): def hex2signed(value):
if(value & 0x8000): if(value & 0x8000):
return -((~value & 0xFFFC) + 1) return -((~value & 0xFFFF) + 1)
else: else:
return (value & 0xFFFC) return (value & 0xFFFF)
# Converts digital value to volts # Converts digital value to volts
def digital2volt(value, full_scale, nb_bit): def digital2volt(value, full_scale, nb_bit):
...@@ -325,6 +325,10 @@ def main (default_directory='.'): ...@@ -325,6 +325,10 @@ def main (default_directory='.'):
fmc.set_input_term(CHANNEL, IN_TERM) fmc.set_input_term(CHANNEL, IN_TERM)
time.sleep(SSR_SET_SLEEP) time.sleep(SSR_SET_SLEEP)
# connect AWG to current channel
box.select_output_ch(CHANNEL)
time.sleep(BOX_SET_SLEEP)
################################################## ##################################################
# Apply gain and offset correction # Apply gain and offset correction
################################################## ##################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment