Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.

Conveyor tracking, Queue Tracking Mode

Hi guys,

we would like to use the DSQC 377A in Queue Tracking-Mode.

Reading the Robot ware conveyor tracking manual "3HAC16587-3 Revision D" (german version), I understand that you need to set the parameter

c1PosInJob = 1. In this case, we need to handle the WObj queue our selves. See manual page 87 (paragraph 9.1.2). (Notice c1PosInJob = 0 is the standard case, where the WObj queue is handled on the board - this is not used here.)

Example code from the manual for handling the WObj queue is given on page 90 and reads the following:

------------------------------
[code start]

SetDO c1PosInJobQ, 1;

CONNECT NewObj WITH NewObjOnConvey;
ISignalDI c1NewObjStrobe, high, NewObj;

TRAP NewObjOnConvey
  ObjectPosition1 := GInput(c1Count1FromEnc);
  ObjectPosition2 := GInput(c2Count2FromEnc);
  RETURN;
ENDTRAP

TRAP TrackNewObj
  SetGO c1Count1ToEnc, ObjectPosition1;
  SetGO c1Count2ToEnc, ObjectPosition2;
  WaitTime 0.05;
  PulseDO c1CountToEncStr;
  RETURN;
ENDTRAP

[code end]
------------------------------

This code does work if we pulse a DO, that is interrupt trapped by "TRAP TrackNewObj" and then use the instruction WaitWObj to actually connect to the WObj.

However, here is my question:
I do not fully understand, how we handle the case, if there is no work object yet.
Is it the right way to write a subroutine like (symbolic code)

------------------------------
[code start]

PROC GetWObj
  
  if ( notEmpty(WObjQueue) ) then

    # WObj available: connect
     
    SetGO c1Count1ToEnc, WObjQueue.ObjectPosition1;
    SetGO c1Count2ToEnc, WObjQueue.ObjectPosition2;
    WaitTime 0.05;
    PulseDO c1CountToEncStr;
 
    WaitWObj WObj
 
  else
 
    # handle the case NO WObj available
 
  end

ENDPROC

[code end]
------------------------------

Summed up question:
Which is the professional way of implementing the queue tracking mode? Are there any fully runnable code examples available?

Any help is greatly appreciated.
Thanx,

Jan.