Code Sample: Crimson 3.0 String Pattern Matcher

marv_tech

Member
Join Date
Apr 2022
Location
East Coast
Posts
25
New here so not sure if this is allowed, but this is something I developed for a work project to enable the usage of USB barcode scanners with some input validation. It works with Crimson 3.0 HMIs(and auto-migrates to Crimson 3.1).



This is a testbed I prettied up a bit, I have bug tested it to the extent I needed to but it is probably worth testing any patterns that are critical before using them.



Usage looks like this:
pattern.isMatch(input string,pattern string) which will return a boolean true if matched, false otherwise.



Pattern syntax is in the comments and also on the "guide" button on the test page.


To use in your project, just copy the "pattern" program folder to your project. That's it! If you end up using it, just shoot me a thanks if you can.


Some screenshots here: https://forums.mrplc.com/index.php?...-30-simple-string-validation-pattern-matcher/
 
Last edited:
Thank you for posting, I will have a look when thing quiet down. RedLion really should have somewhere on their site so that people can upload stuff. Maybe there could be somewhere here.
 

Similar Topics

Hi All, I would like to ask you if possible to have some samples code for the realization of a software filter to be used in a PLC Micrologix...
Replies
2
Views
2,086
Anyone use the ModbusSlaveTCP.L5X for CompactLogix? I have it installed and cannot seem to set the Modbus (Instrument) ID. I'm expecting to set...
Replies
4
Views
1,973
Does any one have a sample code for creating recipe in RSLogix 5000. I need to be able to save 20 recipes that could have up to 20 ingredients...
Replies
2
Views
2,370
Hello All, I have been trying to refer to the "Day of the Week" Sample code that came with my rslogix 5000 package, however I am receiving an...
Replies
17
Views
14,115
Help I have limited plc coding experience & need to input 0-10 volt dc analog into cscape to show results on meter screen. I have NO idea where to...
Replies
3
Views
2,771
Back
Top Bottom