banjalukaforum.com https://banjalukaforum.com/ |
|
Delphi \ Bar - Kod citac https://banjalukaforum.com/viewtopic.php?f=18&t=19577 |
Stranica 1 od 1 |
Autoru: | Nemanja666 [ 28 Mar 2006, 11:54 ] |
Tema posta: | Delphi \ Bar - Kod citac |
Moze li mi netko odgovoriti kako da u Delphiju ocitavam kodove koje ucitaca bar-kod citac? |
Autoru: | dsimic [ 29 Mar 2006, 10:42 ] |
Tema posta: | Bar-kod citas |
Citac bar-koda se prikljucuje izmedju tastature i racunara, i sve sto on zapravo radi jeste da "glumi" tastaturu, tj. posalje racunaru ono sto ocita kao ekvivalent pritisnutih tastera. Dakle, nema nikakve posebne podrske za citac bar-koda, nema posebnih drajvera itd... |
Autoru: | RAbbit [ 29 Mar 2006, 16:18 ] |
Tema posta: | Odg |
Trebas uzeti komponentu tj skinuti je sa interneta,domaceg autora koja se zove t-com port za delphi ja mislim da je verzija za delphi 6 koja ce ti resiti sve tvoje probleme.Nju prekompajlirati u vise verzije delphija nece biti problem.Instaliras komponentu i picis dalje sam.Poz. |
Autoru: | dsimic [ 31 Mar 2006, 10:07 ] |
Tema posta: | |
Nije mi jasno sta ce mu to? Licno nisam vidio nijedan citac bar-koda koji se prikljucuje na nacin razlicit od onoga koji sam opisao. |
Autoru: | Vertygo [ 02 Apr 2006, 16:29 ] |
Tema posta: | |
dsimic je u pravu bar code citaci izbacuju samo string tj niz znakova, znaci oni se u sustini ponasaju kao tastatura ![]() |
Autoru: | RAbbit [ 03 Apr 2006, 16:39 ] |
Tema posta: | odg |
Ima posebna komponenta tcom port koja uvelike olaksava posao. |
Autoru: | che.guevara [ 03 Apr 2006, 19:20 ] |
Tema posta: | |
Ako se bar čitač ponaša kao tastatura - sumnjam da bilokakva komponenta može išta da olakša -.- Šta više, onda stvar i ne zavisi od programa ![]() Super stvar, ja sam mislio da je nešto komplikovanije ![]() Koliko košta jedan bar čitač? 100-200 KM ? |
Autoru: | Vertygo [ 03 Apr 2006, 21:42 ] |
Tema posta: | |
Kobre su oko cca 200 KM a ispod toga ne bi isao ![]() |
Autoru: | RAbbit [ 04 Apr 2006, 16:49 ] |
Tema posta: | Odg |
Evo vam malo iz help file-a tcom port komponente kad ste navalili: Opening and closing port Before most of the TComPort methods can be succesfully called, serial port has to be opened. There are two ways to open serial port. Application can call Open method or set Connected property to True. To end a session, call Close method or set Connected property to False. Example begin ComPort1.Open; // open serial port // do some stuff here ComPort1.Close; // end session end; Writing to port Write operations can be performed very easily when using TComPort. There are four methods that deal with writing data. Method Description Write Writes non-typed variable to output buffer. WriteAsync Writes non-typed variable to output buffer in. asynchronous mode. WriteStr Writes string type variable to output buffer. WriteStrAsync Writes string type variable to output buffer in asnychronous mode. Application should also properly set write timeouts. See TComTimeouts class for more detailed description. Example var Str: String; begin Str := 'Hello'; ComPort1.WriteStr(Str); // string type variable ComPort1.Write(Str[1], Length(Str)); // no defined type end; Reading from port Reading from input buffer can be performed in two ways. Usually application calls one of the read methods inside OnRxChar event, which triggers when charachter(s) arrive in input buffer. If read method is called inside OnRxChar event, read timeouts should be set to no wait, that is, read method checks input buffer and returns immidiately, since the number of bytes in input buffer is already known. Application can also call read method outside OnRxChar, but it should set read timeouts properly. See TComTimeouts for more details. Method Description Read Reads from input buffer to non-typed variable. ReadAsync Reads from input buffer to non-typed variable in asynchronous mode. ReadStr Reads from input buffer to string type variable. ReadStrAsync Reads from input buffer to string type variable in asnychronous mode. Example (inside OnRxChar) procedure TForm1.ComPort1RxChar(Sender: TObject; Count: LongWord); var Str: String; begin ComPort1.ReadStr(Str, Count); // do something with Str variable end; Example(outside OnRxChar) var Str: String; begin // set timeouts here or at design time ComPort1.ReadStr(Str, NumberOfBytes); // do something with Str variable end; |
Autoru: | che.guevara [ 04 Apr 2006, 23:16 ] |
Tema posta: | |
![]() |
Autoru: | Vertygo [ 05 Apr 2006, 20:13 ] |
Tema posta: | |
Tu komponentu i taj kod mozes samo iskoristiti ako je u pitanju RS232 barcode citac ![]() ![]() |
Autoru: | RAbbit [ 06 Apr 2006, 18:28 ] |
Tema posta: | |
Ean |
Autoru: | Vertygo [ 09 Apr 2006, 17:29 ] |
Tema posta: | |
Evo coda za prepoznavanje Ean13 bar koda zlu ne trebalo ![]() Kod: Private Function ProvjeraEan13(ByVal BarCode As String) As Boolean
Dim I As Integer Dim CheckSum As Integer Dim Suma As Integer ''' Zadnji broj ne citamo jer je on CheckSum For I = 0 To BarCode.Length - 2 If I Mod 2 = 0 Then Suma += Convert.ToInt32(BarCode.Substring(I, 1)) * 1 Else Suma += Convert.ToInt32(BarCode.Substring(I, 1)) * 3 End If Next I = Suma Mod 10 If I <> 0 Then CheckSum = 10 - I Else CheckSum = 0 End If '''Provjera da li CheckSum odgovara zadnjem broju u barcod-u If CheckSum = BarCode.Substring(BarCode.Length - 1, 1) Then Return True Else Return False End Function Referenca: http://www.barcodeisland.com/ean13.phtml |
Autoru: | ribar2006 [ 09 Apr 2006, 22:32 ] |
Tema posta: | |
Pozdrav, Ne trebaju ti nikakvi drajveri i komponente za prepoznavanje barcod citaca u delphiju. kao sto je vec neko rekao on se kaci na PS2 port i simulira kucanje brojeva sa tastature. Ovo znam licno posto ga ja koristim u mom programu za PCKasu ako ti moze pomoci mogu da ti posaljem verziju programa Pzodrav |
Autoru: | dsimic [ 11 Apr 2006, 16:50 ] |
Tema posta: | PS/2 |
Da, tacno, kao sto rekoh... Kaci se na PS/2, izmedju tastature i racunara, i "glumi" tastaturu saljuci PC-ju procitani kod kao ekvivalent pritisnutih tastera na tastaturi... |
Autoru: | pmalic [ 11 Apr 2006, 19:27 ] |
Tema posta: | |
Postoje i serijski (RS232) i USB bar-code čitači. |
Stranica 1 od 1 | Sva vremena su u UTC [ DST ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |