Ver Mensaje Individual
  #96
Antiguo 30 de julio de 2020, 16:25
jhjacomo
Forero Junior
Última Actividad 17.03.2025 00:43
Posts Posts: 21
Likes enviados Enviados: 0
Likes recibidos Recibidos: 7

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.
jhjacomo is offline   Responder Con Cita