Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-09-2006
rusadir rusadir is offline
Miembro
 
Registrado: sep 2006
Posts: 13
Poder: 0
rusadir Va por buen camino
ayuda con recibir fichero texto por RS-232

Estoy en un proyecto con un terminal metrologic que almacena los
datos en un fichero txt y luego con un software propio se pueden descargar
al PC y necesitaria si alguien me puede ayudar para desde delphi poder descargarme el fichero, para elaborar una programacion que gestione estos ficheros de un forma personal, nose si me he explicado bien si alguien me puediese hechar un cable al respecto lo agradeceria.


Un saludo, Rusadir
Responder Con Cita
  #2  
Antiguo 16-09-2006
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 20
FGarcia Va por buen camino
Saludos!

De acuerdo a tu mensaje necesitas "bajar" del terminal Metrologic un fichero de texto a traves del protocolo RS232 y en delphi manipular esos archivos.

1. Necesitas un componente que te permita conectar via rs232 tu terminal y la PC. Busca ComPort de Dejan Crnila en Sourceforge, hay muchos mas pero ese es el que conosco y uso.

2. Una vez que tengas instalado el componente, necesitas conocer si existe una secuencia de comandos que ordena la descarga del terminal a la pc o si el terminal tiene una opcion que inicia la descarga directamente

3. Para probar tu comunicacion pc - terminal puedes usar el Hyperterminal de windows, solo comprueba que los parametros de comunicacion esten correctos: Velocidad (baudios) Formato (bits) Paridad y control de flujo (Handshaking). Esto te permitira conocer los datos que envia el terminal y la manera en que estan ordenados para despues en tu aplicacion programar el tratamiento; SI el terminal necesita recibir una orden -secuencia de comandos- debes de conocerla para enviarla desde el hyperterminal.

Espero que esto te ayude en tu problema. De otro modo alguien del club nos podria dar mas informacion.
Responder Con Cita
  #3  
Antiguo 16-09-2006
rusadir rusadir is offline
Miembro
 
Registrado: sep 2006
Posts: 13
Poder: 0
rusadir Va por buen camino
Gracias por la ayuda, eso hare, estoy buscando el componente ya y hare las pruebas lo antes que me sea posible. Si consigo algo prometo contarlo,

Un saludo, Rusadir

Última edición por rusadir fecha: 16-09-2006 a las 10:53:43.
Responder Con Cita
  #4  
Antiguo 17-09-2006
rusadir rusadir is offline
Miembro
 
Registrado: sep 2006
Posts: 13
Poder: 0
rusadir Va por buen camino
Adjunto fichero del protocolo metrologic para rs-232

Adjunto pongo el txt bajado de metrologic sobre el que estoy trabajando
con el protocolo del terminal para recibir fichero de datos y el protocolo de subir datos,

Por si alguien se anima y me hecha una manita,


Je Je Je,

Un Saludo, Rusadir


Fichero txt:

****************************************************************************
***** Protocol for downloading lookup files to ScanPal2 terminals *****
****************************************************************************
Note : All commands or records sent to /or received from the ScanPal2
terminals should be ended with a return character (0x0d).
1. Send the "CIPHER" command to ScanPal2 terminal and wait for return.
2. If the terminal returns "ACK", then it is ready for receiving lookup data
from the PC.
3. Send lookup data to terminal record by record. Each record should be ended
with 2 bytes of checksum. The checksum is calculated according to the
following rules:
A. Sum up the record data byte by byte.
B. Devide the sum by 256 to get the first byte checksum value. If this
value happens to be 13 (the return character: 0x0d), change it to 14
(0x0e).
C. The remaining of the above calculation is the second byte checksum
value. If it happens to be 13, change it to 14.
4. If the terminal returns "ACK", send next record to the terminal,
otherwise, re-send the same record to the terminal. Repeat the same
procedures until all the data is successfully transmitted.
5. Send the "OVER" command to the ScanPal2 terminal to stop this communication.

****************************************************************************
***** Protocol for receiving transaction data from ScanPal2 terminals *****
****************************************************************************
Note : All commands or records sent to or received from the ScanPal2
terminals should be ended with a return character (0x0d).
1. Send the "READ" command to the ScanPal2 terminal and wait for return.
2. If the terminal returns "ACK", then it is ready to send data to PC.
3. The format of each record received from the terminal is as follows,
A. The first byte is a sequence count rotated from 0 to 9. It's purpose
is to ensure the correct order of data transmission.
B. The last two bytes are the checksum values. The checksum is calculated
by adding up the sequence count and all the data bytes.
C. Devide the sum calculated above by 256 will get the last byte checksum
value. If this value happens to be 13 (the return character: 0x0d),
change it to 14 (0x0e).
D. The remaining of the above calculation is the first byte checksum
value. If it happens to be 13, change it to 14.
E. Please note that the checksum byte-order for this protocol is different
to that of downloading lookup files.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
verificar fichero de texto arley_molina Varios 2 12-06-2006 20:52:40
fichero de texto con tabulaciones davidgaldo Varios 5 30-11-2005 16:23:38
leer fichero de texto davidgaldo Varios 1 08-11-2005 15:05:12
Ayuda con fichero de texto jadelphi Varios 4 07-10-2004 09:43:14
Recibir parámetros al ejecutar el fichero .EXE en Delphi Tony_G Varios 2 01-12-2003 13:08:57


La franja horaria es GMT +2. Ahora son las 04:29:47.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi