WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-17-2009, 02:43 PM
ursi ursi is offline
Member
 
Join Date: Dec 2009
Posts: 11
Implement LabJack

Hi, I'm new in working with vizard and not that familiar with python yet.

What we want to do is to send an event trigger out of vizard (keydown event) to a data collection program so that we can synchronize our recordings with the event occurred in our virtual world.

As far as I know, using LabJack to send a voltage signal out would be the best solution and so to directly connect with the AD transducer.
May you help me implementing LabJack in our 'World' code?

What we want to do is to move the room relative to the global system on a keydwon event. So, for our data analysis we need know the exact time of this event relativ to our data recordings:

--------------------
def onkeydown(key):
if key == 't':
# ANIMATION PATH (to move the room itself)
...
...
vizact.ontimer(0.1,pathFWBWs.play)

# HERE WE WANT TO SEND OUT OUR TRIGGER EVENT TO LABJACK...

viz.callback(viz.KEYDOWN_EVENT,onkeydown)
--------------------

Thank's for your help!
Reply With Quote
  #2  
Old 12-18-2009, 01:31 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Here is a link for using Labjack with python code.

http://labjack.com/support/labjackpython
Reply With Quote
  #3  
Old 01-04-2010, 10:49 AM
ursi ursi is offline
Member
 
Join Date: Dec 2009
Posts: 11
We have LabJack U12, what's about this device? Can we just replace ue9 by U12 in the following code?

For UE9:
>>> import ue9
>>> d = ue9.UE9()
>>> d.commConfig()
{'IPAddress' : '192.168.1.209'
...,
}
Reply With Quote
  #4  
Old 01-07-2010, 01:54 PM
ursi ursi is offline
Member
 
Join Date: Dec 2009
Posts: 11
Hi, thank's for the link.

I tried to import u12 with the following code:
-----------
import u12
d = u12.U12()
d.eAnalogOut(2.2, -1)
-----------

But vizard can not find the module u12. Where can I find this module?

The eAnalogOut function is defined here (Link from LabJack support):
http://github.com/labjack/LabJackPyt...src/u12.py#L81

Thank's for your help!
Reply With Quote
  #5  
Old 01-07-2010, 03:14 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The link you gave is for the u12.py module. You could either copy that code and save it as u12.py or you could follow the link for download source on that page and save a zipped file with all the labjackpython related files including u12.py
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
labjack plugin Jerry Vizard 1 03-14-2007 04:36 PM


All times are GMT -7. The time now is 12:20 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC