Página 1 de 1

mandar imprimir na SERIAL

Enviado: 28 Out 2005 00:06
por evaldo
Tenho um impressora espon de 40 coluna, ela nao tem porta paralela so serial, queria saber qual o comando que vou usar para imprimir.

Enviado: 28 Out 2005 01:16
por Clipper
Prezado Colega

Para imprimir na serial você deve executar os seguintes comandos antes no prompt do DOS :

// Para uso na COM1

mode com1:9600,n,8,1
mode lpt2:=com1:

ou

// Para uso na COM2

mode com2:9600,n,8,1
mode lpt2:=com2:

Para testar se está funcionando execute a linha abaixo no prompt do DOS :

DIR >LPT2

Se imprimir é porque está funcionando beleza, aí é só você criar um BAT para chamar estes comandos antes do seu sistema.

Depois disso é só redirecionar normalmente em seu programa

SET PRINTER TO LPT2

Até logo.

Marcelo

Enviado: 28 Out 2005 09:31
por gvc
Se vc tem a CA-Tools, existe a função COM_INIT.

Syntax

COM_INIT(<nComPort>,[<nBaudRate>],[<cParity>],[<nDataLength>],[<nStopBits>]) --> lInitialized

Arguments

<nComPort> Designates the port (1 to 4) that is initialized.

<nBaudRate> Designates the selected baud rate for the port. Settings of 300, 600, 1200, 2400, 4800, 9600 and 19200 baud are possible. The default value is 300 baud.

<cParity> Designates parity in the following form: (E)ven, (O)dd, (M)ark, (S)pace, or (N)one. The default value is (N)one.

<nDataLength> Designates the data length; seven or eight bits are possible. The default value is eight bits.

<nStopBits> Designates the number of stop bits, one or two. The default value is one stop bit.

Returns

If the com port is initialized successfully, the function returns .T..