Sarah83 Posted August 31, 2004 Report Share Posted August 31, 2004 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) Quote Link to comment
didierj Posted September 1, 2004 Report Share Posted September 1, 2004 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 Quote Link to comment
Sarah83 Posted September 1, 2004 Author Report Share Posted September 1, 2004 Thanks! Quote Link to comment
aledain Posted September 3, 2004 Report Share Posted September 3, 2004 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. Quote Link to comment
Sarah83 Posted September 3, 2004 Author Report Share Posted September 3, 2004 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 Quote Link to comment
aledain Posted September 3, 2004 Report Share Posted September 3, 2004 Hi Alex,LTR? Do you have a link for me? Now I'm just happy to have a connection 1620[/snapback] LabVIEW Technical Resource : www.ltrpub.com/ But you'll need to order a back issure from them. cheers, Alex. Quote Link to comment
Joost van Hamond Posted December 21, 2005 Report Share Posted December 21, 2005 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 Quote Link to comment
Yair Posted December 21, 2005 Report Share Posted December 21, 2005 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. Quote Link to comment
Joost van Hamond Posted December 21, 2005 Report Share Posted December 21, 2005 I'm using "Type Cast" to translate the value into a string...... Quote Link to comment
Yair Posted December 21, 2005 Report Share Posted December 21, 2005 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. Quote Link to comment
Joost van Hamond Posted December 22, 2005 Report Share Posted December 22, 2005 Thank you! I now convert the number into a hexadecimal and everything is working fine. Java can easily convert this back into a double.... :thumbup: Thanks again, Joost Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.