ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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
(3,189 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
(3,167 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
(3,157 Views)