Trying to read NFC using ZC350, but getting 'Unknown printer language' exception

// Expert user has replied.
K Kristian Thim 2 years 7 months ago
14 2 0

Hello, I am REALLY trying to do a basic "Read tag/id and print card" proces to store the id of the NFC card, so that the ID card can be used for the door-lock system.

I've concluded that NFC communication and ID card printing uses two different namespaces, or I don't see the necessary methods for doing it otherwise.
However, when I am trying to call my <strong>Zebra ZC350</strong>, that has built-in NFC reader, I get the message: <strong>Zebra.Sdk.Printer.ZebraPrinterLanguageUnknownException: 'Unknown printer language'</strong> when I try to get an instance of the ZebraPrinter object
<code>ZebraPrinter zebraPrinter = ZebraPrinterFactory.GetInstance(sczebraConnection);</code>

I'm guessing I am doing something I am not supposed to do, but there are not really many guidelines, or any, for using the NFC functionality on the ZC350. What works, is that I can move the card to "SmartCardEncode". I assume that is where it can read or program the card.

I've also tried using my existing connection for the ZebraCardPrinter class but then I get a mismatch in the classes.
<strong>cannot convert from 'Zebra.Sdk.Card.Printer.ZebraCardPrinter' to 'Zebra.Sdk.Printer.ZebraPrinter'</strong>
<h2>Connection</h2>
The connection in a TCP connection with the following details
<code>
Address: "192.168.1.68"
Connected: true
ConnectionBuilderPrefix: "TCP"
Manufacturer: ""
MaxDataToWrite: 1024
MaxTimeoutForRead: 5000
MultipartTimeToWaitAfterSend: 250
PortNumber: "9100"
SimpleConnectionName: "192.168.1.68"
TimeToWaitForMoreData: 500
commLink: {Zebra.Sdk.Comm.Internal.ZebraNetworkSocket}
inputStream: {System.IO.BinaryReader}
isDeviceConnected: true
maxTimeoutForRead: 5000
multipartTimeToWaitAfterSend: 250
myWriteLogStream: null
outputStream: {System.IO.BinaryWriter}
timeToWaitForMoreData: 500
zebraConnector: {Zebra.Sdk.Comm.TcpZebraConnectorImpl}
timeToWaitForMoreData: 500
</code>
... Should I use USB instead?

<h2> Full print method</h2>
<strong>In this method I am simply removing the card instead of printing on it, for the ease of testing.</strong>
<code>
public void Print(int copies)
{
try
{
OpenConnection();
GetPrinter();
SetJobSetting("smart_card.contactless", "hf");
var jobid = zebraCardPrinter.SmartCardEncode(1);

JobStatusInfo status = zebraCardPrinter.GetJobStatus(jobid);
var sczebraConnection = new TcpConnection(this.Connection.IPAddress, this.Connection.Port);
sczebraConnection.Open();
ZebraPrinter zebraPrinter = ZebraPrinterFactory.GetInstance(sczebraConnection);
SmartcardReader reader = SmartcardReaderFactory.Create(zebraPrinter);
var ATR = reader.GetATR();
GraphicsInfo graphicsInfo = new GraphicsInfo();
zebraCardPrinter.Resume();
// var printJobNumber = zebraCardPrinter.Print(copies, graphicsInfos);
}
catch
{
throw;
}
finally
{
CloseQuietly(localConnection, zebraCardPrinter);
}
}
</code>

Please register or login to post a reply

2 Replies

S Stephen Troup

I think the SmartcardReaderFactory is for label printers. and I don't think the Elatec reader is accessible in the method you're attempting via ethernet. The reader has a PCSC firmware installed, atleast the ones I have access to, and you'll need to use a usb over ethernet connection that will then allow a PCSC connection to then be used to connect to the card. I use SX virtual link as a way to control this from a desktop app but there it's also possible from code in Windows.

I'd suggest working with a usb connection at first to get the smartcard code working and then wrapping it in code to connect and disconnect via ethernet. The sdk for encoding over ethernet is called the EOE sdk which has the manual on how to it to establish a connection to the reader.

A Alfred Teixeira

The code you show is for a link-os printer; despite the printer's branding on the Support and Downloads webpage, the ZC-series card printer is not a Link-OS printer. I would recommend you download the Multi-platform SDK for this printer and review the appropriate Developer Demo for how to build/send jobs to the printer for purposes of positioning the card for smart card encoding. However, please be aware that the developer demos do not demonstrate how to communicate with the smart card reader; this is accomplished through the PC/SC API.

As was posted earlier, you will need the EoE SDK as well if you wish to encode your NFC card over Ethernet. However, my recommendation is to use USB connectivity first and then move to encoding the card over an Ethernet connection.

CONTACT
Can’t find what you’re looking for?