I need to be able to export or convert a program to a csv format. It should look like the attached file with X, Y, Z and time stamp.
Anyone ever done this before?
I need to be able to export or convert a program to a csv format. It should look like the attached file with X, Y, Z and time stamp.
Anyone ever done this before?
i have done it in Karel, but i dont think you are going to get the precision you are hoping for if that pdf is any indication.
you can create a csv file as a FILE variable, and use the WRITE built in to fill each field and include a comma as a deliminator.
-----------------------------------------------------------------
ROUTINE output_csv
VAR
i,ii : INTEGER
BEGIN
FOR i = 1 to MAX_LOG_SIZE DO
-- Write each log to csv file.
FOR ii = 1 TO ARRAY_SIZE DO
WRITE log_file(fc_data[i].fs_force[ii]::18::3,',')
ENDFOR
WRITE log_file(CR)
ENDFOR
END output_csv
-----------------------------------------------------------------
ROUTINE copy_2_mc
VAR
status : INTEGER
sExt : STRING[3]
sLogFile : STRING[12]
BEGIN
sLogFile = LogFileName + '.csv';
OPEN FILE log_file ('RW', sLogFile)
status = IO_STATUS(log_file)
IF(status = 0) THEN
output_csv
CLOSE FILE log_file
ENDIF
END copy_2_mc
I try this in our test cell robot. We'll see. Thank you!! https://www.robot-forum.com/robotforum/Smi…um/beerchug.gif