0

![]() |
![]() |
Acabo de llegar... |
@fastpho, Hay algo que no entiendo, cuando dices "con respecto al error el compilador no encuentra la dll".
Yo entendía que el compilador ni se entera de la dll a usar, que es el RUNTIME a través del archivo COBOL85.CBR que se encarga de ubicar las funciones dentro de la DLL.
Como te decia estoy trabajando con una maquina con WINDOWS 7 de 64 bits, entonces creí que lo mas lógico seria copiar la DLL de la carpeta de 64 y no la de 32. Ahora, copiando la dll de la capeta de 32 bits, ahora me dice que "InfoFis.exe dejo de funcionar" y se cierra.
Ya le incorporé el seteo de velocidad y puerto (Tambien la version), ahora me da error:COBOL Código:
003580 MOVE "GetAPIVersion" TO FUNC-EPSON-LIB. 003590 CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
la linea 3590.
Al momento de compilar, no hay que especificarle nada al compilador?.
Fastpho, discúlpame las molestias, día domingo y ya tarde. Mañana la seguimos.
Gracias por tu ayuda.
Fastpho sos de Mendoza, mira vos!!! Yo soy de San Juan, vecinos y conectados a través de un foro español!!!
![]() |
![]() |
Senior |
@jhjacomo, El runtime es el que no encontraba la dll , lo que tenes que ver ahora es si la variable version de vuelve el valor de la version de la libreria ,version deberia ser igual a 3.0.2 si no me equivocoCOBOL Código:
MOVE "GetAPIVersion" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. display version.
![]() |
![]() |
Acabo de llegar... |
Hola Foro, buenas noches.
Agradezco al foro y especialmente a FASPHO, por sus consejos y recomendaciones. Ya pude enviar mis primeros comando al controlador fiscal.
Todavía me falta un montón, pero ya pude ver la version de la DLL, setear los baudios y el programa se pincha cuando envio "SendCommand", pero ya va ha salir. Sigo de cabeza en el tema.
Yo el error que estaba cometiendo es copiar EpsonFiscalDriver.dll de la carpeta 64 donde se instala el driver, pensé que como estaba en una maquina de 64 bits, correspondía esa DLL, pero la que anduvo fue la DLL de la carpeta 32.
Saludos.
![]() |
![]() |
Administrador |
@jhjacomo, PowerCOBOL es de 32 bits, así que sólo puedes usar las DLL de 32 bits.
¿Te han ayudado? NO TE OLVIDES de darle al botón
¿Quieres dirigirte a alguien en tu post? Notifícale con una mención, tienes 2 opciones:
- Haciendo clic en el icono
al lado de su nick
- Haciendo clic en el botón
en el editor y escribiendo su nick.
![]() |
![]() |
Senior |
@jhjacomo,De nada ,cualquier duda que tengas aca estamos...![]()
![]() |
![]() |
Acabo de llegar... |
Hola Foro. buen día y feliz jornada para todos.
Y estamos como la pandemia, volviendo a fase 1.
Después de hacer funcionar el CF, al menos con cierre X(emití dos).
Me puse a limpiar el código para incluirlo en mi sistema y resulta que después de eso el controlador no respondió mas a ningún comando.
Entonces volví al formulario con el cual inicie la pruebas y no encuentro la forma de hacerlo andar.
El formulario tiene un ListBox y un botón para pedir el Cierre X.
Por cada comando a enviar voy cargando en el ListBox lo que vos haciendo y hago un display del PROGRAM-STATUS y esta es la salida despues de presionar el boton (Accion y PROGRAM-STATUS):
Ver la Version de la DLL +004219064 Devuelve "3.2.0"
Setear el puerto +002483396
Setear los baudios +002483396
setProtocolType +002483396
OpenPort +002483396
AddDataField LINEA-INFORME-X +002483396
AddDataField LINEA-EXTRA-X +002483396
SendCommand +002483396
ClosePort +002483396
Por cada envió, aparentemente no tengo error, pero después de enviar el "SendComand" el controlador no hace nada y después de enviar el "CosePort" el programa se cuelga con un "ComFis,.exe" dejo de funcionar"
Les muestro el codigo usado en el "Click" del boton:
ENVIRONMENT DIVISION.
DATA DIVISION.
working-Storage section.
01 LINEA-INFORME-X.
03 Comando PIC X VALUE X"08".
03 Comandobis PIC X VALUE X"02".
01 LINEA-EXTRA-x.
03 DataField1 PIC X VALUE X"0C".
03 DataField2 PIC X VALUE X"21".
01 sPort PIC S9(9) COMP-5.
01 sBaudio PIC S9(9) COMP-5.
01 SProtocol PIC S9(9) COMP-5.
01 gState PIC S9(9) COMP-5.
01 FUNC-EPSON-LIB Pic x(40).
01 BufferLen pic S9(9) COMP-5 VALUE 0.
01 version pic x(250).
PROCEDURE DIVISION.
call CLEARLIST OF p-comandos.
***** GetAPIVersion
call ADDSTRING of p-comandos using "Ver la Version de la DLL".
MOVE "GetAPIVersion" TO FUNC-EPSON-LIB.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
display PROGRAM-STATUS.
move VERSION to POW-TEXT of l-version.
call DISPLAYMESSAGE of ComFis using "Ver Version".
***** setComPort
call ADDSTRING of p-comandos using "Setear el puerto".
MOVE spaces TO FUNC-EPSON-LIB.
MOVE "setComPort" TO FUNC-EPSON-LIB.
move 0 to sPort.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE sPort.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "Seteo de puerto".
***** setBaudRate
call ADDSTRING of p-comandos using "Setear los baudios".
MOVE spaces TO FUNC-EPSON-LIB.
MOVE "setBaudRate" TO FUNC-EPSON-LIB.
move 9600 TO sBaudio *> set baudios
CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE sBaudio.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "Seteo de baudios".
***** setProtocolType
call ADDSTRING of p-comandos using "setProtocolType".
move spaces TO FUNC-EPSON-LIB.
MOVE "setProtocolType" TO FUNC-EPSON-LIB.
MOVE 1 TO SProtocol.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE SProtocol.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "setProtocolType".
***** OpenPort
call ADDSTRING of p-comandos using "OpenPort".
MOVE spaces TO FUNC-EPSON-LIB.
MOVE "OpenPort" TO FUNC-EPSON-LIB.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "Open Port".
***** Ver que comando
*AddDataField
call ADDSTRING of p-comandos using "AddDataField LINEA-INFORME-X".
move spaces TO FUNC-EPSON-LIB.
MOVE 2 TO BufferLen.
MOVE "AddDataField" TO FUNC-EPSON-LIB.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE LINEA-INFORME-X
BY VALUE BufferLen.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "AddDataField LINEA-INFORME-X".
move spaces TO FUNC-EPSON-LIB.
*AddDataField
call ADDSTRING of p-comandos using "AddDataField LINEA-EXTRA-X".
MOVE 2 TO BufferLen.
MOVE "AddDataField" TO FUNC-EPSON-LIB.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE LINEA-EXTRA-x
BY VALUE BufferLen.
display PROGRAM-STATUS.
move spaces TO FUNC-EPSON-LIB.
call DISPLAYMESSAGE of ComFis using "AddDataField LINEA-EXTRA".
*SendCommand
call ADDSTRING of p-comandos using "SendCommand".
MOVE "SendCommand" TO FUNC-EPSON-LIB.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "SendComand".
***** ClosePort
call ADDSTRING of p-comandos using "ClosePort".
MOVE spaces TO FUNC-EPSON-LIB.
MOVE "ClosePort" TO FUNC-EPSON-LIB.
CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
display PROGRAM-STATUS.
call DISPLAYMESSAGE of ComFis using "Close Port".
El ambiente de trabaja es unWindows 7 de 64 bit, compilador PowerCobol 3.0, la DLL (EpsonFiscalDriver.dll" 32 bits) está en la carpeta donde esta el ejecutable junto al COBOL85.CBR con la mension de cada función de la dll en el apartado [COMFIS.ENTRY]. El controlador esta conectado via USB y en el administrador de dispositivo
esta instalado dentro del "Controlador de bus serie universal" el driver "EPSON USB Controller for TM/BA/EU Printers".
Disculpen lo extenso de mi exposición, pero tengo cierta urgencia por terminar este tema y quería hacerme entender bien.
Espero puedan darme una mano. Gracias.
![]() |
![]() |
Senior |
@jhjacomo, Etiqueta las lineas de programa para que sea mas facil leer , con respecto a la comunicacion con el impresor fiscal , tenes que chequear Siempre cada vez que envias algo al impresor las propiedades de comunicacion para saber que pasa del otro lado: puede que te apagaron el impresor , no tenga papel , pasaron mas de 24 hs y corresponde hacer una Z si o siVB Código:
Prototype: getState( void );VB Código:
Prototype: int getLastError( void );
Por que siempre el impresor por medio de la libreria te devolvera algo ....
Por ejemplo:COBOL Código:
*> OPEN PORT. move spaces TO FUNC-EPSON-LIB. MOVE "OpenPort" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. move spaces TO FUNC-EPSON-LIB. MOVE "getLastError" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL RETURNING iError. display iError. IF iError = 4 then MOVE "Error de escritura verifique el impresor" to "Text" OF CmCOMUNICACION. IF iError = 0 then MOVE "ok" to "Text" OF CmCOMUNICACION. IF iError = 1 then MOVE "Puerto ocupado" to "Text" OF CmCOMUNICACION. IF iError = 2 then MOVE "Puerto invalido" to "Text" OF CmCOMUNICACION. IF iError = 10 then MOVE "Error de escritura verifique el impresor" to "Text" OF CmCOMUNICACION.Esta informacion esta en el manual del protocolo de la libreria....COBOL Código:
ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 Respuesta PIC S9(9) COMP-5 VALUE 0. PROCEDURE DIVISION. move "getState" to FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL RETURNING Respuesta. * display "state 1" , Respuesta perform until Respuesta not = 2 *> esta ocupada la impresora CALL FUNC-EPSON-LIB WITH STDCALL RETURNING Respuesta * display "state 2" , Respuesta end-perform.
Si estas trabajando por medio de usb podes mirar en Dispositivos e Impresoras de windows ,debe estar el impresor sin error
Saludos
![]() |
![]() |
Acabo de llegar... |
Gracias fastpho por tu respuesta, entiendo lo que dices respecto de los estados, previamente ya lo verifique y su estado es 0, como al programa lo tengo en desarrollo y el controlador esta enfrente mio, estos controles los paso por alto porque yo sé que el controlador tiene papel y nadie me lo apaga, lógicamente al momento de pasarlo a producción entiendo que estos comandos y controles son necesarios.
Respecto a lo que me comentas :"Si estas trabajando por medio de usb podes mirar en Dispositivos e Impresoras de windows ,debe estar el impresor sin error", si mal no recuerdo en la primeras pruebas que realice para sacar mis dos primeras "X", esto no lo tuve en cuenta. De donde tendría que obtener el driver para instalar y que se vea como impresora?
Saludos.
---------- Post añadido : 18:34 ---------- Post anterior : 18:24 ----------COBOL Código:
ENVIRONMENT DIVISION. DATA DIVISION. working-Storage section. 01 LINEA-INFORME-X. 03 Comando PIC X VALUE X"08". 03 Comandobis PIC X VALUE X"02". 01 LINEA-EXTRA-x. 03 DataField1 PIC X VALUE X"0C". 03 DataField2 PIC X VALUE X"21". 01 sPort PIC S9(9) COMP-5. 01 sBaudio PIC S9(9) COMP-5. 01 SProtocol PIC S9(9) COMP-5. 01 gState PIC S9(9) COMP-5. 01 FUNC-EPSON-LIB Pic x(40). 01 BufferLen pic S9(9) COMP-5 VALUE 0. 01 version pic x(250). PROCEDURE DIVISION. call CLEARLIST OF p-comandos. ***** Purge * call ADDSTRING of p-comandos using "Purge". * MOVE "Purge" TO FUNC-EPSON-LIB. * CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. * display PROGRAM-STATUS. * move VERSION to POW-TEXT of l-version. * call DISPLAYMESSAGE of ComFis using "Ver Version". ***** GetAPIVersion call ADDSTRING of p-comandos using "Ver la Version de la DLL". MOVE "GetAPIVersion" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. display PROGRAM-STATUS. move VERSION to POW-TEXT of l-version. call DISPLAYMESSAGE of ComFis using "Ver Version". ***** setComPort call ADDSTRING of p-comandos using "Setear el puerto". MOVE spaces TO FUNC-EPSON-LIB. MOVE "setComPort" TO FUNC-EPSON-LIB. move 0 to sPort. CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE sPort. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "Seteo de puerto". ***** getLastError call ADDSTRING of p-comandos using "getLastError". MOVE "getLastError" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE gState. display gState. move VERSION to POW-TEXT of l-version. call DISPLAYMESSAGE of ComFis using "Ver Version". ***** getState * call ADDSTRING of p-comandos using "getState". * MOVE "getState" TO FUNC-EPSON-LIB. * CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE gState. * display gState. * display PROGRAM-STATUS. * move VERSION to POW-TEXT of l-version. * call DISPLAYMESSAGE of ComFis using "Ver Version". ***** setBaudRate call ADDSTRING of p-comandos using "Setear los baudios". MOVE spaces TO FUNC-EPSON-LIB. MOVE "setBaudRate" TO FUNC-EPSON-LIB. move 9600 TO sBaudio *> set baudios CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE sBaudio. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "Seteo de baudios". ***** setProtocolType call ADDSTRING of p-comandos using "setProtocolType". move spaces TO FUNC-EPSON-LIB. MOVE "setProtocolType" TO FUNC-EPSON-LIB. MOVE 1 TO SProtocol. CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE SProtocol. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "setProtocolType". ***** OpenPort call ADDSTRING of p-comandos using "OpenPort". MOVE spaces TO FUNC-EPSON-LIB. MOVE "OpenPort" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "Open Port". ***** Ver que comando *AddDataField call ADDSTRING of p-comandos using "AddDataField LINEA-INFORME-X". move spaces TO FUNC-EPSON-LIB. MOVE 2 TO BufferLen. MOVE "AddDataField" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE LINEA-INFORME-X BY VALUE BufferLen. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "AddDataField LINEA-INFORME-X". move spaces TO FUNC-EPSON-LIB. *AddDataField call ADDSTRING of p-comandos using "AddDataField LINEA-EXTRA-X". MOVE 2 TO BufferLen. MOVE "AddDataField" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE LINEA-EXTRA-x BY VALUE BufferLen. display PROGRAM-STATUS. move spaces TO FUNC-EPSON-LIB. call DISPLAYMESSAGE of ComFis using "AddDataField LINEA-EXTRA". *SendCommand call ADDSTRING of p-comandos using "SendCommand". MOVE "SendCommand" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "SendComand". ***** ClosePort call ADDSTRING of p-comandos using "ClosePort". MOVE spaces TO FUNC-EPSON-LIB. MOVE "ClosePort" TO FUNC-EPSON-LIB. CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION. display PROGRAM-STATUS. call DISPLAYMESSAGE of ComFis using "Close Port".
![]() |
![]() |
Senior |
@jhjacomo, Por ahi no me explique bien , la impresora fiscal si esta conectada via USB te tiene que aparecer como un dispositivo mas , en dispositivos e impresoras es un chequeo rapido , creo que no te deja sacar el informe X es por que se cumplieron 24 hs , es decir una vez que se inicia la jornada fiscal con cualquier tipo de documento impreso , el impresor comienza a contar 24 hs una vez transcurrido este tiempo no te deja imprimir documentos fiscales o no fiscales , por lo tanto te obliga a realizar un cierre diario Z , como te das cuenta de esto o de cualquier otro error en estas propiedades:
Tambien debes mirar otras propiedades que es :COBOL Código:
* ** ESTADO COMPROBACION RAPIDA 0 NO HAY PROBLEMA move "getReturnCode" TO FUNC-EPSON-LIB. * CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE CODIGO-DE-RETORNO returning CODIGO-DE-RETORNO. CALL FUNC-EPSON-LIB WITH STDCALL RETURNING CODIGO-DE-RETORNO. MOVE CODIGO-DE-RETORNO TO "Text" OF CmRetorno.
Estado Fiscal :
Estado del Impresor :VB Código:
int getFiscalStatus( void );
VB Código:
int getPrinterStatus( void );
---------- Post añadido : 13:49 ---------- Post anterior : 20:33 ----------
@jhjacomo, como te fue , pudiste sacar Z
Saludos
![]() |
![]() |
Acabo de llegar... |
Hola @fastpho, apareció el problema. Mi computadora tiene un enchufe USB de los parlantes que estaba dañado y parece que eso hizo que me dejaran de funcionar algunos USB. Armé todo en una computadora distinta y quedo todo funcionando. Seguí sacando X y Z sin ningún problema, el tema de las 24 horas se refiere a la emisión de comprobantes de venta, no puedo emitir un comprobante si en las ultimas 24 horas no emití una Z, pero X y Z se pueden emitir las que quieras, ahora si el controlador está inicializado, es conveniente sacar UNA Z por día, porque existe una limitación de cantidades de Z´s por controlador, no así las X.
Ahora esto es un OFF TOPIC, se solucionará el problema de los USB reinstalando el windows o ya hay un problema físico en la placa? A alguien le paso algo parecido?
Gracias,
Actualmente hay 1 usuarios viendo este tema. (0 miembros y 1 visitantes)
Marcadores