I have an MCC USB-1608GX-2AO (FW 2.02, FPGA version 2.10) and I control it from Python (3.12.2) using MCC Universal Library on Windows 10.
When I query for the analog output ranges (only 1 is avaliable), the analog output is all of a sudden -10 V, even though it was 0 V earlier. The code below shows when the analog output changes from 0 V to -10 V. How can I prevent this?
Question
martinssonh
Hi,
I have an MCC USB-1608GX-2AO (FW 2.02, FPGA version 2.10) and I control it from Python (3.12.2) using MCC Universal Library on Windows 10.
When I query for the analog output ranges (only 1 is avaliable), the analog output is all of a sudden -10 V, even though it was 0 V earlier. The code below shows when the analog output changes from 0 V to -10 V. How can I prevent this?
Best,
Hans
...
from mcculw import ul
from mcculw.enums import InterfaceType
from mcculw.device_info import DaqDeviceInfo
board = 0
ul.ignore_instacal()
inventory = ul.get_daq_device_inventory(InterfaceType.ANY)
descriptor = inventory[0]
ul.create_daq_device(board, descriptor)
daq_dev_info = DaqDeviceInfo(board)
ao_info = daq_dev_info.get_ao_info()
resolution = ao_info.resolution
# After this line AO0 is -10 V!
ao_info.supported_ranges
# Set AO0 to 0 V
ul.a_out(board, 0, int(0), int(2**(resolution - 1) - 1))
# Release the DAQ
ul.release_daq_device(board)
...
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now