Jump to content

TCP/IP


Recommended Posts

Posted

Hi,

I like to know if it is possible to send some data via TCP/Ip with LV.

Are there some examples? Must I open one port for every data or could I send three signals over one? (synchro, ttl and audio)

Posted

Sarah,

Maybe you know it already, but in the menu under Help->Find Examples... you have a nice tool where you can search the examples on your PC as well on the Internet.

There make a search for TCP. You'll get a couple of examples. Begin with Simple Data Server.vi / Simple Data Client.vi.

Didier

Posted
Hi,

I like to know if it is possible to send some data via TCP/Ip with LV.

Are there some examples? Must I open one port for every data or could I send three signals over one? (synchro, ttl and audio)

1587[/snapback]

You can send all of these across the one connection. The trick here is to add a header byte to each packet so that your receiver (client) knows what to do with the packet. eg 0=synchro, 1=ttl, 2=audio, etc).

Just a note on the audio: you will need to buffer the audio on the client side to avoid having playback that has gaps in it. There is an interesting article in one of the recent LTR issues dealing with LabVIEW, sound and gapless buffered sound playback using the native LV sound VIs. Well worth a read.

cheers, Alex.

Posted
You can send all of these across the one connection. The trick here is to add a header byte to each packet so that your receiver (client) knows what to do with the packet. eg 0=synchro, 1=ttl, 2=audio, etc).

Just a note on the audio: you will need to buffer the audio on the client side to avoid having playback that has gaps in it. There is an interesting article in one of the recent LTR issues dealing with LabVIEW, sound and gapless buffered sound playback using the native LV sound VIs. Well worth a read.

cheers, Alex.

1618[/snapback]

Hi Alex,

LTR?

Do you have a link for me?

Now I'm just happy to have a connection :D

Posted
Hi Alex,

LTR?

Do you have a link for me?

Now I'm just happy to have a connection  :D

1620[/snapback]

LabVIEW Technical Resource : www.ltrpub.com/

But you'll need to order a back issure from them.

cheers, Alex.

  • 1 year later...
Posted

Hi all,

I've got a problem:

I am sending data (double values) via TCP/IP. To send this data, I have to convert this into a string. When I read the port with a LabVIEW program (TCP/IP Read) I can translate the received string back into a double value, no problem.

When I try to read out the port with Java, I receive

Posted

The first question would be "how are you translating the number into a string?".

If you're simply flattening it, this may not help you outside of LabVIEW. Look at the LV data represntation paper available in the bookshelf (in the help menu) for more details.

One thing you can do is to convert the number to a string and then you can send that string.

The other thing to check is endianess. You may need to reverse the bit order of each byte in one of the sides. I think that if you want to do this in LV, you will have to convert the string to a byte array, convert those numbers to boolean arrays and reverse them and then convert back to a string, although there probably are other ways.

Posted
I'm using "Type Cast" to translate the value into a string......

Then convert it to a string using the number to string functions instead. Then, you can send the string.

Type cast simply takes the bit pattern (since a DBL is 8 bytes, that should be 64 bits) and reads those 64 bits as a string (of 8 characters, since each byte is an ASCII char). When you convert to a string, each digit will be turned into its ASCII value, which JAVA can easily understand.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.