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

[Python Code] A GUI for the U3


  • Please log in to reply
7 replies to this topic

#1 DrKayBee

DrKayBee
  • Members
  • 17 posts

Posted 16 October 2007 - 04:02 PM

Hi everyone. I use LabJack as a teaching tool in college and have been interested for a while in putting together a GUI for the U3 on Linux and OS X, similar to that available for the Windows side. Attached please find the python source code for my `version 0.1' of the GUI. You will need, A U3 device (v 1.21) A computer running OS X / Linux (Does NOT work with MS Windows due to the different capabilities provided by the LabJackPython class) [Edit: As of LabJackPython driver v. 0.62 - this GUI will work with Windows as well! - Thanks LabJack] Python 2.5 or better wxPython framework 2.8 (w/ Unicode) or better installed (www.wxpython.org) The LabJackPython driver from LabJack installed [Edit: v. 0.62 or greater required. Version provided with this attachment is older] and all the files in this attachment in one directory. Launch the "U3PyController.py" program and enjoy. You should be able to configure all pins - click each pin button to cycle through the different modes. In AIN mode, the text control displays the voltage. The checkbox under each pin allows you to set/read the digital output state. The clock, timers, counters and local ID can be set through the menu items. For an output mode timer, the respective sliders will allow you to send values to the timer. I haven't programmed the timer interface fully yet, so automatic timer reads are not implemented yet. Among other features I want to implement are: 1) periodic refresh to continually scan and report channel values -- updated in new file 2) Generic logging capability -- added in new version 3) Support for multiple labjacks. 4) Stream / I2C / UART and other goodies 5) ... any other you care to suggest. Please use this program and let me know what you think. It may still have bugs in it - so don't plan to run your mission critical hardware on it any time soon. Look forward to you comments and suggestions. Cheers, Kaustubh PS - the interface was designed using wxGlade - I've included the wxg files as well. [Edit - I've updated the archive with a newer version - now with autorefresh] [Edit - now with generic logging facilities] Attached File  U3PyController.zip   28.08KB   1256 downloads

#2 DrKayBee

DrKayBee
  • Members
  • 17 posts

Posted 16 October 2007 - 08:44 PM

One question I had for the LabJack devs is if it is possible to determine the current mode a particular timer is in? Is the only solution to force the timers into a known mode? DrKayBee

#3 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 October 2007 - 09:20 AM

You can read clock configuration and whether timers/counters are enabled, but you can't read the current mode.

#4 dogfuel

dogfuel
  • Members
  • 18 posts

Posted 07 December 2008 - 12:39 AM

This was a big help to me - I'm new to all of this. The downloaded program errored when it polled but I commented out the time and counter bit (not of immediate interest) and was able to learn a good bit from the code. Thanks

#5 axia277

axia277
  • Members
  • 5 posts

Posted 11 February 2010 - 09:40 AM

Does it work with hardware version 1.30?, I have the U3-HV when I try to use it it gives me some error Event handler `FindU3' not implemented Event handler `ProgramSettings' not implemented I don't know what this means thanks and great work

#6 ricodol

ricodol
  • Members
  • 3 posts

Posted 07 May 2010 - 07:46 AM

Same for me Event handler `FindU3' not implemented my u3 is two days old. I m very interesting by this GUI, for student applications. and I would like to developed also an interface for plotting result so if there is a way to correct gui application let me know Cordially Bruno

#7 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 07 May 2010 - 09:48 AM

Same for me
Event handler `FindU3' not implemented
my u3 is two days old.
I m very interesting by this GUI, for student applications.
and I would like to developed also an interface for plotting result
so if there is a way to correct gui application let me know
Cordially
Bruno


Note that this application (from 2007) relies on a different LabJackPython module than the one we support and ship:

http://github.com/la...k/LabJackPython

We took a look at U3PyController code, but we're afraid we can't support it.

Our Python module doesn't have a GUI, but it has an excellent programatic interface to the U3, including Modbus support that makes reading from AIN0 as simple as:

>>> import u3
>>> d = u3.U3()
>>> d.readRegister(0)

Setting DAC0 is as easy as:

>>> d.writeRegister(5000, 3.7)


#8 Paul.L.

Paul.L.
  • Members
  • 22 posts

Posted 17 March 2015 - 10:59 AM

 

Note that this application (from 2007) relies on a different LabJackPython module than the one we support and ship:

 

DrKayBee,

Have you kept up with the supported LabJackPython ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users