Hello guys, I have the following setup:
1 x Graphite RLCs HMI
1 x Barcode Reader (Acting as Keyboard)
3 x Plcs Mapped using Modbus Tcp/IP
What I want to accomplish:
Using a String Data Tag (Internal) I can scan successfully most barcodes, and store then in the String Data Tag in the HMI.
For the sake of argument lets say I have 3 different screens which I don't want them to be manually accessible, but, rather be accessed if I scan the correct barcode, then It takes me to the correct screen. Each individual screen can be accessed by multiple barcodes. Lets say B.Codes: 1-ABC,2-ABC,3-CBA, any one one those barcodes when scanned should take me to screen#2, and so on for another array of 20 barcodes will take me to screen#3, etc...
I was thinking on solving this by doing the following:
1) Create a String Tag for the Barcode scanner, internal, volatile, and place it as a data entry field on the main screen; named: "Barcode_Scanner"
2) Then create say 100 String tags, internal, non-volatile, which hold the predefined barcodes that are expected to be scanned. Maybe create an Edit screen where I can edit each individually if changes are needed or any editing.
3) then, on the main screen, edit the "Barcode_Scanner" tag, go to the property box:Entry Tab:Actions:On Entry Complete; drag and Drop a Program called "Barcode_Comparison"
4) The Program named "Barcode_Comparison" will compare the barcode Scanner RAW String Num/Char's. versus the Internal Database RAW String Num/Char's.
The Operands and Code I taught of looks like this, but my program is not working, let alone when I click translate I get a message "This Expression must be an integer". I must say I have some experience with the RLC HMI but never done Programs/Functions/or Control; so please bare with me for any upcoming atrocity on my Crimson code skills
My example Code for Program "Barcode_Comparison",:
___________Code begins below_______________________
if (Barcode_Scanner.AsText)== "1-ABC"|"2-ABC"|"3-CBA"
{
GOTOPAGE(Screen_2); //Screen corresponding to any of those Barcodes.
Barcode_Scanner.AsText ="XXX-XXXXX-XXX"; //Clear the TagValue, for Next Barcode Scann Cycle.
else if
(Barcode_Scanner.AsText)== "22-DEF"|"23-DEF"|"23-DEF-01230"
GOTOPAGE(Screen_1); //Screen corresponding to any of those Barcodes.
Barcode_Scanner.AsText ="XXX-XXXXX-XXX"; //Clear the TagValue, for Next Barcode Scann Cycle.
else if
(Barcode_Scanner.AsText)== "55-DEF"|"56-DEF"|"57-DEF-010"
GOTOPAGE(Screen_3); //Screen corresponding to any of those Barcodes.
Barcode_Scanner.AsText ="XXX-XXXXX-XXX"; //Clear the TagValue, for Next Barcode Scann Cycle.
else if
Barcode_Scanner.AsText = "INVALID BARCODE SCAN, Please Try Again"; //Warning for NON valid Code.
}
_______________ End of CODE___________
Please , Any advice is welcome guys, if you consider a different approach is more accurate feel free to point me in that direction, your help will be certainly appreciated.
Thanks in advance!
1 x Graphite RLCs HMI
1 x Barcode Reader (Acting as Keyboard)
3 x Plcs Mapped using Modbus Tcp/IP
What I want to accomplish:
Using a String Data Tag (Internal) I can scan successfully most barcodes, and store then in the String Data Tag in the HMI.
For the sake of argument lets say I have 3 different screens which I don't want them to be manually accessible, but, rather be accessed if I scan the correct barcode, then It takes me to the correct screen. Each individual screen can be accessed by multiple barcodes. Lets say B.Codes: 1-ABC,2-ABC,3-CBA, any one one those barcodes when scanned should take me to screen#2, and so on for another array of 20 barcodes will take me to screen#3, etc...
I was thinking on solving this by doing the following:
1) Create a String Tag for the Barcode scanner, internal, volatile, and place it as a data entry field on the main screen; named: "Barcode_Scanner"
2) Then create say 100 String tags, internal, non-volatile, which hold the predefined barcodes that are expected to be scanned. Maybe create an Edit screen where I can edit each individually if changes are needed or any editing.
3) then, on the main screen, edit the "Barcode_Scanner" tag, go to the property box:Entry Tab:Actions:On Entry Complete; drag and Drop a Program called "Barcode_Comparison"
4) The Program named "Barcode_Comparison" will compare the barcode Scanner RAW String Num/Char's. versus the Internal Database RAW String Num/Char's.
The Operands and Code I taught of looks like this, but my program is not working, let alone when I click translate I get a message "This Expression must be an integer". I must say I have some experience with the RLC HMI but never done Programs/Functions/or Control; so please bare with me for any upcoming atrocity on my Crimson code skills
My example Code for Program "Barcode_Comparison",:
___________Code begins below_______________________
if (Barcode_Scanner.AsText)== "1-ABC"|"2-ABC"|"3-CBA"
{
GOTOPAGE(Screen_2); //Screen corresponding to any of those Barcodes.
Barcode_Scanner.AsText ="XXX-XXXXX-XXX"; //Clear the TagValue, for Next Barcode Scann Cycle.
else if
(Barcode_Scanner.AsText)== "22-DEF"|"23-DEF"|"23-DEF-01230"
GOTOPAGE(Screen_1); //Screen corresponding to any of those Barcodes.
Barcode_Scanner.AsText ="XXX-XXXXX-XXX"; //Clear the TagValue, for Next Barcode Scann Cycle.
else if
(Barcode_Scanner.AsText)== "55-DEF"|"56-DEF"|"57-DEF-010"
GOTOPAGE(Screen_3); //Screen corresponding to any of those Barcodes.
Barcode_Scanner.AsText ="XXX-XXXXX-XXX"; //Clear the TagValue, for Next Barcode Scann Cycle.
else if
Barcode_Scanner.AsText = "INVALID BARCODE SCAN, Please Try Again"; //Warning for NON valid Code.
}
_______________ End of CODE___________
Please , Any advice is welcome guys, if you consider a different approach is more accurate feel free to point me in that direction, your help will be certainly appreciated.
Thanks in advance!