08-20-2019 02:06 PM
I have a probe that, when connected to serial, streams in the following data set (all strings in \ code display):
v[air speed][units]:T[Temperature][units]:H[Humidity]%:w[Wet Bulb Temp][units]:V[volumetric flow rate][units]\r\n
After each transmission, it then sends what looks like a format string specifying the data sent:
$V:T:RH:WBT:VOLD2\r\n
Then it sends what seems to be a line of nonsensical data (examples below)
v0000.0MPS:T026.7C:H43.7%:w018.2C:V00000.0CMM93\r\n
$V:T:RH:WBT:VOLD2\r\n
@\16\00\E0&\00\00\n\00>\B5
v0000.0MPS:T026.7C:H43.7%:w018.2C:V00000.0CMM93\r\n
$V:T:RH:WBT:VOLD2\r\n
\1C\01\05Dr\03\00\00T\C4\00\00\FC
v0000.0MPS:T026.7C:H43.8%:w018.2C:V00000.0CMM92\r\n
$V:T:RH:WBT:VOLD2\r\n
\00\10\8B\A0\01\00\04\90\C4\18\E8\00\00\00\00\00\80\00\00\00\D0\B1
I have two questions:
1) Can anyone make sense of the last set of data that is sent by the probe? I feel like there must be meaning to it, but I can't determine how to parse it.
2) I wrote the following AE to determine the last piece of v[air speed][units]:T[Temperature][units]:H[Humidity]%:w[Wet Bulb Temp][units] data sent from the system (I don't care about Volume flow)
Is there a way I could improve regular expression string to be more robust?
Solved! Go to Solution.
08-20-2019 03:00 PM
Since your first two examples have the same first two lines...
@JScherer wrote:
...
v0000.0MPS:T026.7C:H43.7%:w018.2C:V00000.0CMM93\r\n
$V:T:RH:WBT:VOLD2\r\n
@\16\00\E0&\00\00\n\00>\B5
v0000.0MPS:T026.7C:H43.7%:w018.2C:V00000.0CMM93\r\n
$V:T:RH:WBT:VOLD2\r\n
\1C\01\05Dr\03\00\00T\C4\00\00\FC...
but the third line have no similarities OR are terminated with CR LF, I have to question what type of interface your probe uses?
Is this by any chance RS-485 half duplex and the OTHER data is just noise on the line?
Ben
08-20-2019 03:40 PM
No solid ideas on the first, but with regards to the second, I assume you'll eventually need to split the strings further in to the separate measurements, yes? If so, you might try the following (attached):
08-20-2019 03:56 PM
@Ben wrote:
Since your first two examples have the same first two lines...
@JScherer wrote:
...
v0000.0MPS:T026.7C:H43.7%:w018.2C:V00000.0CMM93\r\n
$V:T:RH:WBT:VOLD2\r\n
@\16\00\E0&\00\00\n\00>\B5
v0000.0MPS:T026.7C:H43.7%:w018.2C:V00000.0CMM93\r\n
$V:T:RH:WBT:VOLD2\r\n
\1C\01\05Dr\03\00\00T\C4\00\00\FC...
but the third line have no similarities OR are terminated with CR LF, I have to question what type of interface your probe uses?
Is this by any chance RS-485 half duplex and the OTHER data is just noise on the line?
Ben
Ben,
Yes! This was problem 1, I just had to add a termination resistor and everything cleared straight up.