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
(794 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
(787 Views)

Perfect, thank you!

 

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

0 Kudos
Message 3 of 4
(754 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
(731 Views)