JotaPey Posted November 27, 2018 Report Share Posted November 27, 2018 I am working on a project that requires an operator to enter a field (on the HMI Screen) by scanning a bar code. I want to be able to confirm that the scanned field has a specific number of characters. The field is linked to a tag that is an ASCII string. It will be an alphanumeric string 25 characters long, and I want to confirm that the scan in fact inputs all 25 characters. Any thoughts on how to do that would be much appreciated! Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted November 28, 2018 MVP 2022 Report Share Posted November 28, 2018 Have you tried the String Length function (in the strings menu)? Joe T. 1 Quote Link to comment Share on other sites More sharing options...
JotaPey Posted November 28, 2018 Author Report Share Posted November 28, 2018 13 hours ago, Joe Tauser said: Have you tried the String Length function (in the strings menu)? Joe T. Thanks for the reply Joe Tauser, that looks like exactly what I was looking for! (Not sure how I overlooked it...) I'm not sure what to put in the B field, if I want to confirm that the Source String is 10 characters, what would I put in the "Length Result" (B field)? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted November 28, 2018 MVP 2022 Report Share Posted November 28, 2018 A is a string you wish to know the length of and B is the numerical length. You would put an INT16 variable in B and compare it to the result of another string (or to the number 10) to see if they're equal. 1 Quote Link to comment Share on other sites More sharing options...
JotaPey Posted November 29, 2018 Author Report Share Posted November 29, 2018 Thanks Flex727, that answers my question! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.