News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_nicf82

Printer line endings

Started by nicf82, 21:38, 06 November 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nicf82

Hi

So I have just bought a Panasonic KX-P1170 and got it hooked up to my CPC464. It works fine after putting a cable together and changing the ribbon. I also cleaned the pins up a bit with some alcohol, but the top and bottoms ones are sometime a bit faint. I am guessing this is to do with the curve of the drum?

Anyway the main thing is, when I send a string to the printer with:

PRINT #8, "Hello"
I will always get 2 line feeds, so the next line is double spaced.

If i explicitly do either(!)

PRINT #8, "Hello";CHR$(13);
or
PRINT #8, "Hello";CHR$(10);
then I get single line spacing. Interestingly it does not care if i terminate with a CR or an LF, both execute a CRLF on the printer.

There is a DIP switch on the printer to control automatic LF, the manual says its either ON (An LF is added to each CR), or OFF (CR only). It does not matter which position I have the DIP switch in, I get the same behaviour.

Any idea how to get it to work normally?

In practice if I use Protext it has a way to re-map the CR or LF char to 0, and I think this will fix the double line spacing there, but I also use other software like Amscalc which can't do this.

Cheers!
Nic

Fessor

https://www.cpcwiki.eu/index.php/Connector:Printer_port
You should disconnect the connection to pin 14 on the cpc in your cable.

nicf82

Thanks @Fessor , just done that, but it does not seem to have made any difference :(

Prodatron

If it isn't the cable (never heard about this issue before) it sounds like a printer specific issue.
This year we tested some real printers again (DMP 2160, NLQ 401 and an MSX printer) and they all behave correctly with the CPC regarding chr(13) and chr(10).
I wonder what happens when you send just some multiple chr(13) and/or chr(10) without printable chars in between?

If you print...
"hello";chr$(10);"hello"
...is it doing a CR, too? Usually the second hello should start right to the upper hello.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

nicf82

@Prodatron If I run


PRINT #8, "HELLO";CHR$(10);"HELLO"
The printer just prints

HELLO
HELLO

So yeah I would have expected it to print the second HELLO below and to the right, but it seems to just treat either a CR or LF as a CRLF!

Prodatron

When reading the manual it seems, that the printer usually only expects CHR(10) for a line feed (e.g. see basic listing at page 47). They even write, that you shouldn't use LPRINT (which sends CR+LF) but open a channel (#1) and use PRINT #1 with a CHR$(10); at the end of each line (see page 44).
So that sounds like a printer specific thing.
I still wonder if it can be switched into Epson compatible mode regarding the line feed behaviour (see page 40).

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

nicf82

Guys sorry my mistake, I hadn't followed the pin layout correctly :picard: and now that I cut the real pin 14 - It has solved the problem!

Thanks for all the help :D
Nic

nicf82

Hi

So, I have tried out another printer, this time an Epson FX80 - and I am getting exactly the same problem as I did earlier with the Panasonic :doh:

There is a DIP switch again for controlling automatic LF behavior, and I have tried it in both positions. I am also using my modified ribbon cable with no connection to pin 14, but whenever I run:

PRINT #8, "Hello"
I am getting 2 line feeds!

Also if I run:

PRINT #8, "HELLO";CHR$(10);"HELLO"
it prints:

HELLO
HELLO

instead of the expected:

HELLO
     HELLO

Since I have had the same problem twice now with different printers, and the Panasonic (Epson compatible) fix is not helping with the Epson, any ideas anyone?

Cheers!
Nic

Powered by SMFPacks Menu Editor Mod