The first array is the XYZ coordinate and the second array is the quaternion. I am calculating both array in Matlab.
The problem is I will have huge number of points. It is time consuming to copy and paste them one by one to the Rapid program.
Is there a better way to input these points to the MoveL? For example, I can store the data in an excel file or txt file. How can Rapid read the excel or txt file? Otherwise, can I use a matrix to store all the points and read them one by one in the Rapid?
You can use a iodev to read from a for example a text file.
Here is just an ex. where I read a values seperated with ; The text file is stored in the home folder on the robot controller PROC ReadTest() VAR iodev testsFile; VAR string strRead; VAR num nArrayPosition; VAR bool bEmptyFile; ! nArrayPosition:=1; bEmptyFile:=FALSE; ! Open file Open “tests.txt”,testsFile\Read; WHILE bEmptyFile=FALSE DO ! Write into array strRead:=ReadStr(testsFile\Delim:=“;”\RemoveCR); IF strRead<>EOF THEN arrDefinedTests{nArrayPosition}.TestNo:=strRead; strRead:=ReadStr(testsFile\Delim:=“;”\RemoveCR); arrDefinedTests{nArrayPosition}.Chapter:=strRead; strRead:=ReadStr(testsFile\Delim:=“;”\RemoveCR); arrDefinedTests{nArrayPosition}.Description:=strRead; Incr nArrayPosition; ELSE bEmptyFile:=TRUE; ENDIF ENDWHILE ! Close file Close testsFile; ERROR Close testsFile; RAISE ; ENDPROC