ZD410 SGD.GET odometer.total_label_count returns device.host_status

Hello,

At the top of this image where you see <Print>.. I SGD.GET device.host_status. Where you see sensor.p:.. is me requesting sensor.peeler.. the odometer:.. is me requesting odometer.total_label_count. Each time the printer prints.. I get this device.host_status bleeding into my other responses.

I've also limited my code to only issuing the SGD.GET("odometer.total_label_count", Conn); ,but I'm getting the value of device.host_status even though it was never called. The image below is me trying to determine where that unexpected data was coming from (030,0,0,0112,000,0,0,0...). If you look near the bottom you will see after the label prints I begin to get the expected results.

I believe SGD just wraps ZPL or similar commands and fetches the odometer.total_label_count from ZPL ~HQ. In doing so it is not always parsing the value to return for odometer.total_label_count correctly.

I'm using LinkOS SDK and developing in Visual Studio C# .NET

output.png

Kenny Gregory
(No subject)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
The above image was produced

The above image was produced with the following call: LinkOsPrinter.GetSettingValue("sensor.peeler");

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
I believe I have limited this

I believe I have limited this to firmware as before I uploaded the firmware I was not getting this problem. Unfortunately I'm not able to find a firmware archive so that I can get our printers back into production until we get a proper answer on where the bug lies in LinkOS

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Kenny, Which version of

Hi Kenny, Which version of firmware are you seeing this on?  V84.20.10Z?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
I have tried firmware

I have tried firmware versions:

v77-20-01z

v84.20.10z

Unfortunately the initial firmware on one of the printers our company purchased had a firmware that did not have this issue, but in troubleshooting the remaining printers (all the same model) I did not document that working version like a dummy. I did not know at the time what the cause was and firmware was one of many things I have tried, however I feel I have limited it down to the firmware and have attempted different approaches and minimal code with same results. I debugged the LinkOS SDK using Resharper and got these same results directly from the SDK.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Kenny, Do you have this

Hi Kenny,

Do you have this connected over USB and do you have a Zebra Designer driver installed for it?  If so, you may have the status/port monitoring feature for the driver turned on.  Basically the driver may be the one requesting the ~HS (your output) occasionally to make sure it knows the current status of the printer.  There is no way of distinguishing between sources/outputs over USB, so your app is capturing it.  You can remove the monitor by closing it in the system tray or uninstalling it in Add/Remove Programs

I did verify that directly sending "! U1 getvar \"odometer.total_label_count\"\r\n"  gets the correct value in this firmware on a ZD410.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Kenny Gregory
I'm using USB_DIRECT

I'm using USB_DIRECT connection type. I installed the software on Zebra's setup cd but we are not using the designer. I did install the Zebra driver I can get you the version when I return to work tomorrow. It only triggers this when the device prints so if that makes sense to you then it's worth a shot. I can request settings from the printer all day and get valid results until it occurs during a print. I'm testing this on multiple Microsoft surface tablets all running Windows 10 and a Dell notebook.

Did you do your getvar on a separate thread while printing on the other? This would recreate the scenario I'm facing.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
And yes tomorrow I will try

And yes tomorrow I will try your suggestion and get back with you on that. Thank you for the help. I've reached out multiple times now on different outlets to get no response and again these printers are on the production floor so the time to troubleshoot this reflects on me.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
And one more thing.. I get a

And one more thing.. I get a lot of Malformed setting errors. I decided to GetAllSettings and just pull from the Dictionary<string, string> it returns the keys I was seeking and this method seems to trigger the Malformed settings, but I can call it again and it will be fine. Again when the device prints it causes these problems. Otherwise results are as expected. This leads me to believe that your statement about the driver could be accurate and a valid option to test.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
Okay so this morning I have

Okay so this morning I have had a chance to verify Zebra Designer is not installed:

Here is the driver version:

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Kenny,Even if you don't

Hi Kenny,

Even if you don't have ZebraDesigner application installed, the driver Zebra provides is still a ZebraDesigner driver.  It's not a problem, just check for the Zebra Status Monitor in your system tray or in the "Add/Remove Programs list".  The Status Monitor is an optional install when you install the driver. Turn off or uninstall the monitor. The driver itself is fine and won't communicate with the printer without direct user interaction.

I did run the attached multi-threaded program and it's functional but not well. I did not get the unexpected data directly, but I did get a couple of malformed status responses because the response from one thread was showing up in the data being looked at by another thread. The reason is that running multi-threaded communication over USB is very problematic.  USB is essentially a serial connection.  It has no method to direct input or output to any specific thread.

If you do want to communicate to the printer via multiple threads you need to take into account the idea that you may receive extraneous data.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Kenny Gregory
Robin,Yeah I don't have the

Robin,

Yeah I don't have the Zebra Status Monitor either. I'll explain what I'm trying to do so maybe that would be easier. We are printing barcode labels and the user needs to specify the quantity between cycles. Lets say they print 2 barcodes. We have a peeler attachment so we want to print and wait until the user peels it so we check sensor.peeler until we get a 'clear' status. Then the next label will feed. They click the print button and repeat this cycle. It's a simple process, but what's causing me headaches is that when I send a Print to draw the barcode I can not seem to capture an event that the print has ended. If I use Windows EndPrint event it triggers immediately. So I changed my approach and monitored the jobs on the device, but it always returns 0. Every setting I think to monitor or event I try to catch leaves me empty handed. This is why I had went the route of monitoring the odometer and making sure the label qty had printed before I began looking at the sensor.peeler to see if it was clear. I believe even if I write a loop that after Print() is called to monitor the odometer and peeler that it will still give me this unexpected response containing the device.host_status. I will confirm this unless you have another solution.

It seems that as soon as I send the Print() call it spools and I'm not able to find anywhere to catch an event that its complete. Is there a way to trigger an event from the device when its done printing that label. Or a way you would suggest for me to monitor.. If I monitor the sensor.peeler itself there is room for error and the app can get stuck in a unexpected flow. So I really need to know that a label has printed before I start reading from the sensor.

Thank you very much for your time

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
HI Kenny, If you look at the

HI Kenny,

If you look at the code I sent, we do tend to recommend the status checking loop after sending the print job, but on the same thread.  It will start checking while the print job is working.  You can use the odometer to do this.  You can also use the "printerStatus.numberOfFormatsInReceiveBuffer" by checking the count on this status to see when each print out is complete.

The device.host_status is what get's called by the ZebraPrinter.GetCurrentStatus(); function in the SDK.  If you are using that as well, it might be why you are getting this response on different threads. When GetCurrentStatus() receives bad or garbled data, it throws a "malformed status response" . 

There is also the ZebraNet Alerts system. The "PQ JOB COMPLETED" and "LABEL READY" are alerts you may want to look into. I can't guarantee they they won't get garbled with the other USB communications though. 

I hope this is helpful,

Robin

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Kenny Gregory
Robin,Okay I'll give this a

Robin,

Okay I'll give this a shot. Thank you once again for your time at least now I have some information to work with. I'll report back once I am able to implement these suggestions.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
Okay so I think the

Okay so I think the difference here is that you are sending ZPL through the printer.Connection.Write and I'm having to use PrintDocument Class (System.Drawing.Printing) ... We have our own barcode font and I'm not sure of a way to tell the printer to use and how to make sure its formatted properly since we have high speed scanners that read the label on papers they are placed on. So the way I went about it was using the PrintDocument class and e.Graphics.DrawString($"*{BarcodeXcn}*", _font, Brushes.Black, x, y, new StringFormat());

I think this may be why I am having a hard time managing the flow. I have windows handing it off to the printer so my windows events are returning instantly and I'm not following the expected flow so the printer is not doing as I expect also. This is just another assumption of course.

I guess I'll look into ZebraNet alerts as I've tried everything else without any luck.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Kenny, Using the

Hi Kenny, Using the PrintDocument class, especially with a custom barcode means you are using the driver to actually do the printing even though you are working with the Zebra SDK direct USB connection to do other communications.  We don't see it too common to mix these methods.  The driver is likely checking the status before and/or after printing, hence your extra status response. 

That being said, I'm not sure how to get around this issue.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Kenny Gregory
Today I decided to rather

Today I decided to rather than USB just use Bluetooth. If what you just said is the case then I may still get the status? I'm able to see the Bluetooth device in windows and connect after using the Zebra Setup Utility to configure it. However when I use the SDK just to connect via Bluetooth I get an error saying "Could not connect to device: No services found." .. from reading it seems this might relate to the 'use case' or class guid. Ugh .. I thought about using Wifi which is also an option, but I could not get that working either.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
Robin,Can you point me to any

Robin,

Can you point me to any documentation for using a custom barcode font. I really appreciate your help. Maybe discarding the windows library i can have better luck

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
Disregard .. I was able to

Disregard .. I was able to use these instructions and figure out how to download a custom font onto the printer: Zebra Technologies - Downloading and Using Fonts on Zebra ZPL Printers

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
Okay, So I've bypassed using

Okay,

So I've bypassed using the Windows PrintDocument class to draw graphics and instead loaded the custom font we are using and issued ZPL to print it. That's all working great, but now that I'm not getting the device.host_status (which as you stated may have been the driver and my method of approach in combination) ..

but now the problem is that the sensor.peeler is always clear

I updated the firmware to the most recent version. I loaded factory defaults, reset printer and calibrated. Suggestions? If you look in the first image I posted I never got a 'not clear' there either. Ever since I've changed the firmware it has not been working.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
(No subject)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kenny Gregory
Okay so submitted a support

Okay so submitted a support ticket regarding this last post. The problem here was that a team member had incremented the 'Adjustment' 'Tear Off' by +0.1. We are using small labels and this caused the label to be resting closer to the sensor (not sitting on it). In doing so the sensor was failing to read 'not clear'. So the solution in this case was to adjust the 'Tear Off' position and monitoring the sensor to know when it was working as expected. Here is an example of a label resting on the sensor .. This example was sent from Zebra support.

Again our label was not resting on, however it was apparently closer than the sensor allowed.

Again ours was set to 0.10

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments