-2

I am trying to printing TID FROM ZPL COMMANDS

getting JJL179464

can anyone please tell me what is this character

Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
PRIYA
  • 1
  • 2

1 Answers1

0

To partially answer your question:

Are you reading an ASCII encoded data? Because your result: "JJL179464" does not look like a valid RFID tag data, unless it is in ASCII. Data encoded in RFID tags are encoded in binary. Depending on reader settings, the data can be outputed in binary, hexadecimal or ASCII format. Judging by the first three symbols "JJL", your reader is set to output ASCII data, or there is an error in your code.

Try to answer us the following questions:

  • What are you trying to achieve?
  • Provide us your code. (whole, structured)
  • What device are you using to read the RFID tag?
  • Provide us the settings of your reading device. (unless they are a part of the code)
  • Do you know the data content of the RFID tag you are trying to read? That means, can you validate that the reading was successful?

Edit:

Thank you for your code:

^XA

^FN1^RFR,H,0,12,2^FS^FH_^HV1,256^FS

^XZ

It seems that there could be several issues in your code.

Firstly, your ^HV command is incomplete. It is missing 3 parameters. The first one (third parameter) sets the data prefix. Next one data termination. And the last one specifies when to return data. You should include all of them in the ^HV command.

There is already a good example how the ^HV command needs to be set: ^RFR,^FN1,^HV1 not sending output to computer

The second issue, at least I think that it is an issue but I don't have the means to verify it, is that you are using ^FH_ command. There are no hexadecimal values for encoding special characters in your code, so there is no point in using it. So I would try to omit it.

Also, I am not sure about the order of commands. The ^FN1 command should be after ^RFR and before ^FS commands.

Try this code:

^XA

^RFR,H,0,12,2^FN1^FS^HV1,256,HEADER,TERMINATION,L^FS

^XZ

That should give you output in format:

HEADERhexadecimaldataTERMINATION

It is a little bit hard to read, but if it will work, then you might proceed to format it nicely. The words HEADER and TERMINATION serve as prefix and postfix of data from ^RFR command. So if this will work you can replace them with brackets or whatever suits your needs.

I am also concerned about 2 things:

  • The number of bytes to read - 12. Usually it is 8, but it varies depending on the type of RFID tag and the data format. I don't say that it is a mistake, just unsual to me.
  • The last parameter in ^HV1 command may be "F" instead of "L". The "F" is default value and it seems that in your case it was working with it. At least you got some output, so maybe it should be "F". But try it with "L" to get a response for each label. "F" means getting a response after the entire job is done.

I hope this will work. Currently we are in lockdown and I don't have the means to verify this on real devices. But theoreticaly it should help. Please let me know the results.

Viliamm
  • 618
  • 5
  • 12
  • Dim tid As Byte() = pUsbConnection.SendAndWaitForResponse(Encoding.UTF8.GetBytes(ZPLCMD), 1800, 1800, "null") MessageBox.Show(System.Text.Encoding.UTF8.GetString(tid)) – PRIYA Oct 25 '20 at 13:00
  • ^XA^FN1^RFR,H,0,12,2^FS^FH_^HV1,256^FS^XZ – PRIYA Oct 25 '20 at 13:01
  • 1st time it gives, "JJL179464"E2801170200012EDB25F0A06 – PRIYA Oct 25 '20 at 13:04
  • I want output only E2801170200012EDB25F0A06 – PRIYA Oct 25 '20 at 13:04
  • I have edited my previous answer. I hope it will help you. – Viliamm Oct 25 '20 at 14:20
  • Thanks for your response. Let me give you an overview of what we're trying to achieve here. We have a roll of tags that we want to read the TIDs of, and if we get a bad/void tag, we want to record the response as bad/void. For example, the input roll will be 3000 pcs, the user will input a quantity of 750 and the program will execute a ZPL command on a loop 750 times. This is what we've come up with as a concept. Do you have any advice for us, how better to do this? Please let us know, thank you – PRIYA Oct 26 '20 at 09:46
  • Well, this is quite a difficult task. I don't think that Zebra devices have built-in VOID detection. I don't even think that it is possible to have such detection. The encoded data may vary and even if the printer outputs VOID-ed tag, the data remain unchanged. You should be still able to rewrite the data on VOID-ed tag, unless the tag is in an unwriteable state by ^RLB command... When you are printing a tag then you get response from printer, either success or void. But I don't know if this is applicable to reading a tag. I am afraid that this is beyond my knowledge. I am sorry. – Viliamm Oct 26 '20 at 20:26