Hi,
We have a line of 10 pickers where we want to do some speed regulation using the QL functionnality.
We have try this by adding an extra encoder board (this encoder board is only used for the QL) and it works fine for one model.
My problem now is to do this with 2 models and 1 encoder board. The easy way is to add an extra encoder board but I want to know first if it is possible to do this with one encoder board. I have try some code but it gives uplink error.
This is the code that I am using for one model (It works OK):
TRAP iQueuelevelDI
nQueueLevel:=GetQueueLevel(ItmSrcData{4}.itemsource);
IF nQueueLevel <255 THEN
setGO GOQueueLevel,nQueueLevel;
ELSE
setGO GOQueueLevel,255;
ENDIF
If bDebug nTotal:=nTotal+nQueueLevel;
If nQueueLevel>0 PulseDO doReadOK;
QStopItmSrc ItmSrcData{4}.itemsource;
Flush*tmSrc ItmSrcData{4}.itemsource;
QStartItmSrc ItmSrcData{4}.itemsource;
If bDebug THEN
nCounter:=nCounter+1;
TPWrite "Trap : "Num:=nCounter;
TPWrite "Total : "Num:=nTotal;
ENDIF
ENDTRAP
This is the code that I have tried without succes :
TRAP iQueuelevelDI
nQueueLevel1:=0;
bNoItem:=FALSE;
WHILE bNoItem=FALSE DO
GetItmTgt ItmSrcData{4}.ItemSource,PickQLAUTOMaxTime:=0.05TimeFlag:= bNoItem;
IF bNoItem=FALSE THEN
Incr nQueueLevel1;
AckItmTgt ItmSrcData{4}.ItemSource,PickQLAUTO,TRUE;
ENDIF
ENDWHILE
IF nQueueLevel1 <255 THEN
setGO GOQueueLevel1,nQueueLevel1;
ELSE
setGO GOQueueLevel1,255;
ENDIF
If bDebug nTotal:=nTotal+nQueueLevel1;
If nQueueLevel1>0 PulseDO doReadOK;
!QStopItmSrc ItmSrcData{4}.itemsource;
!Flush*tmSrc ItmSrcData{4}.itemsource;
!QStartItmSrc ItmSrcData{4}.itemsource;
If bDebug THEN
nCounter:=nCounter+1;
TPWrite "Trap : "Num:=nCounter;
TPWrite "Total : "Num:=nTotal;
ENDIF
ENDTRAP
I think that the while loop give me some Uplink troubles.
How is the GetQueueLevel build up ? Is it also a loop ?
I need a GetQueueLevel for the 2 items, are there any possibility to link the GetQueueLevel to the item type ?
BR,
Fabrice