rkone / sharpzebra

A .net library that simplifies printing to Zebra printers in their native EPL2/ZPL languages without needing to know EPL2 or ZPL.
MIT License
89 stars 34 forks source link

Sharpzebra.dll and Windows 10 #3

Closed nilsarve closed 6 years ago

nilsarve commented 7 years ago

Hello

Are trying your dll with Zebra KR403 printer. Works fine with windows 7 but cant get status to work with windows 10. Printing works though.

I am using labview and it is the UsbPrinterConnector that gives an error i belive.

Error message: Error: 1172 Error creating instance of UsbPrinterConnector in assembly Com.SharpZebra.Printing.UsbPrinterConnector, Com.SharpZebra, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null, (System.Exception: Cannot locate USB device )

rkone commented 6 years ago

Do you have the same issue if you set your solution to target x86?

nilsarve commented 6 years ago

Thank you for answering!

I was using your precompiled dll from codeplex.

Do I need Visual studio 2017 to build this solution?

rkone commented 6 years ago

It should be sufficient to compile your solution (that uses the precompiled sharpzebra.dll) with the target solution platform set to x86.

nilsarve commented 6 years ago

I use your dll with Labview and there is no option to compile my Labview application to x86 but I guess it is x86 by default. Tried running my application with XP compatibility but no change.

rkone commented 6 years ago

Sorry, I'm not too familiar with LabVIEW. I thought you were using this library an application you created.

I see LabVIEW comes in x86 and x64 versions. Can you make sure you're using the x86 version of LabVIEW?

Is the printer connected with both USB and network? It's weird you can print but status crashes.. Unless you're printing with it setup as a NetworkPrinter but getting status from it as a USBPrinter (which would make some sense, as you can't get the status through NetworkPrinter)

nilsarve commented 6 years ago

It's the x86 version of labview. The printer is only connected with USB.

Yeah it's weird printing is ok but not status.

rkone commented 6 years ago

I think you'll have to provide the code you use to print as well as the code used to get the printer status.

Are you able to check that you're using the same driver on Windows 10 as you were using on win7?

nilsarve commented 6 years ago

Still struggling to get this working. Same driver on win7 and win10. To print in labview: (working on both win7 and win10) image

nilsarve commented 6 years ago

Requesting printer status: (working on win7 but not windows 10) image

rkone commented 6 years ago

It looks as though this is related with issue #6 - it seems USB Printing in windows 10 has changed. I will look into this when I get a chance. The main problem is I don't actually have USB printers available to test with at the moment.

nilsarve commented 6 years ago

I can help you test your new code if you got an idea how to fix it.

rkone commented 6 years ago

The GitHub code has a fix for this issue. I'm working on updating the NuGet packages now.

nilsarve commented 6 years ago

It would be great if you could publish this new version as a dll?

rkone commented 6 years ago

As I mentioned, the dll version is on nuget: https://www.nuget.org/packages/SharpZebra.rkone/

nilsarve commented 6 years ago

Hello. Did extract the .dll from your nuget but did not get the dll to work. I get image. The old com.sharzebra.dll i have works (but not on win10). Is it not a .NET dll anymore?

rkone commented 6 years ago

It's certainly .NET. Maybe labview is only compatible with older versions of .NET? The latest sharpzebra is using 4.5.2

nilsarve commented 6 years ago

You are probably right about labview not being compatible with .NET 4.5.2. Sorry for the hassle but do you have the time to build the newest version with .NET 2.0 framework?

rkone commented 6 years ago

SharpZebraTest.zip Try this.

nilsarve commented 6 years ago

That worked! Thank you! Very nice of you to help me with this! I owe you one!

KunalSati commented 5 years ago

hello, I am new to Labview, I saw your threads above and the snip image of the VI. can you please help how to the "ZPLCommands" node/icon (i.e. the VI block) and how to use your SharpZebra .dll with it.

I am trying to print sticker labels from Zebra ZT410 printer.

Thanks in advance

rkone commented 5 years ago

I really don't know anything about LabVIEW. Maybe @nilsarve can help you?

nilsarve commented 5 years ago

Hello @KunalSati On the labview block diagram you go to communication and .NET. Select the .NET Constructor and browse to the SharpZebraTest.dll you can download from this thread. Under Com.SharpZebra.Commands you find ZPLCommands.

Then follow the above .vi pictures to print and get status.

sandhya-assaabloy commented 2 years ago

Hello Nilsarve, i did tried above code in labview, but not able to communicate. Need you help

Juancho-Coding commented 1 month ago

I'm using the library with labview but I use the SpoolPrinter class, it works on Labview2018 and windows 10