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

Robot Framework


  • Please log in to reply
3 replies to this topic

#1 Brettfowler

Brettfowler
  • Members
  • 2 posts

Posted 12 August 2014 - 02:13 PM

Hello all, first time posting.

Ive recently been comissioned to integrate robot framework into some of our future testing. That said the Labjack is our DAQ of choice. I have attempted multiple times to import the U3.py library into mt test suites but it is only capable of grabing a few kew words here and there and unfortunatly only the ones that are for "windows only" and im attempting to develope in linux. THose familiar with robot frame work know that python classes and modules can be directly inported as "keywords" into robot and the sytax of each word is literally the module name. ex class stuff: def morestuff(stuffyness).... keyword will = morestuff. most of the labjackpython commands are importing which is great but im attempting to control a u3 and u3 specific commands will not import for some un godly reason. Also, a large portion of labjack python commands have WINDOWS ONLY wrtten all m and this proves to hold true preventing me from implenting any of those commands on my linux system. I can try to revert back to a windows system but my company is making moves towards linux... help me out labjack!



#2 Brettfowler

Brettfowler
  • Members
  • 2 posts

Posted 12 August 2014 - 02:22 PM

to further clarify my issue; i need to use the U3 specific library, but it wont import into Robot Framework properly. any suggestions would be appreciated. This could be an issue with robot framework or my implementation but I figured I would reach out and see if anyone else has seen this issue.



#3 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 12 August 2014 - 03:34 PM

The u3 module contains the U3 specific functionality that is cross-platform. LabJackPython contains the parent Device class, helpful functions and the LabjackUD wrapper functions (Windows only). As a workaround you could use the Device class and Modbus to interact with your U3. For example (Python code):

import LabJackPython
d = LabJackPython.openLabJack(deviceType=3, connectionType=1, firstFound=True) #Open first found U3 over USB. A Device object is returned.
voltage = d.readRegister(0) #Read from AIN0

The Modbus quickstart is here:

 

http://labjack.com/s...ckpython/modbus

 

Getting the u3 module working would be the best solution though. I'm not familiar with the Robot Framework and its Python functionality, but what errors do you get when you try to "import" the u3 module and use the U3 class.



#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 12 August 2014 - 04:58 PM

Looking online a bit, if you are having issues importing, perhaps the import needs to be something like this to specify the module/filename and the U3 class:

 

Library u3.U3

 

I read something about this here:

 

http://stackoverflow...ins-no-keywords

 

Also, when using the U3 class methods, I'm unsure if the keywords need to be with spaces (for ex., Read Register) or the same name (for., readRegister) since we use camelCase for names instead of the expected underscores.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users