S.G.D. command not returning a value

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

Manuel Caicedo-...
Hi Clevi,I will suggest for

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-pm-en.pdf

Setvar using JSON

Thanks,

MC

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Clive Lacey
Ok thanks Manuel,I would like

Ok thanks Manuel,

I would like to understand why that is?

Is it that using the S.G.D. commands as defined in the manual is known not to give a consistent response, or are there other reasons.

I will look at using JSON but I have other applications that do not suffer from this?

regards

Clive

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Caicedo-...
Hi Clive,You can send several

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

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Clive Lacey
Thanks it does

Thanks it does Manuel

regards

Clive

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments