WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 12-16-2010, 04:13 AM
psykoko psykoko is offline
Join Date: Dec 2010
Posts: 9
data lose

I have an EEG system I'd like to use to send data to vizard over our network.
EEG System --> BCI Software ---> Network (UDP) ---> Vizard

so, when i send to data from BCI software to vizard, the data lose is induced. my BCI software data sampling rate is 256hz,

how can i get all data from BCI software to Vizard ?
Reply With Quote
Old 12-16-2010, 05:18 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,471
You could try using the Python socket module to receive the data.

If you can send data via the parallel port you could try getting that in Vizard using the command.
Reply With Quote
Old 12-16-2010, 07:21 PM
psykoko psykoko is offline
Join Date: Dec 2010
Posts: 9
i don't know how can use .
where can i search this example ??

if possible, i want to example code.
Reply With Quote
Old 12-16-2010, 08:08 PM
psykoko psykoko is offline
Join Date: Dec 2010
Posts: 9
attach my code
import viz
import vizmat
import vizinfo
import socket
import struct

#The maximum amount of data to receive at a time

#The port to send/receive data on
PORT = 8000

#Get the name of this computer
COMPUTER_NAME = socket.gethostname()

#Get the IP address of this computer
COMPUTER_IP_ADDRESS = socket.gethostbyname('localhost')

#Create a socket to send data over
OutSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
OutSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

#Create a socket to receive data from
InSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
InSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
InSocket.bind(('', PORT))

def SendData(data):
def ReceiveData():
		return InSocket.recvfrom(MAX_DATA_SIZE)

def onkeydown(key):
	if key == ' ':
		#Send data over the socket
		SendData('hello there')


def ontimer(num):
	#Try to receive data from socket
	data = ReceiveData()
	if data:
		udp = struct.unpack(">d", data[0][:8])[0]
		right = open('c:\\new\\new.txt', 'a+')
		print 'Received Message:',udp

Reply With Quote

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
Use saved text file data as replay sources problem mizutani_jun Vizard 4 10-14-2010 04:49 PM
Using 5DT plug-in with the data coming through network... mcicek Vizard 1 05-18-2009 05:17 PM
Flagging the Data Elittdogg Vizard 5 04-11-2008 11:40 AM
Data Files betancourtb82 Vizard 6 05-04-2006 02:43 PM
tracking using quaternarion data jfreeman Vizard 2 06-01-2005 08:48 AM

All times are GMT -7. The time now is 12:23 AM.

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