View Single Post
  #1  
Old 01-27-2014, 07:49 PM
mikeb mikeb is offline
Member
 
Join Date: Jan 2014
Posts: 2
Saving a variable through network

Hello,

I'm relatively new to Vizard and was seeking advise on a project I'm working on.

I have a control program written in MatLab which I was hoping to communicate with a Vizard program. Ideally I would like to save a variable that can be used in Vizard which is sent from MatLab. I have become familiar with the basic networking commands and am able to send and retrieve data back and fourth.
For example using the below code I was able to retrieve data from MatLab.

myNetwork = viz.addNetwork('IP here')
myNetwork.port(4950)
def onNetwork(e):
if isinstance(e,viz.RawNetworkEvent):
print e.raw_data
viz.callback(viz.NETWORK_EVENT,onNetwork)

Is there an easy way to save this data as a variable to be used in a Vizard Script?

Thank you for your time, I hope I explained things as clearly as possible and I apologize if this is an extremely basic question.
Reply With Quote