Hello
How to create a new message on Krc2?
Hello
How to create a new message on Krc2?
...details?
It's not a project, it wants to know how to create messages for an operator.For example, we have a sensor connected digitally , the sensor checks the air pressure in the system .Open Normal pressure , closed low pressure message for the operator and stopping the robot .
There should be an example program named MSG_DEMO.SRC on the robot.
otherwise here is the code:
&ACCESS R
&COMMENT Example on user messages
DEF MSG_DEMO ( )
DECL INT ANSWER
DECL INT OFFSET
DECL STATE_T STATE
DECL MSG_T EMPTY_MSG
EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
;---------------------Message to quit ----------
$MSG_T=EMPTY_MSG
$MSG_T.MODUL[]=" "
$MSG_T.KEY[]="DEMO: QUIT-MESSAGE + %1"
$MSG_T.PARAM[]="PARAM"
$MSG_T.PARAM_TYP=#VALUE
$MSG_T.TYP=#QUIT
$MSG_T.VALID=TRUE
WHILE $MSG_T.VALID
WAIT SEC 0.05
ENDWHILE
WAIT SEC 0.2
;------------------DIALOG----------------
$MSG_T=EMPTY_MSG
$MSG_T.MODUL[]=" "
$MSG_T.KEY[]="DEMO: DIALOG + %1"
$MSG_T.PARAM[]="PARAM"
$MSG_T.RELEASE=FALSE
$MSG_T.PARAM_TYP=#KEY
$MSG_T.TYP=#DIALOG
$MSG_T.DLG_FORMAT[]="A|B|C"
$MSG_T.VALID=TRUE
WHILE $MSG_T.VALID
WAIT SEC 0.05
ENDWHILE
WAIT SEC 0.2
ANSWER=$MSG_T.ANSWER
;------------------ Message ------------------
$MSG_T=EMPTY_MSG
$MSG_T.MODUL[]=" "
$MSG_T.KEY[]="DEMO: DIALOG ANSWER = %1"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",ANSWER)
$MSG_T.PARAM_TYP=#VALUE
$MSG_T.VALID=TRUE
WHILE $MSG_T.VALID
WAIT SEC 0.05
ENDWHILE
WAIT SEC 0.2
;------------------- SIMULATION-----------------------
$LOOP_CONT=TRUE
WHILE $LOOP_CONT
$LOOP_MSG[]="S|Simulation of exiting a loop!"
; S| Simulate Button !!!!!
ENDWHILE
$LOOP_MSG[]=" "
END
Display More
That is better but still no details. KSS version is important... Message programming is different on different KSS .
Version=V4.1.6 SP3 and Version=V5.2.12 HF5
Please explain the basics of creating a message. Unless there is a pdf. Explaining message creation.
panic mode
Do you need to create a new program and write there?
no idea what you are trying to do and what your preference is.
topically one would want to create one canned solution that can be used over and over.
on KRC4 kuka created own version of such solution (MsgLib). Before that everyone was tailoring their own version (which still may be needed in specific cases).
I would think of something called MSG.SRC and then use it in any program such as
MSG("Hello world", #Notify)
MSG("Something bad happened",#Quit)
This does require a bit knowledge (message programming, structures, passing parameters, etc).