From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

regular exp

Hello all,

Thanks all for serie of suggestions

I went to regexp cause "nn.nn" could be "open" if probe is not connected so it was a manner to 

manage this exception. here three possible messages :

 

\s\s26.41\s\s\s\sopen\00\s\n

 

\s\sopen\s\s\s\s25.42\00\s\n

 

\s\sopen\s\s\s\sopen\00\s\n

 

 

Regards

 

Tinnitus

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 11 of 19
(599 Views)

big erratum right ones are

 

\s\s26.41\s\s\s\s25.42\s\n

 

\s\s26.41\s\s\s\sopen\00\s\n

 

\s\sopen\00\s\s\s\s25.42\s\n

 

\s\sopen\00\s\s\s\sopen\00\s\n

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 12 of 19
(596 Views)

That's quite different from the original post 😉

 

Here's a quick example of code to extract those string values.  Since I have no clue what you will be doing next, I placed them into a 2-D array.  Depending on what you do next, there may be better ways of implementing the code.

 

It still uses Scan from String.  I'm sure an elegant solution can also be done using regular expressions.

 

 

0 Kudos
Message 13 of 19
(584 Views)

I think my head is about to explode.

 

Of course, this always seems to happen whenever I look at regex.

0 Kudos
Message 14 of 19
(577 Views)

regex are our friends 😉

0 Kudos
Message 15 of 19
(572 Views)

@tinnitus wrote:

big erratum right ones are

 

\s\s26.41\s\s\s\s25.42\s\n

 

\s\s26.41\s\s\s\sopen\00\s\n

 

\s\sopen\00\s\s\s\s25.42\s\n

 

\s\sopen\00\s\s\s\sopen\00\s\n


After looking at these possible messages I think you should definitely go with the Scan from string function. LabVIEW do not support NULL character \00 in regex matching, you will get error -4702 (so sad, regex are so cool).

 

Ben64

0 Kudos
Message 16 of 19
(562 Views)

@ben64 wrote:

 

After looking at these possible messages I think you should definitely go with the Scan from string function. LabVIEW do not support NULL character \00 in regex matching, you will get error -4702 (so sad, regex are so cool).

 

Ben64



Don't let that stop you.

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 17 of 19
(558 Views)

Obviously you can filter out the NULL character but you then have to use 2 functions to achieve the same result as the Scan from string function.

 

Ben64

0 Kudos
Message 18 of 19
(552 Views)

yes and no,

 

i mention "open" but  i forgot \00 Smiley Sad

 

the buffers given were 4 differents buffers depending if all (2) sensors are presents or not

 

 

Thank you for all detailed examples

 

Regards

 

Tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 19 of 19
(524 Views)