FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|
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 |
|