With LJControlPanel I am able to set all config defaults. DAC0/DAC1, too.
But with Python? After U3 HV power up:
import u3 daq = u3.U3() daq.configU3() daq.getCalibrationData() print daq.dac0 print daq.dac1 print daq.readRegister(5000) print daq.readRegister(5002)
0 0 0.988853752613 1.98517012596
Now I tried readDefaultsConfig() which is using readDefaults():
cfg = daq.readDefaultsConfig() for key,value in cfg.iteritems(): print '%-18s: %s' % (key,value)
and got the right values.
configU3() is using bytes, and therefore cannot read/write DACx if in 16 bit mode. But method arguments are Python integers, silently used as bytes.
If I do configU3(DAC0=<somevalue not 0>,DAC1=<somevalue not 0>), the DAC values after power up are near 0 - configU3() DAC0/1 results are 0 as shown above. Or is it a must to set the CompatibilityOptions bit 1 for 8 bit DAC operation to use configU3() this way?
Also all not given method arguments were set to 0 and written if other arguments with same writemask bit are used. You have to be very careful using this method for setting config defaults.
What is the right way?
Configure I/O without configU3(), DACx with writeRegister(5000/5002), followed by setDefaults()?
"Configure I/O": configAnalog()/configDigital() followed by getDIState()/setDOState() calls, since configIO() cannot configure CIOx and digital I/O?
Some more examples would be nice.
That being said, I am very impressed by the Python support.