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 Sun Sep 15, 2019 8:35 am

All times are UTC+01:00

Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Nov 11, 2014 10:03 pm 
User avatar

Joined: Tue Sep 02, 2014 10:56 am
Posts: 4

I have an application which requires functionality similar to the CNC Dynamic Path example provided with the SM tutorials. I have modfied the example to work with a gantry cutter and can now cut a shape using straight lines. However I now need to cut a smooth shape between all the points. I was thinking about using the SMC_Smoothpath FB to achieve this, however this only works on points between G code G51 - G50, but I am not using G code but data written into the interpolator. Is there any way around this, or can somebody suggest a better method,

My current code is below:

CASE iState OF
//initialize Queue
QUEUE_RAW.pbyBuffer := ADR(BUF[0]);
iState := iState + 1;

1: //fill queue

WHILE NOT QUEUE_RAW.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
GEO.iMoveType := LIN; // generate linear movement
GEO.iObjNo := GEO.iObjNo + 1; // calculate number
GEO.piDestPos.dX := xp[n]; // generate position
GEO.piDestPos.dY := yp[n];
SMC_CalcLengthGeo(pg := ADR(GEO)); // calculate length of object with the help of the standard function
SMC_AppendObj(poq:=ADR(QUEUE_RAW), pgi:=ADR(GEO)); //append object to queue
IF n = SIZEOF(xp)/SIZEOF(xp[1]) THEN // all target positions processed
n := 0;
iState := 2;

2: //generate 3d path for visulaisation

pcf(bExecute:=TRUE ,
udiNumberOfPointsInArray:=SIZEOF(pointbuffer)/SIZEOF(pointbuffer[0]) ,
pBuffer:=ADR(pointbuffer) ,
poqCNCpath:= ADR(QUEUE_RAW),
dPrecision:= 10);

I assume my path preprocessing would occur between steps 1-2.

Any help would be greatly appreciated.

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 8 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