From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView and Matlab UDP

Solved!
Go to solution

Hi all,

 

I am currently trying to send some double data from LabView to Simulink through UDP.

I have went through testing the UDP between LabView and LabView and it works.


However, I am unclear how to send the data to Simulink.

 

From what I have gathered from a previous forum, is that I have to first convert it to a string using the 'Flatten to string' function before sending it over to Matlab. However, what is the data being sent to Simulink (a string I would assume, but the 'Scope' function doesn't show what I want) and how do I get that data to be displayed/ sent properly.

 

Please see below attached setup of the UDP in LabView and Matlab

 

Sorry for the trivial question. 

Thank you all very much for your time and really appreciate the help!

Download All
0 Kudos
Message 1 of 4
(3,416 Views)
Solution
Accepted by topic author JustinYeoh

Hi JustinYeoh,

 

I have not worked with Simulink, but it would seem like a common sense thing to do to keep the data types consistent across LV and Simulink. As I can see, you are trying to read doubles in Simulink, so I would also try sending doubles from LV. 

 

Unrelated:

Sending data generated using "Flatten to String" function doesn't strike me as a great idea, as I am not sure how is Simulink supposed to decode the flattened string. You can use "Format into String" to get more human-readable version of the string, which should be decodable in most software environments. 

 

Hope it helps!



----------------------------------------------------------------------------------------
Everything has an End, and you get to it only if you keep on
-E. Nesbit
Message 2 of 4
(3,344 Views)

Thank you very much for the reply!
I managed to get it working with your advice!

0 Kudos
Message 3 of 4
(3,335 Views)

hy i dont how i can send data for labview to  simulink you can help mee

0 Kudos
Message 4 of 4
(2,942 Views)