Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 read and compare

Solved!
Go to solution

Hi All, first post so please be gentle.

 

I have created a VI that will send a command to, and then read in from, an RS232 connection. It then compares the data read in with a known string to give a true or false outcome. Firstly it checks the length of strings match, and then compares the actual string with the known string.

 

This is okay, but I cannot always guarantee the string length and all of the text will match, so what I would actually like to do is send the command and then scan through the returned text and look for one specific line in the text. Is this possible, are there any pre-written VIs? I have looked but failed miserably to find one so far.

 

Thanks in advance for any help.

 

Jim.

LABOR OMNIA VINCIT
0 Kudos
Message 1 of 3
(3,669 Views)
Solution
Accepted by topic author jimbobaggies

Use the Match Pattern or the Search/Split String to perform a search a large string for a smaller string.  They return a -1 for the offset is the string was not found.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(3,657 Views)

Hi, thanks for your reply. I used match pattern in the end, thanks for your help.

LABOR OMNIA VINCIT
0 Kudos
Message 3 of 3
(3,606 Views)