Commands for IBM fiscal printers

forum.td.development (2005-2010)
NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Commands for IBM fiscal printers

Post by NewsgroupServer » 27 May 2010, 14:38

 Posted by:  Roberto José 

Hey all,
My application should interface with an IBM fiscal printer, wich has a set
of commands that's giving me some headache.
Top illustrate:
BYTE
BIT
CONTEÚDO
TIPO
TAMANHO
Nota

0
1

1B66 - command prefix
hex
2

2
2

01 - prints header
hex
1

3
3

command extension:
hex
1

7-0
reserved (always = 0)

4
23

customer ID
ASCII
20
1

24
53

customer name
ASCII
30
1

54
132

customer address
ASCII
79
1

This command would be like this:
Set sCmd = SalNumberToChar( 27 ) || SalNumberToChar( 102 ) ||
SalNumberToChar( 1 ) || SalNumberToChar( 0 ) || sFvaID || sFvaNm || sFvaAddr
There is a Chr(0) in the middle of almost every command and when I evaluate
the string sCmd, it is never there. It is like it was not concatenated in
the first place, therefore, the command is rejected by the printer.

The external function this buffer should send the command to is:
_cdecl version:
int iSendCommand(unsigned char *TxBuffer, unsigned long ulTxDataLength)

I am using CTD 1.5.1 - PTF 6.
Any suggestions? I have tried a lot of things so far.

Regards,
RJ

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Commands for IBM fiscal printers

Post by NewsgroupServer » 29 May 2010, 10:25

 Posted by:  Igor Ivanovic 


You can't manipulate the structure as a string.
Take a look at cstruct.apl, there you have a number of functions to
manipulate such structures.

Return to “td.development”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests