CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Feb 20, 2020 2:17 am

All times are UTC+01:00

Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Dynamic path
PostPosted: Thu Feb 12, 2015 4:50 pm 

Joined: Wed Sep 24, 2014 2:51 pm
Posts: 7

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.

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

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

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


Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited