Kuka Found mismatched set of tokens.
Good afternoon, I want to rewrite the program from krc2 to krc4. There are a lot of errors, but this is the first time I've seen this one. How does it work? Who knows?
Kuka Found mismatched set of tokens.
Good afternoon, I want to rewrite the program from krc2 to krc4. There are a lot of errors, but this is the first time I've seen this one. How does it work? Who knows?
KRC2? What KSS version?
KRC4? What KSS version?
The IMPORT commands are, as far as I know, no longer used under KSS 8.x. They weren't used under KSS 5.x either, but were tolerated as a holdover from old KRC1 programs from KSS 2.x, to the best of my knowledge.
The purpose IMPORT once served is now handled by using GLOBAL Declarations.
Good afternoon. krc2 v5.5 and krc4 kss 8.6 kuka officelite
On KSS 5.5 IMPORT exists. On KSS 8.x IMPORT is removed.
The purpose IMPORT once served is now handled by using GLOBAL Declarations.
Foto
Foto
Can you tell me how to create a program correctly without using the import function?
Can you tell me how to create a program correctly without using the import function?
You will need to make a list of every item the old program is IMPORTing. In the screenshots you provided, it appears to only be variables, but IMPORTing subroutines and functions was also done.
For variables, the simplest way to make them Global is to DECL them in the module $CONFIG.DAT. Any variable DECL'd in CONFIG.DAT is inherently Global, dating back to the earliest versions of KSS.
However, tampering with $CONFIG.DAT, while legal, is not the best way to do things. An alternate method would be to create a new .DAT file, DEF'd with the PUBLIC keyword, then DECL GLOBAL each variable. This is part of the KUKA ConveyorGlobals .DAT file as an example:
DEFDAT conveyorglobals PUBLIC
;FOLD CONVEYOR GLOBALS
;CONV Booleans
DECL GLOBAL BOOL B_CALL_CONV_MOV=TRUE
DECL GLOBAL BOOL B_QUIT_BECAUSE_MAX_DIST=TRUE
DECL GLOBAL BOOL B_QUIT_BECAUSE_EMS=FALSE
DECL GLOBAL BOOL B_CONTINUE_AFTER_EMS=FALSE
; many more variables here
ENDDAT
Display More
Every variable in a PUBLIC .DAT file that is DECL GLOBAL becomes Global across the entire KRC, available to any routine in any module.
HOWEVER: this creates the potential to have "local" variables and Global variables that have the same name. This usually creates a Warning in WorkVisual, but does not generate a compilation error. So it is your responsibility to ensure no name collisions occur.
You will need to make a list of every item the old program is IMPORTing. In the screenshots you provided, it appears to only be variables, but IMPORTing subroutines and functions was also done.
For variables, the simplest way to make them Global is to DECL them in the module $CONFIG.DAT. Any variable DECL'd in CONFIG.DAT is inherently Global, dating back to the earliest versions of KSS.
However, tampering with $CONFIG.DAT, while legal, is not the best way to do things. An alternate method would be to create a new .DAT file, DEF'd with the PUBLIC keyword, then DECL GLOBAL each variable. This is part of the KUKA ConveyorGlobals .DAT file as an example:
Code Display MoreDEFDAT conveyorglobals PUBLIC ;FOLD CONVEYOR GLOBALS ;CONV Booleans DECL GLOBAL BOOL B_CALL_CONV_MOV=TRUE DECL GLOBAL BOOL B_QUIT_BECAUSE_MAX_DIST=TRUE DECL GLOBAL BOOL B_QUIT_BECAUSE_EMS=FALSE DECL GLOBAL BOOL B_CONTINUE_AFTER_EMS=FALSE ; many more variables here ENDDAT
Every variable in a PUBLIC .DAT file that is DECL GLOBAL becomes Global across the entire KRC, available to any routine in any module.
HOWEVER: this creates the potential to have "local" variables and Global variables that have the same name. This usually creates a Warning in WorkVisual, but does not generate a compilation error. So it is your responsibility to ensure no name collisions occur.
Thank you so much for your reply! Tomorrow I'll try to do as you said.
You will need to make a list of every item the old program is IMPORTing. In the screenshots you provided, it appears to only be variables, but IMPORTing subroutines and functions was also done.
For variables, the simplest way to make them Global is to DECL them in the module $CONFIG.DAT. Any variable DECL'd in CONFIG.DAT is inherently Global, dating back to the earliest versions of KSS.
However, tampering with $CONFIG.DAT, while legal, is not the best way to do things. An alternate method would be to create a new .DAT file, DEF'd with the PUBLIC keyword, then DECL GLOBAL each variable. This is part of the KUKA ConveyorGlobals .DAT file as an example:
Code Display MoreDEFDAT conveyorglobals PUBLIC ;FOLD CONVEYOR GLOBALS ;CONV Booleans DECL GLOBAL BOOL B_CALL_CONV_MOV=TRUE DECL GLOBAL BOOL B_QUIT_BECAUSE_MAX_DIST=TRUE DECL GLOBAL BOOL B_QUIT_BECAUSE_EMS=FALSE DECL GLOBAL BOOL B_CONTINUE_AFTER_EMS=FALSE ; many more variables here ENDDAT
Every variable in a PUBLIC .DAT file that is DECL GLOBAL becomes Global across the entire KRC, available to any routine in any module.
HOWEVER: this creates the potential to have "local" variables and Global variables that have the same name. This usually creates a Warning in WorkVisual, but does not generate a compilation error. So it is your responsibility to ensure no name collisions occur.
The main program uses a subroutine in which these problem points are used. It is quite clear to me how to register them in the main program.
Foto
Foto
Foto