LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get last instance of [Data String]

Solved!
Go to solution

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)

ParseStream.png

Is there a way I could improve regular expression string to be more robust?  

0 Kudos
Message 1 of 4
(3,039 Views)
Solution
Accepted by topic author JScherer

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(3,014 Views)

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):

 

String Manipulation.PNG

--------------------------------------
0 Kudos
Message 3 of 4
(2,996 Views)

@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.

Message 4 of 4
(2,992 Views)