Siemens PLC through TCP to Zebra Printer

Well I figured out the port problem. The logic did not setup the port in the UDT until you activated it. Not it just sits with a status of 7000 "No job processing active". I need to find out how to make it active.
 
To send your data to the Zebra printer you just need to trigger the 'REQ' bool of the T_SEND block.

Do you already have a data block filled up with your ZPL code for the printer?

Also just curious did you have to setup you connection inside of netpro?

T_Send_trigger.png
 
This is how I have done it in the past. I haven't updated the blocks in a while so they may need some TLC.

Tcp.zip is a S7 library that has FB707. I use this as a wrapper for all of the T blocks (T_send, rec, con, disc). So you only have one spot to setup your parameters.

I also included a screen shot of one of the cells that currently has it running.

Hope it helps.

PrinterSend.jpg
 

Attachments

  • Tcp.zip
    25.7 KB · Views: 314
My first problem was to get my connection established. I think I have the same blocks as you do. I found that once my connection was established then retriggering the TCON generates an error for "Attempt being made to re-establish an existing connection". The trick I found with the TCON is that once you trigger it you need to capture the results, because you won't see it happen and then it sits at 7000.
 
Fb707 isnt part of the siemens blocks its something I got from a machine builder and updated over time. It take care of alot of the connection settings. It is possible that you have something similar. Can you zip your project and post it or at least create a library of your connection blocks? And we can take a look at them.
 
I got the code from another michigan member. Probably came from the same machine builder. It has helped me a lot with debugging my connection, but I have started from scratch with the knowledge I gained. I like having function blocks that are specific to what I am controlling, and so my new FB will be specifically designed to work with a zebra printer. I will be happy to post it when it is completed. I like giving back to the PLC Talk community for all the help it has given me.
 
Very likely that it is the same block. Looking at the user namei think I work with kjs in the past.

Definetly let us know what you come up with. I always like seeing how other people code :)

I used to keep separate blocks for different devices but it was just so much to maintain so I switched to more 'general' blocks.

Anyways good luck.
 
So I took the example code that I had, and tailored it to the zebra printer. Attached is a screen shot of my custom FB. The way it works is you simply put in a unique connection ID. No setup in netpro is necessary. Then you put in the IP address of the printer. The logic will detect a disconnection of the printer, and a reconnection. I created another FB that is not present in this code that puts together the string I send to the printer to print the barcode using Zebra's ZPL language. This other function block created two useful strings for me to send to the printer. One was the date and time, and the other was the serial number for the barcode. I use the Julian date from the printer so I need to make sure the printer time and date are accurate. Every time my FB establishes a connection to the printer it will send the PLC's date and time to the printer.

Thanks for all your help to get this far, and I hope this helps someone in the future.

ZEBRA FB.JPG
 

Attachments

  • Zebra_Pr.zip
    261.3 KB · Views: 476
First of all, thank you very much for sharing your code, i´m working with a Zebra printer and it has been very useful to connect with the printer, but i have some doubts about how to send the data I want to print. I was wondering if you have some simple example about how to form the string you send to the printer. What I have done is creating a DB where a I have included an ASCII character in each byte, and all the characters joined form the message I want to print (ZPL language symbols included). Then I put this DB as an imput of TSEND FB. Is there another way to manage this data to print? I can´t test my code until next week, and I have serious doubts about this part...
 
Succed, printing on a zebra printer over Ethernet

If someone need the PLC example i can send it to you, [email protected]. I made it work on a Micrologix 1400 and also on an S7-300 Siemens PLC, now working on the Compactlogix.

A lot of memory is consumed by the way.
 
Hi,

I'm trying to setup a zebra printer with Siemens TIA but I'm not getting any connection with the printer. See attached pictures.

Basically not getting "TCON_DONE".

Any suggestions?

Thank you.

pic1.jpg pic2.jpg
 
Zebra connection

6 years later..I'm still trying to get my zebra printer connected to my S7 315.
I've tried your code, but its not connecting. I've checked the IP, port, (PLC and Printer) and the error code is always staying at 7000.
Any idea ?🤞🏻
 
I am not sure that I can answer some of these questions anymore. That project was many years ago, and I have since moved on to other machines. I don't even have a license for the old step 7 classic anymore. If you pull the help file for the instruction that is giving you the 7000 error what does that error mean? Perhaps some of the other people that have used my code could have some insight on this.
 

Similar Topics

Hi guys! I am facing problem while fetching IP of simatic s7 1200 PLC. It gives me info like: Source:SiemensN_0e:fc::f0 Destination:LLDP...
Replies
7
Views
8,309
Hi, I am wanting to control a set of (4) micromaster 440 drives depending upon various events etc. The control of the motors are to be either...
Replies
46
Views
12,940
Hello, I have a question. Is it possible to set up communication between a Allen Bradley PLC and a Siemens PLC through profibus. It's because...
Replies
3
Views
10,616
Hi everyone, I want to upload the program from my CPU317TF-2 DP to my PC via connecting to CP 343-1 Advanced since it has LAN ports and the CPU...
Replies
1
Views
121
Buona sera, Ho dei problemi nell' interfacciare PLC S5 con HMI 2a Gen. Siemens (ad esempio KTP400) tramite IBH Link S5++. il mio obbiettivo è solo...
Replies
0
Views
60
Back
Top Bottom