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.
Solved! Go to Solution.
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.
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
You should create a new thread with your question.