Search
Shopping Cart
Testimonials
-
This is really great support and it gives me confidence to continue to keep using your products!
—Ed, Radiodetection Limited
This is really great support and it gives me confidence to continue to keep using your products!
The team at LabJack is driven to make measurement and automation simple and affordable. Located in Lakewood, Colorado, LabJack Corporation builds great hardware and software for industry, government, and education.
LabJack writes drivers for Windows, Linux, and Mac OS X, plus example code in dozens of languages.
Have a question or problem? LabJack engages in active customer support. You can find answers in the support area and FAQ, or contact us so we can help.
#1
Python support for the U12 is provided in LabJackPython, so you will want to go to that page for installation instructions. There is a quickstart on that page for the U3, but calls are not the same on the U12 beyond the similarity of importing the module, creating a class instance and using the methods provided by classes. At the moment there is no Python tutorial for the U12, but there are more examples in the Low-Level Function Reference section of the User's Guide. I updated this page to provide a link to that.
I will do a quick explanation of the example code on this page below with comments.
import U12 #Importing the U12 module
d = u12.U12() #Creating a new class instance of the U12 class named d. The constructor opens the U12.
d.eAnalogIn(0) #The newly created instance d provides methods to send/receive U12 data. The eAnalogIn method reads an AI voltage. In this case AI0.
It would be a good idea to do some Python language reading to better understand what is going on in our examples. In particular learn about classes and methods, as our U12 Python interface uses it. U12 class and method documentation can be found in the source code. For reading one analog input, use the eAnalogIn U12 class method. To read multiple analog inputs at once, use the aiSample (Windows only) or rawAISample (Linux/Mac only) method. For setting analog outputs use the eAnalogOut method.
If you have further questions in regards to programming, the better location to post your questions is on our forum.