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

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 ----------

Código COBOL:
  1.  ENVIRONMENT DIVISION.
  2.  DATA        DIVISION.
  3.  working-Storage section.
  4.  01 LINEA-INFORME-X.
  5.     03 Comando        PIC X VALUE X"08".
  6.     03 Comandobis     PIC X VALUE X"02".
  7.  01 LINEA-EXTRA-x.
  8.     03 DataField1     PIC X VALUE X"0C".
  9.     03 DataField2     PIC X VALUE X"21".
  10.  01 sPort             PIC S9(9) COMP-5.
  11.  01 sBaudio           PIC S9(9) COMP-5.
  12.  01 SProtocol         PIC S9(9) COMP-5.
  13.  01 gState         PIC S9(9) COMP-5.
  14.  01 FUNC-EPSON-LIB    Pic x(40).
  15.  01 BufferLen         pic S9(9) COMP-5 VALUE 0.
  16.  01 version           pic x(250).
  17.  PROCEDURE   DIVISION.
  18.      call CLEARLIST OF p-comandos.
  19. *****  Purge
  20. *     call ADDSTRING of p-comandos using "Purge".
  21. *     MOVE "Purge" TO FUNC-EPSON-LIB.
  22. *     CALL FUNC-EPSON-LIB WITH STDCALL   USING BY REFERENCE VERSION.
  23. *     display PROGRAM-STATUS.
  24. *     move VERSION to POW-TEXT of l-version.
  25. *     call DISPLAYMESSAGE of ComFis using "Ver Version".
  26. *****  GetAPIVersion
  27.      call ADDSTRING of p-comandos using "Ver la Version de la DLL".
  28.      MOVE "GetAPIVersion" TO FUNC-EPSON-LIB.
  29.      CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
  30.      display PROGRAM-STATUS.
  31.      move VERSION to POW-TEXT of l-version.
  32.      call DISPLAYMESSAGE of ComFis using "Ver Version".
  33. *****  setComPort
  34.      call ADDSTRING of p-comandos using "Setear el puerto".
  35.      MOVE spaces       TO FUNC-EPSON-LIB.
  36.      MOVE "setComPort" TO FUNC-EPSON-LIB.
  37.      move 0 to sPort.
  38.      CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE sPort.
  39.      display PROGRAM-STATUS.
  40.      call DISPLAYMESSAGE of ComFis using "Seteo de puerto".
  41. *****  getLastError
  42.      call ADDSTRING of p-comandos using "getLastError".
  43.      MOVE "getLastError" TO FUNC-EPSON-LIB.
  44.      CALL FUNC-EPSON-LIB WITH STDCALL   USING BY VALUE gState.
  45.      display gState.
  46.      move VERSION to POW-TEXT of l-version.
  47.      call DISPLAYMESSAGE of ComFis using "Ver Version".
  48. *****  getState
  49. *     call ADDSTRING of p-comandos using "getState".
  50. *     MOVE "getState" TO FUNC-EPSON-LIB.
  51. *     CALL FUNC-EPSON-LIB WITH STDCALL   USING BY VALUE gState.
  52. *     display gState.
  53. *     display PROGRAM-STATUS.
  54. *     move VERSION to POW-TEXT of l-version.
  55. *     call DISPLAYMESSAGE of ComFis using "Ver Version".
  56. *****  setBaudRate
  57.      call ADDSTRING of p-comandos using "Setear los baudios".
  58.      MOVE spaces        TO FUNC-EPSON-LIB.
  59.      MOVE "setBaudRate" TO FUNC-EPSON-LIB.
  60.      move 9600          TO sBaudio *> set baudios
  61.      CALL FUNC-EPSON-LIB WITH  STDCALL   USING BY VALUE sBaudio.
  62.      display PROGRAM-STATUS.
  63.      call DISPLAYMESSAGE of ComFis using "Seteo de baudios".
  64. ***** setProtocolType    
  65.      call ADDSTRING of p-comandos using "setProtocolType".
  66.      move spaces TO FUNC-EPSON-LIB.
  67.      MOVE "setProtocolType" TO FUNC-EPSON-LIB.
  68.      MOVE 1 TO SProtocol.
  69.      CALL FUNC-EPSON-LIB WITH STDCALL USING BY VALUE SProtocol.
  70.      display PROGRAM-STATUS.          
  71.      call DISPLAYMESSAGE of ComFis using "setProtocolType".
  72. *****  OpenPort
  73.      call ADDSTRING of p-comandos using "OpenPort".
  74.      MOVE spaces     TO FUNC-EPSON-LIB.
  75.      MOVE "OpenPort" TO FUNC-EPSON-LIB.
  76.      CALL FUNC-EPSON-LIB WITH  STDCALL  USING BY REFERENCE VERSION.
  77.      display PROGRAM-STATUS.
  78.      call DISPLAYMESSAGE of ComFis using "Open Port".
  79. *****  Ver que comando
  80. *AddDataField
  81.      call ADDSTRING of p-comandos using "AddDataField LINEA-INFORME-X".
  82.      move spaces TO FUNC-EPSON-LIB.
  83.      MOVE 2 TO BufferLen.
  84.      MOVE "AddDataField" TO FUNC-EPSON-LIB.
  85.      CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE LINEA-INFORME-X
  86.           BY VALUE BufferLen.
  87.      display PROGRAM-STATUS.
  88.      call DISPLAYMESSAGE of  ComFis using "AddDataField LINEA-INFORME-X".
  89.      move spaces TO FUNC-EPSON-LIB.
  90. *AddDataField
  91.      call ADDSTRING of p-comandos using "AddDataField LINEA-EXTRA-X".
  92.      MOVE 2 TO BufferLen.
  93.      MOVE "AddDataField" TO FUNC-EPSON-LIB.
  94.      CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE LINEA-EXTRA-x
  95.           BY VALUE BufferLen.
  96.      display PROGRAM-STATUS.
  97.      move spaces TO FUNC-EPSON-LIB.
  98.      call DISPLAYMESSAGE of ComFis using "AddDataField LINEA-EXTRA".
  99. *SendCommand
  100.      call ADDSTRING of p-comandos using "SendCommand".
  101.      MOVE "SendCommand" TO FUNC-EPSON-LIB.
  102.      CALL FUNC-EPSON-LIB WITH STDCALL USING BY REFERENCE VERSION.
  103.      display PROGRAM-STATUS.
  104.      call DISPLAYMESSAGE of ComFis using "SendComand".
  105. *****  ClosePort
  106.      call ADDSTRING of p-comandos using "ClosePort".
  107.      MOVE spaces     TO FUNC-EPSON-LIB.
  108.      MOVE "ClosePort" TO FUNC-EPSON-LIB.
  109.      CALL FUNC-EPSON-LIB WITH  STDCALL   USING BY REFERENCE VERSION.
  110.      display PROGRAM-STATUS.
  111.      call DISPLAYMESSAGE of ComFis using "Close Port".
jhjacomo is offline   Responder Con Cita