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: 

Match Regular Expression Function input string format

Hi,

I am new to labview and was having some difficulties using the Match Regular Experssion Function.  

I am using labview to communicate with a sensor.  I have installed the NI device driver to do so.  The output of my sensor is in the format, 

X20

R40 P20 A123.  The numbers in this case are arbitrary.  I am trying to use Match Regular Expression Function to display and perform mathematical operations on the numbers.  I am having difficulties formatting the input string on the Match Regular Expression Function.  Could you please give me some tips on how to format the example I provided.  

 

Thank

0 Kudos
Message 1 of 3
(2,472 Views)

 


@MoAgha wrote:

Hi,

I am new to labview and was having some difficulties using the Match Regular Experssion Function.  

I am using labview to communicate with a sensor.  I have installed the NI device driver to do so.  The output of my sensor is in the format, 

X20

R40 P20 A123.  The numbers in this case are arbitrary.  I am trying to use Match Regular Expression Function to display and perform mathematical operations on the numbers.  I am having difficulties formatting the input string on the Match Regular Expression Function.  Could you please give me some tips on how to format the example I provided.  

 

Thank


Here is a way to do it if the format is constant (X R P A followed by a positive integer number).

 

get numbers.png

 

Ben64

Message 2 of 3
(2,450 Views)

Alternately, if the format is fix you can use the scan from string function and convert directly to integers.

 

Ben64

 

get numbers-2.png

Message 3 of 3
(2,440 Views)