Hello all!
I have a problem that I have been struggling with for a while now.
How do I get an ENUM as a parameter to a notify message?!?
I am working in OfficeLite KSS 8.5
I want to for example write a message: "Gripper is holding #ProductA"
I have tried with SWRITE to get the ENUM as a string but it only returns a INT.
Is there some way to solve this? I´ve been searching the forum and manuals without any luck
I hope the code below is clear enough to understand what i am trying to do
Basically i just want to write a ENUM in a message.
If someone has a solution or can point me in the right direction I would be sooooo grateful
BR. Marcus
GLOBAL ENUM ProductInGrp_E Empty, ProductA, ProductB
GLOBAL DEF CheckProdInGripper(iGrpNr:IN, eAssumedProductInGrp:IN)
;***********************
; Function to compare assumed product in gripper with actual product in gripper
; Stops and send alarm if robot enters a program with wrong product
;***********************
DECL INT iGrpNr,iOffset
DECL ProductInGrp_E eAssumedProductInGrp
DECL CHAR sNameProdInGrp[256]
DECL STATE_T _state
DECL SIGINF sig
iOffset=0
SWITCH iGrpNr
CASE 1
IF RobAct.LoadManager.eActProductInGrp1 <> eAssumedProductInGrp THEN
SWRITE(sNameProdInGrp[],_state,iOffset,"%r",eAssumedProductInGrp)
MsgNotify(sNameProdInGrp[])
ENDIF