LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simulink and LABview TCP/IP communication

Hello , 
I am working on the communication between labVIEW and matlab using TCP/IP . 
my code is very simple I just want to send a constant number from matlab and visualise it in a numeric indicator in labview 
every time when i run the simulink i get this warning : Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout
period.
I attached the labview and simulik codes 
I would be very grateful if someone could help me 

 

0 Kudos
Message 1 of 24
(4,535 Views)

Hello,

 

Just to clarify, is the error message from your original post occurring in Simulink or in LabVIEW?

Are you able to use the built-in LabVIEW Example "Simple TCP.lvproj" to see if you can send messages between Simple TCP - Server.vi and Simple TCP - Client.vi?

Is the LabVIEW Program running when you are running your Simulink code?

 

 

Best,

 

Chris D. | Applications Engineer | National Instruments

0 Kudos
Message 2 of 24
(4,490 Views)

Thank you for your reply .
so The original error is occuring in Simulink 
And I tried sending data with the labview exemple . from labview to labview and it worked . But the problem is when communicating between simulink and labview . 
and yes I run both of them in parallel 

0 Kudos
Message 3 of 24
(4,482 Views)

What access do you have on the Windows Firewall of your computer? You will only be able to add these Firewall permissions if you have administrator privileges on the computer. You can ensure that both programs are able to make incoming and outgoing TCP communication by explicitly adding rules to the Firewall. You can find this by searching "Windows Firewall" from the start menu and selecting Advanced Settings.

Also would it be possible to post a screenshot of your Simulink code? I would ensure that the port you are sending to from your server and the port you are accessing with the LabVIEW client are correct as well.

 

Best,

Chris D. | Applications Engineer | National Instruments

0 Kudos
Message 4 of 24
(4,466 Views)

Hello,
I tried the firewall staff but nothing changed .
The problem is that even if the two programs are running and there is no error the data sent from Simulink can not be read in labview .
I joigned two captures of the two softwares runnig at the same time .

Download All
0 Kudos
Message 5 of 24
(4,460 Views)

Who is server and who is client? 

Have you looked at the LabVIEW examples for TCP/IP?

 

0 Kudos
Message 6 of 24
(4,456 Views)

the server is simulink and the client is labview.
yes I had a look a the labview server/client example when it is from labview to labview it works. 
But when it is from simulink to labview I recieve nothing .

0 Kudos
Message 7 of 24
(4,452 Views)

Then you must be getting an error? 

What is the TCP read function returning? 

 

I don't where simulink is waiting for a incoming connection, how does simulink handle incoming connections? 

Can you send data between two simulink bloks?

 

0 Kudos
Message 8 of 24
(4,449 Views)

no I am not getting an error.

the tcp read function does not return anything I get always 0 in the numeric indicator . 

And even when I put a string indicator to see if there is any information sent I get an empty string indicator . 

And yes I can send data and receive it between two simulink blocks.

0 Kudos
Message 9 of 24
(4,445 Views)

And for how long time are you waiting to see data arrive?

Default timeout for the Open TCP is 60 sec, and for the TCP read is 25 sec. 

What if you place some probes in your vi, can you show what they are displaying in different places on the error wire. 

 

What is the LabVIEW was the server that simulink connected to?, but still simulink sending data? 

0 Kudos
Message 10 of 24
(4,442 Views)