Jump to content

How to read Socket data


Recommended Posts

I have created a client application in my android phone, which sends strings to port 2222. And is working properly with a server application in my pc, which is created with java.

 

Now i want to know that how can i display the string i send from my android to port 2222 in labview..? please give me a simple socket read example. the one given in labview examples is much complicated. so here i need only to read and display the string i send..

please help me...

Link to comment
I have created a client application in my android phone, which sends strings to port 2222. And is working properly with a server application in my pc, which is created with java.

 

Now i want to know that how can i display the string i send from my android to port 2222 in labview..? please give me a simple socket read example. the one given in labview examples is much complicated. so here i need only to read and display the string i send..

please help me...

 

Are you using TCP, UDP or some other transport protocol? If you use TCP or UDP you will look into the respective function palette in the Data Communication->Protocols palette.

Link to comment

I think there is nothing to explain more.. dear rolfk, here what i needed is to use labview for reading the string i send from my android phone, to the port (4433) in my pc.

 

And it is properly getting with a java application.

 

here java app act as a simple socket server and my android phone act as a simple socket client.

 

Now i want to use labview instead of java app.

Link to comment
I think there is nothing to explain more.. dear rolfk, here what i needed is to use labview for reading the string i send from my android phone, to the port (4433) in my pc.

 

And it is properly getting with a java application.

 

here java app act as a simple socket server and my android phone act as a simple socket client.

 

Now i want to use labview instead of java app.

 

Well, theoretically you could use TCP/IP, UDP or even some other low level protocol, so yes you should be more specific! "I want to go to New York" is usually not enough for someone to help you come there. It's quite helpful for that person to know if that should be by train, airplane, ship or maybe rocket and if you start in Paris/France or in Washington DC.

 

If it is TCP/IP or UDP you can do it in LabVIEW but the principle does differ somewhat since one is a connection based protocol while the other is not. Assuming you use TCP/IP you would simply look in the Example finder for the "TCP Communictor - Passive" example, open it, configure the port to what you have and start it then run your Android app. Obviously you would have to tell your app which IP address your PC has.

 

If it is UDP you rather want to look at "UDP Receiver" in the examples. And if it is something else than TCP or UDP you won't be able to do it in LabVIEW native but will have to interface to the OS socket library through Call Library Nodes to do it.

Link to comment

Hi rolfk, i am really sorry so that i forgot to point out whether i am using TCP or UDP.

 

of course here i am using TCP/IP only.. and now i am trying the example you said. thank you very much



Well.. i have tried the example you said. but it work only when TCP Communictor - Active is also excecuted. it do not accept data from my android phone, even i changed the port number. is there any modification needed?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.