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 Pattern After a Serial Read - What is Going On?

Solved!
Go to solution

I am communicating with a Velmex VXM controller over serial. The controller returns a '^' termination character when it completes a sequence. I have a message handling loop checking for a termination character, queuing the 'check for termination char' again if it doesn't find it, and moving on if it does (moving on means triggering a DQMH broadcast event in this case if that is of any interest).

 

The Match Pattern vi I am using to check for '^' appears to be finding a match without finding a match. Any ideas here because I'm stumped? I'm getting a match at position 0, but the match substring is blank!?

 

Block diagram:

 

Block diagramBlock diagram

What I'm seeing on the front panel:

Screenshot 2022-08-12 103853.png

 

Serial port setup in case it is useful:

Screenshot 2022-08-12 105242.png

0 Kudos
Message 1 of 4
(814 Views)
Solution
Accepted by topic author db_bh

'^' is a special character, search for "Special Characters for Match Pattern" in LabVIEW help:

LucianM_0-1660299664767.png

For searching a specific character in a string you can use Search/Split String.

 

Lucian
CLA
0 Kudos
Message 2 of 4
(807 Views)

Perfect, thank you!

 

Search/Split String is now doing the job and suddenly it all makes sense.

0 Kudos
Message 3 of 4
(774 Views)

@LucianM wrote:

'^' is a special character, search for "Special Characters for Match Pattern" in LabVIEW help:

LucianM_0-1660299664767.png

For searching a specific character in a string you can use Search/Split String.

 


Why are you going through all of this parsing? Why not let the driver do that for you? Check out this presentation from Tim Robinson (crossrulz on this forum) 

 

Proper way to communicate over serial

 

0 Kudos
Message 4 of 4
(751 Views)