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

Labjack T7 and python


  • Please log in to reply
2 replies to this topic

#1 nitishjha

nitishjha
  • Members
  • 2 posts

Posted 17 December 2014 - 06:37 AM

I have just gotten a labjack T7 and am trying to control a servo using the labjack python library. I am connected via etherent

i have a weird issue where if i edit the necessary registers using Kipling 1.0.14 the servo moves correctly. but when i do the same for the PWM generation via python it does not move. after settings the values from python and than viewing them in kipling the values are correct. if i edit the CLOCK_ROLL_VALUE (say by just clicking the field and hitting enter in Kipling 1.03) the servo moves correctly then. 

 

i am using the latest firmware 1.0135 and ljm library R-1.0704 version available on the website. below is the code i am using to generate the signal. any clue as to why its not working ?

 

from labjack import ljm
import time
t=ljm.openS("ANY","ANY","ANY")
print "Clock Disable " +str(ljm.eWriteName(t,"DIO_EF_CLOCK0_ENABLE",0))
print "Clock divisior " + str(ljm.eWriteName(t,"DIO_EF_CLOCK0_DIVISOR",1))
print "RollValue " + str(ljm.eWriteName(t,"DIO_EF_CLOCK0_ROLL_VALUE",int(400000)))
print "Clock Enable " + str(ljm.eWriteName(t,"DIO_EF_CLOCK0_ENABLE",1))
print "DIO0 Disable " + str(ljm.eWriteName(t,"DIO0_EF_ENABLE",0))
print "DIO0 EF INDEX " + str(ljm.eWriteName(t,"DIO0_EF_INDEX",0))
print "DIO EF OPTIONS " + str(ljm.eWriteName(t,"DIO0_EF_OPTIONS",0))
print "DIO Write value " +str(ljm.eWriteName(t,"DIO0_EF_CONFIG_A",int(78000)))
print "DIO enable EF " +str(ljm.eWriteName(t,"DIO0_EF_ENABLE",1))
print "Close "+str(ljm.close(t))

 



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 December 2014 - 03:19 PM

In Kipling upgrade your T7's firmware to beta version 1.37:

 

http://labjack.com/s...irmware/t7/beta

 

It looks like in previous firmware versions there was an issue with certain clock settings that firmware 1.37 fixes. Your 200 Hz frequency your code is setting should work after the upgrade.



#3 nitishjha

nitishjha
  • Members
  • 2 posts

Posted 18 December 2014 - 03:07 AM

if i enable the clock before setting the rollvalue than it works. 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users