LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I check that all numbers in a serial number are numeric

Solved!
Go to solution

I wrote a vi that checks to make sure that a serial number is in the "mmddyy-xxx" format, where xxx can be from 0 to 999. The problem is if I enter something like "012210-A1" it passes. Is there an easy fix to fail anything where xxx is not in the 0 to 999 range?

 

Thank you

0 Kudos
Message 1 of 4
(3,024 Views)
Solution
Accepted by chuck72352
You could use the Lexical Class function. If the character is a digit between 0 and 9, it returns a class number of 3.
Message 2 of 4
(3,020 Views)

Hello,

 

Please check the link below:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=370717&requireLogin=False

 

Is this what you need?

 

Thanks.

 

Best Regards

Luciano Borges
Test Development Engineer
Message 3 of 4
(3,014 Views)

Hi chuck,

 

you can do it that way:

convert.png

When the serial number isn't correct you will get an error from the ScanFromString function...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(3,005 Views)