fahansen - 2015-02-12

Hello,

Using the Dynamic Path as example, i need to calculate the points XYZ and execute then when finish recalculate new points and execute.
The problem is recalculate and refreshing the buffer with the new values.

How can restart the pointer / SMC_QUEUE to initial values so can refill the table with the new points??

Im doing the follow steps after execute once, and the BUF not show the new values.
STEP 1:

WHILE queueCount > 0 DO
queueCount := SMC_GetCount(poq:=ADR(QUEUE));
SMC_DeleteObj(poq:=ADR(QUEUE), queueCount-1);
END_WHILE
...
n:=0;
QUEUE.bEndOfList := FALSE;

STEP 2:
WHILE NOT QUEUE.bFull DO // when the Queue is full, wait until it has been processed by the following FBs
n := n + 1;
GEO.iSourceLine_No := n;
GEO.piStartPos := GEO.piDestPos; // copy last destination
IF n = 1 THEN
GEO.piStartPos.dX := Eixo_X.fSetPosition; // copy current position
GEO.piStartPos.dY := Eixo_Y.fSetPosition; // copy current position
GEO.piStartPos.dZ := Eixo_Z.fSetPosition; // copy current position
END_IF

GEO.iMoveType := LIN; // generate linear movement
GEO.iObjNo := GEO.iObjNo + 1; // calculate number
GEO.piDestPos.dX := PVL.tabValores[n-1,1]; // generate position
GEO.piDestPos.dY := PVL.tabValores[n-1,2]; // generate position
GEO.piDestPos.dZ := PVL.tabValores[n-1,3]; // generate position

SMC_CalcLengthGeo(pg := ADR(GEO)); // calculate length of object with the help of the standard function
SMC_AppendObj(poq:=ADR(QUEUE), pgi:=ADR(GEO)); //append object to que

Thanks.