hannibal Posted January 5, 2007 Report Share Posted January 5, 2007 Hey. I want to create serial communication between 2 computers. I don't know how to create a packet of data in order to transmit. Can you give me some hints? Thanks in advance. Quote Link to comment
Petr Klapka Posted January 5, 2007 Report Share Posted January 5, 2007 Hi Hannibal, Serial communication isn't really packet based unless you make it so. Use the LabVIEW example finder and do a search for "serial." Open the "Basic Serial Write and Read.vi" example to check out how to work with a serial port. Once you get the basics down, if you still think you need "packets" you can create your own serial "packets" by transmitting some kind of header and footer like this: "<Packet>your data here</Packet>" Your reader can then be polling the serial port for available bytes at a pace that doesn't eat up the cpu but fast enough not to let the serial port hardware buffer overflow. When bytes are available, read them and append the read data to a string buffer. Scan the string buffer for "<Packet>" followed by "</Packet>." If both are found, remove that part of the string from the buffer, and process it for your data. You can do the same kind of markup with TCP/IP. This is a great way of sending large amounts of data, like flattened custom data types etc. Hope this helps. Quote Link to comment
Neville D Posted January 5, 2007 Report Share Posted January 5, 2007 Hey. I want to create serial communication between 2 computers.I don't know how to create a packet of data in order to transmit. Can you give me some hints? Thanks in advance. Seems like a to me..!! Neville. Quote Link to comment
hannibal Posted January 8, 2007 Author Report Share Posted January 8, 2007 Thanks Petr. I'll try it. Hihi, Neville, I know, it's really like your homework but as for me, it's a problem. Thanks anyway Quote Link to comment
Neville D Posted January 8, 2007 Report Share Posted January 8, 2007 Thanks Petr. I'll try it.Hihi, Neville, I know, it's really like your homework but as for me, it's a problem. Thanks anyway Well Hannibal, if it really is a "problem" for you, take a look at this link: How to ask Questions the smart way People are more than willing to help each other on this forum. But if you want help, explain your application, post some code, show us what you have already tried before posting a question here. Another good place for help is the Examples that already ship with LabVIEW. Neville. 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.