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: 

How to prevent empty string being logged?

Solved!
Go to solution

Hi,

 

I am trying to prevent empty string from being logged in a SQL database. If the program work correctly, it will see if two strings are matched. If the two string are matched, the string will be logged to database. If mismatched, the string should not be logged and produce an error message. The problems that I am facing is that the "Match Pattern.vi" produce an empty string if mismatched and still logged to the database. How can I prevent that from happening?

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

The typical way is to use the "offset past match" output and use Greater Or Equal To Zero.  If that is TRUE, then log; if FALSE, do nothing.  This can be easily accomplished with a simple Case Structure.


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
(2,054 Views)
Solution
Accepted by Engineer123

Did you try testing the string(s) using the Empty String? function on the Comparison Palette?

 

Bob Schor

Message 3 of 3
(1,968 Views)