Using system.print in place of 3rd party software, printing from gateway?

General question here. I recently took over a few systems that utilize 3rd party barcode printing software like BarTender or CoLOS to handle printing barcodes. I recently learned of the system.print functionality and was interested in seeing if anyone uses this to print barcodes on an industrial scale/rate? I enjoy being able to design the barcode in Ignition instead of undocumented and clunky 3rd party software, also I would enjoy being able to see a stack trace as it would remove one layer of complexity and a layer of software where stuff can go wrong (which recently happened to me and I’ve been working with tech support via email for over a week now, whereas Ignition has great support). Not to mention it would seem like it would be much easier to know when to trigger the print instead of 3rd party integration software just constantly polling my database or looking for a file change.

Does anyone the system.print functionality to print say product or case barcodes? And is it 100% necessary to actually create a window? Or, as I suspect, can I just run a gateway script, use system.nav.openWindow with appropriate parameters and be able to print using a reference to that window without it ever opening on a client?

Those functions don’t work in the gateway. There’s no Swing GUI.

1 Like

There goes my dream. Ok good to know.

Well, you could also use the reporting module. Plenty of customers do just what you’re describing - design labels and print them via reporting.

2 Likes

i have try to use the ignition's system.print function in my factory's process to create barcode


i use a template to create a image in the mainwindows

then i write a scripting in the client event, if 1 cycle complete , the opc tag will trigger the print function , it will automatically print a label

i can share you what i learn from this forum

system.print.createPrintJob can only ever work in a Vision client, not in the gateway. The OP wants to generate and print fully automatically from the gateway. Paul’s suggestion is the definitive solution.

i have this error , can you help me please??


image

In your script you use MDMNP021 as the name but it appears the name is MDMNP021 on mdmps001 on the computer. The error hints to this as well.

Also never use time.sleep, and here there is zero reason for it as well.

You can use this to verify

when i use system.print.getPrinterNames() this appear

So...use the name that it shows there in your call to the print functions?

\\mdmps001 is presumably the network location the printer is being provided by.

1 Like

You are running that in the script console. Which will give you the names that the designer JVM knows. That isn't the list that the gateway service will know about.

when i put the script in the Client Event nothing happen

i change this part system.print.getPrinterNames() for system.print.getDefaultPrinterName()