barcode not print on Dymo printer

I am using Dymo label printer.
I use “ESC” commands, and printer is able to print text but not barcode.
Please give me advise, how to print barcode on Dymo label print.
Here is code

[code] if printer.Open(“DYMO LabelWriter 450 Turbo#:1”) then
job= printer.StartDoc(“my document”)
if job> 0 then
if printer.StartPage then
call printer.write (chr(13))
call printer.write (chr(27)+chr(64))
call printer.write (chr(29)+chr(86)+chr(49))'gs V 1
call printer.write(chr(29)+“k”+chr(52)+chr(0)+chr(0)+chr(0)+chr(0)+chr(35)+“0909”+chr(0))
dim s as string =“GS new”+EndOfLine
s=s+“Sample text”+EndOfLine
s=s+“Next line”

    call printer.write (s)
    printer.EndPage
  end
  printer.EndDoc
end
printer.Close[/code]

Just wondering if those Chr(0) are good to have in strings as they are the standard NUL character used to terminate strings.
Can you write 0 as an integer to printer instead?

Have you at least reached Dymo to get some documentation about printing bar codes ?

I just went to dymo.com and there are several models, as well as documentation.

Might be worthwhile assembling the data into a memoryblock and trying to send that.
Or into a file and send that
Since only the OP has a Dymo printer here, its hard to help much.
As Michel says, there is plenty of documentation online.
I dont think the sequence above is right (see all the other posts asking the same question)
But what we cant tell is what exact bytes are going down the wire.

Are they being translated to Unicode by the .write statement for example?
Does the chr(0) stop everything dead?
If chr(52) is to send ‘4’ then are the 4 characters being eaten up by the 0,0,0,35 instead of the 0909?
Im sure it should be using chrb()

Maybe if instead of a printer, the OP opens a binarystream and writes to that, the contents can be checked with a hex editor.?

FIRST FIRST FIRST : What is the right sequence to print a particular bar code on the particular printer the OP keeps asking about without giving any relevant detail.

From what I see in the LabelWriter 450 documentation at
http://download.dymo.com/dymo/technical-data-sheets/LW%20450%20Series%20Technical%20Reference.pdf

That printer itself does not have any built-in label printing capabilities. It has a graphic mode like any standard printer, so to print bar codes it would be necessary to use some third party software such as the Einhugur classes or the J4L Barcode classes for RealStudio I used for my Barcode Maker app.

Sending stuff to the printer without knowing zip seems just as futile as urinating in the wind… Or chasing an untamed ornithoid …

@Michel Bujardet Thank you for reply, I think you have missed link
dymo printer pdf

on line no 35 they suggest code to use. I think I should use chrb(0) as per Jeff Tullin . and I have already used MemoryBlock,
the “call printer.write” code is as below:

[code] dim mb as MemoryBlock
dim datalen, n as integer

declare function WritePrinter lib “winspool.drv” (phandle as integer, pdata as ptr, _
dlen as integer, byref bytes as integer) as boolean

datalen = len(data)
mb = new MemoryBlock(datalen)
mb.StringValue(0, datalen)= data

return WritePrinter(handle, mb, datalen, n)
[/code]

I can create TextArea reference and put all commands in TextArea then call printer.write(TextArea.text) Right?

I have applied TextArea.text to call printer.write(TextArea.text) , but on chrb(29) everything get dead that is nothing printed.

have you tried doing the memoryblock directly?

mb = new MemoryBlock(20) //or whatever
mb.byte(0) = 29
mb.byte(1) = ascb(“k”)
mb.byte(2) = 52

etc
followed by a call to Writeprinter?

@Jeff Tullin Unfortunately “DYMO LabelWriter 450 Turbo” is not supported ESC commands.
DYMO Support verified it and suggest to use SDK.
So I am going to use VB script (that is DYMO support Applescript). Is it ok to use OLEObbject ?

Looking at this line I’m wondering what 52 stands for
From sample at page 32 this parameter must be between 0 and 15

The Dymo printers can be printed to using the normal Xojo graphics-context printing mechanism. I do it, and have happily printed barcodes and other stuff directly onto labels.

Nice spam, Margaret, thanks