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 Mon Sep 16, 2019 3:39 pm

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 
Offline

Joined: Wed Sep 24, 2014 2:51 pm
Posts: 7
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.


Top
   
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 1 guest


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