Serial communication via RS232
Moderator: Rathinagiri
Serial communication via RS232
Do anybody wrote an app. communicating via COM port?
I need to communicate with fiscal printer and electronic cash.
A few months ago I saw a post about communication via COM, but I ca'nt find it (even via search function...)
Marek
I need to communicate with fiscal printer and electronic cash.
A few months ago I saw a post about communication via COM, but I ca'nt find it (even via search function...)
Marek
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Serial communication via RS232
I've done such thing, but I've used an utility bundled with printer drivers.mol wrote:Do anybody wrote an app. communicating via COM port?
I need to communicate with fiscal printer and electronic cash.
A few months ago I saw a post about communication via COM, but I ca'nt find it (even via search function...)
Marek
That utility can receive a command line indicating the command to the printer or even the complete invoice as a command text file.
So, I've invoked the utility with EXECUTE command and used required parameters.
AFAIK most of fiscal printers comes with some kind of utility.
This way is more easy and reliable for me.
Anyway , there is a library called 'hbcomm' for com port access. From time to time someone ask for it. I'm not fully sure but I guess that it was already posted here.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
-
radohabjan
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Serial communication via RS232
Hello,mol wrote:Do anybody wrote an app. communicating via COM port?
I need to communicate with fiscal printer and electronic cash.
A few months ago I saw a post about communication via COM, but I ca'nt find it (even via search function...)
Marek
for COM port printer I use normal Clipper commands:
SET PRINTER TO LPT2
SET PRINTER ON ......... SET PRINTER OFF
In autoexec.nt you must add MODE COM1:=LPT2
or you can use command : NET USE LPT2: \\server\printername
Best regards Rado Habjan
Re: Serial communication via RS232
But, I need bidirectional communication..
-
Mario Mansilla
- Posts: 271
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
Re: Serial communication via RS232
Hola Mol :
disculpa recien hoy veo tu post , fijate en un post mio del 23/07/2009 (Serial port) . No se como pegar la direccion directamente , alli hay un error , se corrige colocando :
!Setcom(Handler,2400,8,0) en la apertura .
He probado con mscomm32.ocx hasta win98
Espero que pueda ayudarte .
Saludos Mario Mansilla
Hello Mol:
recent apology today I see your post, look at a post of mine 23/07/2009 (serial port). No such paste the address directly, there is an error, is corrected by placing:
! Setcom (Handler, 2400,8,0) at the opening.
I tried to win98 mscomm32.ocx
I hope you can help.
Saludos Mario Mansilla
disculpa recien hoy veo tu post , fijate en un post mio del 23/07/2009 (Serial port) . No se como pegar la direccion directamente , alli hay un error , se corrige colocando :
!Setcom(Handler,2400,8,0) en la apertura .
He probado con mscomm32.ocx hasta win98
Espero que pueda ayudarte .
Saludos Mario Mansilla
Hello Mol:
recent apology today I see your post, look at a post of mine 23/07/2009 (serial port). No such paste the address directly, there is an error, is corrected by placing:
! Setcom (Handler, 2400,8,0) at the opening.
I tried to win98 mscomm32.ocx
I hope you can help.
Saludos Mario Mansilla
Re: Serial communication via RS232
Many thanks Mario!
I'll test it.
Best regards, Marek
I'll test it.
Best regards, Marek
Re: Serial communication via RS232
But... How to write to port or read from the port?
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Serial communication via RS232
viewtopic.php?f=12&t=266&hilit=hbcommmol wrote:But... How to write to port or read from the port?
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Serial communication via RS232
I've downloaded harbour 2.0 beta 3, and there is hbwin library, which contains communication via RS.
there is a file contrib/hbwin/tests/testprt2.prg
I want to compile it, but compiler still presents error: undefined WinPort and Win_Port function.
I've added libhbcomm.a (I wrote hbwin as a name of library) in IDE configuration, but compile error still exists...
What's going on?
Marek
there is a file contrib/hbwin/tests/testprt2.prg
I want to compile it, but compiler still presents error: undefined WinPort and Win_Port function.
I've added libhbcomm.a (I wrote hbwin as a name of library) in IDE configuration, but compile error still exists...
What's going on?
Marek
Re: Serial communication via RS232
I think, problem with Win_Port lays in libhbwin.a included in HMG - It's different library!
I've looked into file \hmg\harbour\lib\libhbwin.a and I didn't find any text including "Win_Port" !!!
In \hb20\lib\libhbwin.a such a function is defined!
Could you check it, Roberto?
I've looked into file \hmg\harbour\lib\libhbwin.a and I didn't find any text including "Win_Port" !!!
In \hb20\lib\libhbwin.a such a function is defined!
Could you check it, Roberto?