8/17/2011 8:43 PM | |
Posts: 3 Rating:
|
hello dear I need to compare two char. in DB 127 from Byte 140 to 170 , are the data which taken by bar code scanner. I need to modify the program, so I need to compare first 10 byte(140 to 150) with the character which i defied it myself. for example data received by scanner in Byte 140 is "a" and I need to compare DB127.DBB140 with the defined char for example 'b'. and the result if are the same the ENO change to 1.in this case because a =/ b so ENO is 0 thank you very much for your assistance... ------------------------------ --------------
|
8/23/2011 6:59 PM | |
Posts: 3 Rating:
|
hello dear attached you can find the archieved project which I copied only one DB on it.as you can see DB no 127 is the share DB.so, byte from 140 to 170 of this DB is the data in "char" format. I want to compare first ten (from 140 to 149) one by one with the 10 char data formtat which I defined it in FC 1. for example byte 140 recieved "a" and I will compare it to the "a" and as the result the ENO of the that comparision function will be ON. if I defined "b" in that function , conclude ENO OFF. anf this process countinue up to byte 149. you now , at the end I need to copmare the barcode which read by barcode scanner with the exact barcode which i defined it already and if the read barcode is the same to defined barcode, the process countiue and othewise not. I hope I could explain my idea completely. thank you very much for your assistance. best regards. AttachmentDb127.zip (30 Downloads) |
8/24/2011 9:33 PM | |
Joined: 1/28/2009 Last visit: 8/8/2023 Posts: 6818 Rating:
|
Dear infernalboy Please check the attachment as a possible solution. 10 characters in your DB127, are compared with the predefined characters stored in DB2 (instant data block of FB2).You can store these predefined values by setting the initial parameters in FB's declaration table.(e.gREF[0]) The process of checking characters is simple and an output is generated when at least one mismatch detected! Use parameter "aus" of the FB2 as a control for the rest of your program.When this parameter is zero there is no mismatch (and 1 for atleast one mismatch). As you PM for a quick and working solution, this is done and may need further modifications. I will update the attachment as soon as I find spare time.Check variable table stored for a quick start Best regards AttachmentDb127.zip (44 Downloads) |
Last edited by: hdhosseini at: 8/24/2011 10:04 PM |
|
11/7/2011 11:06 PM | |
Joined: 1/28/2009 Last visit: 8/8/2023 Posts: 6818 Rating:
|
Dear infernalboy, To initialize "FB2" , as array utilized in it ,simply follow what is done in attachment and also result in corresponding VAT. ( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B' ).For more information on "Arrays" check section "27.3.3.4 Using Arrays to Access Data " of THIS manual. About description of codes,I hope to upload intensively commented version as soon as possible. Best regards, Hamid Hosseini AttachmentINITIALIZE.zip (27 Downloads) |
Follow us on