![]() |
|
|
|
#1
|
|||
|
|||
|
Real-time export data to simulink
Hello,
I'm seeking a solution to output position and orientation data to another computer running Simulink in real time. Does anybody have any experience? Thanks! |
|
#2
|
|||
|
|||
|
Can Simulink read data coming over a network socket? If so, you can use the Python socket module to send data over the network.
|
|
#3
|
|||
|
|||
|
I found a UDP Receive block in Simulink. It requires the other end of the communication, which is vizard, to specify the port that receives data. I'm not sure how to do it. I think my code only specifies the port that sends data. Am I missing something?
Code:
import viz
viz.go()
import socket
COMPUTER_IP_ADDRESS = socket.gethostbyname('192.59.88.91')
PORT = 25000 #The port to send data on
OutSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
OutSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
def SendData(data):
OutSocket.sendto(data,(COMPUTER_IP_ADDRESS,PORT))
vizact.onkeydown(' ',SendData,'hello there')
|
|
#5
|
|||
|
|||
|
I'm confused, in the sample code, there is only one port 4999, which is "#The port to send/receive data on". Why does it show using different ports? Thanks.
|
|
#6
|
|||
|
|||
|
So far I'm sure simulink on computer B can receive data from specified IP address and port over UDP. Then my question is, how do I specify the port that the remote computer B accepts data from in vizard on this computer A? Thanks.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| real time collision on animation path | whj | Vizard | 10 | 10-06-2008 05:38 PM |
| Real Time Audio Data | lomendil | Vizard | 2 | 06-02-2008 09:18 PM |
| Can I get real time Intersense tracking data from another computer on the network? | GoldenSun | Vizard | 4 | 04-30-2008 08:42 PM |
| Flagging the Data | Elittdogg | Vizard | 5 | 04-11-2008 12:40 PM |
| timer question | Elittdogg | Vizard | 5 | 10-10-2007 03:49 PM |