Hello,
I try to learn using the CWRITE/CREAD commands for KUKA robots. I have a KUKASim 4.3 and I wonder if the information which i get in output window is strictly connected with the fact that I'm working on a simulator (controller is KR C4):
KR 16 R1610 (integrated): Cwrite($FCT_CALL, STAT, MODE, "krl_fopen", "test.TXT", "w", HANDLE) is not supported.
Below you can see my program (I took it from the manual about those instructions). So i think that the program tries to serach for a "test.txt" file in C:\KRC\ROBOTER\UserFiles
and this must be a directory path from robot controller, so this can not work on simulator and i guess i need a real robot controller to test it. Am I Right?
Code
DEF MAIN ( )
DECL INT HANDLE
DECL STATE_T STAT
DECL MODUS_T MODE
CHAR MYCHAR
;FOLD INI;%{PE}
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)
MODE = #SYNC
HANDLE = 0
MYCHAR = "a"
CWRITE($FCT_CALL, STAT, MODE, "krl_fopen", "test.TXT", "w", HANDLE)
IF (STAT.RET1 == #CMD_ABORT) THEN
IF (STAT.MSG_NO == -5) THEN
; error treatment if to many files are already open
ELSE
ENDIF
ELSE
; no error occured
; write a character to the file
CWRITE($FCT_CALL, STAT, MODE, "krl_fputc", HANDLE, MYCHAR)
IF (STAT.RET1 == #CMD_ABORT) THEN
; error treatment
ENDIF
; close the file
CWRITE($FCT_CALL, STAT, MODE, "krl_fclose", HANDLE)
IF (STAT.RET1 == #CMD_ABORT) THEN
; error treatment
ENDIF
ENDIF
END
Display More