Jump to content

Petr Klapka

Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by Petr Klapka

  1. 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.
×
×
  • Create New...

Important Information

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