LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data transfer LabView/Simulink through UDP

Solved!
Go to solution

The problem is, the only UDP example set is UDP Send and UDP receive.
This program sends data over UDP from one Labview program to another,
on the same computer. I want to transfer data from Labview on one
computer to Simulink on another computer and I do not know how to
modify the example to do that.
ayur

0 Kudos
Message 31 of 36
(2,137 Views)

Hi Ayur!

 

The LabView side can be found in LabView's example finder (both sending and receiving). To find simulink side, check this page: http://www.mathworks.com/help/instrument/examples/basic-udp-communication.html

Of course, addresses and ports should be selected to match the sides. Firewall settings should be checked as well.

The type checking was described in this forum before.

 

Br,

Peter

0 Kudos
Message 32 of 36
(2,120 Views)

Hi ayur,

 

Your program what you attached few posts ago contains formatting of data into a string.

This string format is used when you want to send bytes like this:

number 123 = '1','2','3'

 

The UDP write accepts strings as byte-stream. I'm confident to say that the Simulink interprets the data in binary format.

In this case you need to format your double into strings but in binary. So the result of a double will be 8 bytes, not an array of characters. For this I suggest to use the Flatten To String VI. Instead of using the Format Into String VI.

FlattenToString.png

 

Hope it will work!

 

Best Regards,

Tamas Szekely

National Instruments

Message 33 of 36
(2,112 Views)

Hi, Can you send me the example you did before....I really want to see what is my problem. I have been in this trouble for connecting Simulink and LabVIEW for many days now....thanks a lot...

0 Kudos
Message 34 of 36
(1,819 Views)

Would you by chance have the file with the solution that you found still available?

0 Kudos
Message 35 of 36
(1,688 Views)

Hi, I have the same problem as the original post.

 

I have tried the same fixes and the VI provided. I am able to send data from Labview to Simulink, but I am unable to send data from Simulink to Labview.

 

I receive something but it is utter garbage. My guess is that there is a conversion error but I have tried EVERY data types combination and it still won't work.

0 Kudos
Message 36 of 36
(726 Views)