Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Error in Python u3.py, readDefaultsConfig()?


  • Please log in to reply
2 replies to this topic

#1 Miky

Miky
  • Members
  • 3 posts

Posted 24 March 2015 - 03:47 AM

The default config DAC values in readDefaultsConfig():

 

defaults = self.readDefaults(2)
results['DAC0'] = struct.unpack( ">H", struct.pack("BB", *defaults[16:18]) )[0]
results['DAC1'] = struct.unpack( ">H", struct.pack("BB", *defaults[20:22]) )[0]

 

'>' means big endian architecture, or H value in first byte and L value in second byte.

 

But it seems that DAC byte order ist L byte first, same als TMRx according to section 5.2.22 - ReadDefaults. The DAC byte order is not shown there.

 

If I change byte order, voltageToDACBits() matches with DAC values from readDefaultsConfig(), otherwise not.



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 24 March 2015 - 04:56 PM

Values are stored on the U3 as little endian (LSW, MSW), so this is an error in readDefaultsConfig. I fixed this on our github repository, so download and install that version of LabJackPython for the change:

 

https://github.com/l...k/LabJackPython

 

Thanks for making us aware of the issue.



#3 Miky

Miky
  • Members
  • 3 posts

Posted 26 March 2015 - 11:54 PM

Thank you very much!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users