07-19-2017 05:47 AM
Dear Labview community.
I have a problem regarding the temperature reading in labview using the optris cs lt sensor.
the sensor is set to burst mode. (meaning it only sends data) using a string like the following example: \AA\AA\04\D3.
\AA\AA are 2 synchronisation bytes and the rest is temp data.
the vi i provided you with is working and sometimes reading the correct temp but most of the time it's off. because on every other turn it takes one or both \AA and thus after converting the temp is something like 4000 °C...
do you have any idea whats wrong or how i can get rid of the wrong reading?
best regards
octaris
Solved! Go to Solution.
07-19-2017 06:04 AM
Hi octaris,
example: \AA\AA\04\D3. \AA\AA are 2 synchronisation bytes and the rest is temp data.
So you read 4 bytes and just take the first two of them. Then you expect to get the 3rd and 4th byte of your message for a proper reading of the temp value?
- You need to parse your data more carefully. You may try to search for these \AA marker bytes…
- Clearing the read buffer every iteration isn't the best way to handle your problem. Infact it even makes it worse as you "forget" about any possible synchronization you might achieve when looking for \AA\AA…
07-19-2017 06:13 AM
thank you for your fast reply Gerd!
you are right i only took the first two, because trying to take 4 and parsing them didn't work either.
i have to say i'm a total labview rookie and trying to get this to work is one part of my bacc thesis. 😕
do you have any tips for my how i could synchronize the reading to always have a string like the example from before. or parse it in a way that gets rid of those \AA?
07-19-2017 06:50 AM
i now tried to look for \AA\AA in my string.
it kinda works, because now i never have the 400°C readings but sometimes it takes nothing because he doesnt finde the \AA\AA and so my post string is empty, resulting in -100°C reading.
funny thing is it does work with the visa clear.
and it does not work without it. without the clear statement every iteration it repeats the first reading forever. as seen in the two png files.
any ideas? ^^
thanks for helping me
07-19-2017 06:54 AM - edited 07-19-2017 06:59 AM
Hi octaris,
quick&dirty "solution": just filter those invalid readings!
IF reading is valid THEN plot value on chart ENDIF
Better solution:
- Collect all data received in a string to get something like \AA\AA\xx\yy\AA\AA\zz\aa…
- Then look for those markers: \AA\AA\xx\yy\AA\AA\zz\aa…
- Split the string after the marker to get \AA\AA and \xx\yy\AA\AA\zz\aa
- Throw away the first two bytes containing the marker
- Get the next two bytes from your string (\xx\yy) and keep the rest for the next iteration (\AA\AA\zz\aa)
Using this scheme it should be easy to synchronize to your data stream (as long as the sample value itself is not \AA\AA)…