03-11-2014 06:19 AM
Hello,
I need to read some telemetry from an equipment. The telemetry's lenght is exactly 113 bytes. It doesn't have start and end bytes, however the 2nd and 3rd byte is always "DD" and the last two bytes are a check error CRC of the other 111 bytes.
At the moment, using the VI I'm sending attached, I can read the telemetry but with some problems. Sometimes, it will not read from the correct 1st byte, which will cause a bad interpretation of the telemetry. And there are times that it does not read all the 113 bytes (it will read only between 86 ~ 109 bytes), which is also a big problem.
When these problems occur, it will often read correctly again on the next serial read. However, sometimes it takes a long time to read correctly and I can't afford this.
These problems are all random. During an hour it may have very few problems and then in 10 minutes it may have lots of consecutive serial read problems. I used other softwares to check the telemetry and they didn't have these problems. That means I'm not using correctly LabVIEW to read the serial or there is something I'm missing.
About the VI, I just want to read correctly the 113 bytes and use a queue to send the data to another while loop. When it doesn't read the 113 bytes or when the 2nd and 3rd bytes are not "DD" or when there is some problem on the serial, I "reset" the communication by closing it and opening it again.
Could anyone send suggestions and recommendations about my problem and my VI so I can hopefully solve this situation? Any help would be appreciated.
Thank you very much. Best regards,
William Kiyoji Ariyoshi (LabVIEW8.5)
Solved! Go to Solution.
03-11-2014 07:17 AM
Turn off the termination character. That is done with the Configure Serial Port VI (there is a boolean on the top of the VI that needs a FALSE wired to it). By default, the termination character is set to 0xA. So if you have that character anywhere in your data stream, the VISA Read will stop there.
I also recommend moving the setup and closing of the serial port outside of your While loops. You should only setup and close it once. You also need to add a clean way to stop the outer While loop (aborting the VI is not a good idea, especially since you are using communication buses).
03-11-2014 08:09 AM
That makes lots of sense. I will try doing your suggestion and I will reply as soon as possible.
Thanks for your answer crossrulz!
03-11-2014 03:40 PM
You are my hero, crossrulz! Now it is working without any errors. Thank you very much!
I was having this trouble for a long time and I never imagined that it would be this simple. I should read more carefully the help details. Thanks!
03-11-2014 06:39 PM
As I keep telling my coworkers, learn from my mistakes. I've personally ran into that issue, which just makes it easier to spot.