Serial data filtering + interpretate

#1

Hello community.

This is my first post on this grupo so please be patient and forgive me my mistakes.

I am newbie with java, But i am trying my best.

I already connected Masimo Rad-7
[ http://gaursurgicals.in/wp-content/uploads/2018/07/radical7.png]
to
Raspberry pi 3 B+
using standard RS232 to usb wire

I am receiving data in such form in debug:

Blockquote
"03/10/19 13:48:12 SN=---------- SPO2=091% BPM=075 PI=00.90 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:13 SN=---------- SPO2=091% BPM=075 PI=00.91 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:14 SN=---------- SPO2=091% BPM=075 PI=00.97 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:15 SN=---------- SPO2=091% BPM=075 PI=00.97 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:16 SN=---------- SPO2=093% BPM=075 PI=01.00 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:17 SN=---------- SPO2=092% BPM=074 PI=01.00 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:18 SN=---------- SPO2=092% BPM=074 PI=01.00 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:19 SN=---------- SPO2=092% BPM=074 PI=01.00 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:20 SN=---------- SPO2=092% BPM=074 PI=00.99 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:21 SN=---------- SPO2=092% BPM=074 PI=00.99 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:22 SN=---------- SPO2=092% BPM=074 PI=00.99 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:23 SN=---------- SPO2=092% BPM=074 PI=00.96 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:24 SN=---------- SPO2=092% BPM=074 PI=01.10 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:25 SN=---------- SPO2=092% BPM=074 PI=01.10 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:26 SN=---------- SPO2=091% BPM=074 PI=01.00 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:27 SN=---------- SPO2=089% BPM=074 PI=01.10 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:28 SN=---------- SPO2=091% BPM=074 PI=00.97 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:29 SN=---------- SPO2=091% BPM=074 PI=00.93 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:30 SN=---------- SPO2=091% BPM=074 PI=00.93 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:31 SN=---------- SPO2=091% BPM=074 PI=00.93 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:32 SN=---------- SPO2=092% BPM=075 PI=00.93 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:33 SN=---------- SPO2=091% BPM=078 PI=00.92 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:34 SN=---------- SPO2=090% BPM=078 PI=00.91 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:35 SN=---------- SPO2=092% BPM=080 PI=00.89 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
"03/10/19 13:48:36 SN=---------- SPO2=092% BPM=080 PI=00.85 SPCO=--% SPMET=--.-% SPHB=--.- SPOC=-- RR=--- DESAT=-- PIDELTA=+-- PVI=--- ALARM=000000 EXC=0000800 EXC1=00000000↵"
Blockquote

I am able to send data to file and after all i can also filter in calc / excell requested data, but what is my target is to filter data, and to be able to log to webserver and read it in real time.

The problem for me is to generate formulas understandable for graphs

#2

It’s javascript not java.

The data is a string (look at the quotes) so you will need to split it into different parts.

This is trivial to do with a function node and the javascript split command. There are numerous tutorials online if you google for “javascript split”

#3

I'm not in a position to assist only able to give clues...

  1. I believe you can set a delimiter on the serial node. Set that to carriage return (or line feed or whatever the data sends at the end of its line)
  2. Send the output to a function node than use msg.payload.split(" ");.
  3. Send that to a debug node to see if it's splitting the lines into and array of strings containing XXX=yyy
  4. Next you need to loop through the array and split each element by =. E.g. var propValPair = splitData[I].split("=");

Give them steps a try first, see where you get. If you get stuck, export and post your flow here between three backticks ```

Google search is your friend here.

#4

Thank You Steve-Mci

I will try Your tips in next couple of days.

I reach my target in round way.
I am really newbie with javaSCRIPT
Last experience was nearly 20 years ago based on turbopascal :slight_smile:

According to few tutorials i wrote fuctions like asking 3 years old kid to replicate letters:

I spered data by [Space]
Then read exact part trim,
then again i cut string - this time by (=)
As final efect i reach something like that

What is problematic - when i am turning off the source of serial data, there is no information about disconnect of infoirmation.

I will try to figureout, how to add the button ie:
If incoming string from serial - then displey connected; other display disconected.



2019-03-10_19h46_51
2019-03-10_19h47_10