S.G.D. command not returning a value

// Expert user has replied.
C Clive Lacey 3 years 7 months ago
249 2 0

Hi again,
Please could take a look at the attached screen grab. It's a USB trace of an application using SGD commands to interrogate a printer.
The application sends 6 concatenated SGD commands then "listens" for a response. I noticed that the first time I sent to the request I get all 6 responses as expected. The next time and thereafter the first response is missing? (link OS version request)
I have put a 7th SGD command in the front as a test and then that dissapears (after the first printer power cycle and send) and the missing one appears so I know its not a pure syntax error but associated with sending back a response to the first request in the concatenated command string.
 
The attached screen grabs shows a screen grab from my USB trace tool. You can see that the first time the concatenated SGD command is sent the printer returns 6 values the next time the same command is sent the printer only returns 5?
 
I have tried inserting a 0x0d0x0a after the "END\x20" but get the same result.
 
If I switch the printer off and on again and resend the command then the first SGD command is returned properly with the others again. However sending the same command again then causes the response to the first command to not be sent back from the printer again. This keeps happening till I power cycle the printer.
 
I am "guessing" its more to do with how i finish the command than start the next one?
 
Any help much appreciated
Regards
Clive

Please Register or Login to post a reply

2 Replies

M Manuel Caicedo-Rivera

Hi Clive,

You can send several SGD commands for setvar, and all of them will be taken by the printer. However, if you do the same for getvar, you will have traffic in their response, and some SGD commands take more time in getting a response than others. It is nothing with the SGD commands or the printer, it is more a traffic issue that you will have for the bi-directional communication. Now, JSON commands help you to organize the traffic, you ask all at once, you receive all at once.

You can use it at your convenience, define when it will be better use only SGD, or when JSON commands apply better to your use case.

I hope it clarifies your question.

MC

M Manuel Caicedo-Rivera

Hi Clevi,

I will suggest for concatenated queries to use json command. For more info, please, follow the link below. Pag. 570
https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2…

Setvar using JSON

Thanks,

MC

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