03-25-2010 02:09 PM
I have a continuous stream of data coming in via my serial port. Basically, I want Labview to be able to wait for the byte '08' to arrive at the serial port and then read that and the following couple of bytes.
The problem is I have no idea how to isolate that specific section of bytes from a continuous data stream. It doesn't appear on a regular basis (only when an event happens on the device), and I need to be able to read it everytime it appears (not just the first time).
I've used the VISA read / write process before, but never for something like this, and I'm really at a loss. Any help would be hugely appreciated.
Brian
Solved! Go to Solution.
03-25-2010 02:44 PM
You could set up byte 08 as a termination character and enable termination characters. Read a large number of bytes. The read will either timeout, acquire the large number bytes, or return what it has received up to and including the 08. Now if you want to read a specific number of bytes after that, then to a Read of that number of bytes.
Probably better is to just read the serial port continuously and search for the 08 byte that may appear in the string and just parse the data accordingly based on where that 08 occurs.
03-25-2010 03:28 PM
03-26-2010 07:59 PM
01-10-2012 03:35 AM
hallo
i also have problem regarding read only specified bytes. the problem is i am making a software which to read a data from telemetry and have to read 2 command frame n as soon i received perfect comman frame i have to reply with status frame.i have define all protocal and there is a communication but not in a smooth manner i tried to shearch shot out by shearching 1st charcter . when i get a perfet command frame there is communication now the problem is the command frame after certain time it is incomplet i.e, normally it should be 84 bytes but after some time it shifted i dont know how to solve this prob .it would be nice if anyone help me out
01-10-2012 10:53 PM
You should create a new thread with your question.