Welcome, Guest. Please login or register.
Did you miss your activation email?
May 23, 2012, 07:45:16 PM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Industrial Robot Help and Discussion Center
| |-+  KUKA Robot Forum (Moderators: Werner Hampel, Martin H, SkyeFire)
| | |-+  $MSG_T Input problem
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: $MSG_T Input problem  (Read 868 times)
Takegawa
Newbie
*
Offline Offline

Posts: 5


« on: April 30, 2010, 10:54:49 AM »

Hi,

I searched a lot on this forum and saw some very intresting topics to get some messages on the KCP. Im working with a KRC1 and I already made a program were the operator gets a question if the product is ok or not. The operator must push a button, "JA" or "NEE" on the KCP.

But I want to make a program were the operator has to fill in a number with the KCP with the numeric buttons.
example number :  775898


Is it something like $MSG_T.input[] Huh?


Here is the program I already made

Code:
BAS (#INITMOV,0 )
;ENDFOLD
;FOLD A10 INI;%{E}%V2.3.0,%MKUKATPARC,%CINIT,%VINIT,%P
IF A10_OPTION==#ACTIVE THEN
INTERRUPT DECL 4 WHEN $CYCFLAG[2]==FALSE DO A10 (#APPL_ERROR )
INTERRUPT DECL 7 WHEN A_ARC_SWI==#ACTIVE DO A10 (#ARC_SEAM )
INTERRUPT DECL 5 WHEN A_FLY_ARC==TRUE DO A10 (#HPU_ARC )
INTERRUPT ON 5
A10_INI ( )
ENDIF
;ENDFOLD
;FOLD GRIPPER INI;%{E}%V2.3.0,%MKUKATPGRIPPER,%CINIT,%VINIT,%P
USER_GRP (0,DUMMY,DUMMY,GDEFAULT )
;ENDFOLD
;FOLD USER INI;%{P}%V2.3.0,%MKUKATPUSER,%CINIT,%VINIT,%P
;Make your modifications here
;test interrupt

;ENDFOLD (USER INI)
;ENDFOLD
ENDIF


$MSG_T.TYP=#DIALOG
$MSG_T.KEY[]="PRODUKT OK?                              "
$MSG_T.DLG_FORMAT[]="|JA|NEE|||||" ; keuze mogelijkheid via inputtoetsen. Als er iets niet gebruikt wordt toch streepje zetten anders toont hij de vorige waarde nog

;FOLD Send Message to Display
$MSG_T.VALID=TRUE ;Send
WHILE  $MSG_T.VALID
WAIT SEC 0.1
ENDWHILE
WAIT SEC 0.2
;ENDFOLD


SWITCH  ($MSG_T.ANSWER)
CASE 1
IF (NEE) THEN
GETAL=2.0
ENDIF

CASE 2
IF (JA) THEN
GETAL=1.0
ENDIF

ENDSWITCH








END


 

Many regards
Logged
SkyeFire
Global Moderator
*****
Offline Offline

Posts: 1784



« Reply #1 on: May 02, 2010, 03:48:13 PM »

Unfortunately, to the best of my knowledge, the only input possible through MSG_T is the 7(?) softkeys along the bottom of the screen.  It's an extremely annoying limitation.

The most thorough solution to this problem that I ever saw implemented in pure KRL used multiple messages in sequence to "build" the number the operator wanted.  On the first message, the buttons would look like this:
Code:
<< 900000 800000 700000 600000 500000 >> 

Pressing >> would take you to the second menu:
Code:
<< 400000 300000 200000 100000 >>

Pressing >> here would take you to:
Code:
<< 90000 80000 70000 60000 50000 >>

And so on, until the last menu would look like
Code:
<< 4 3 2 1 OK >>

The concept was, you built the final number from the left-most digit by choosing the correct button, then moving to the next menu.  So, for 775898, you would have selected, in order:
700000
  70000
    5000
      800
        90
          8

You could go back and change any number in the sequence at any time until you hit OK.  So, if you'd fat-fingered the first digit and ended up with 475898, you could simply keep hitting >> until you got back to the 6th-digit menu, and hit 700000.  Doing that would replace the 400000 part of the number with 700000, and you'd be in business -- just keep hitting >> until you got to the last menu, with OK in it, and hit it. 

Needless to say, though, the program supporting this was... large.  And complex.  But it did work.



Logged
Takegawa
Newbie
*
Offline Offline

Posts: 5


« Reply #2 on: May 02, 2010, 11:32:46 PM »

Many thanks Skyfire !!

To bad there isn't a easier way to handle it.....

But this is a way to solve te problem !!! 

Could you please email me a short example program ? Sry if Im asking to much 

Many regards
T
Logged
CrossConnect
Newbie
*
Offline Offline

Gender: Male
Posts: 21


WWW
« Reply #3 on: May 03, 2010, 01:54:41 PM »

your idea is simply great. In fact i was wondering how to do it for one of my programmes. finaly i used the opc and an external PC to give such accss
thanks

Unfortunately, to the best of my knowledge, the only input possible through MSG_T is the 7(?) softkeys along the bottom of the screen.  It's an extremely annoying limitation.

The most thorough solution to this problem that I ever saw implemented in pure KRL used multiple messages in sequence to "build" the number the operator wanted.  On the first message, the buttons would look like this:
Code:
<< 900000 800000 700000 600000 500000 >> 

Pressing >> would take you to the second menu:
Code:
<< 400000 300000 200000 100000 >>

Pressing >> here would take you to:
Code:
<< 90000 80000 70000 60000 50000 >>

And so on, until the last menu would look like
Code:
<< 4 3 2 1 OK >>

The concept was, you built the final number from the left-most digit by choosing the correct button, then moving to the next menu.  So, for 775898, you would have selected, in order:
700000
  70000
    5000
      800
        90
          8

You could go back and change any number in the sequence at any time until you hit OK.  So, if you'd fat-fingered the first digit and ended up with 475898, you could simply keep hitting >> until you got back to the 6th-digit menu, and hit 700000.  Doing that would replace the 400000 part of the number with 700000, and you'd be in business -- just keep hitting >> until you got to the last menu, with OK in it, and hit it. 

Needless to say, though, the program supporting this was... large.  And complex.  But it did work.




Logged

You get what you want, Think big to get big
mookie
Global Moderator
*****
Offline Offline

Gender: Male
Posts: 419



« Reply #4 on: May 05, 2010, 04:15:16 PM »

The first question i need answered is what version of software you have. this makes a difference because I have it two different ways but here it is in short form.

Code:
DEFFCT INT fa_iGetCorrectLength(_WeinerType[] : IN, _WeinerSize[] : IN, _WeinerLength[] : OUT)
;***********************************************************
;Creator: Ricky Bobby
;Creation date:   10/16/2009
;Last Modified:   10/16/2009
;Description:     Get Correct Weiner Length
;Revision Level   1.0.0.0
;***********************************************************
;FOLD --> Change Log
;2/1/2010 Added ChangeLog - Jean Girard
;ENDFOLD (Change Log)

;FOLD --> Variables
DECL INT _iSize
DECL INT _iResult
DECL BOOL _bClr
DECL CHAR _WeinerType[]
DECL CHAR _WeinerSize[]
DECL CHAR _WeinerLength[]
DECL KRLMSG_T _Msg
DECL KRLMSGDLGSK_T _Answers_SK[7]
;ENDFOLD (Variables)

_iSize = 45
Retry:


_Msg={MODUL[] "fa",NR 101,MSG_TXT[] "Please Choose Correct Length for Weiner "}
_iResult = StrAdd(_Msg.Msg_Txt[],_WeinerType[])
_iResult = StrAdd(_Msg.Msg_Txt[],_WeinerSize[])

ul_ClearString(_WeinerLength[])

IF (fa_bIsLengthEqual(_WeinerLength[],_iSize)) THEN
  _iResult = StrAdd(_Msg.Msg_Txt[],_WeinerLength[])
ELSE
  Goto Retry
ENDIF

;FOLD --> Setup answer keys.
;ENDFOLD (Setup answer keys.)
_Answers_SK[1] = {sk_Type #value, sk_txt[] "<--Back"}
_Answers_SK[2] = {sk_Type #value, sk_txt[] "+5"}
_Answers_SK[3] = {sk_Type #value, sk_txt[] "+10"}
_Answers_SK[5] = {sk_Type #value, sk_txt[] "-10"}
_Answers_SK[6] = {sk_Type #value, sk_txt[] "-5"}
_Answers_SK[7] = {sk_Type #value, sk_txt[] "Accept"}

;FOLD --> Prompt user for response
;ENDFOLD (Prompt user for response)
_iResult = um_iMessFunc(_Msg,_Answers_SK[])

Switch (_iResult)
  Case 1
    RETURN Messg_Result
  Case 2
    IF ((_iSize + 5) <= 90) THEN
      _iSize = _iSize + 5
    ENDIF
  Case 3
    IF ((_iSize + 10) <= 90) THEN
      _iSize = _iSize + 10
    ENDIF
  Case 5
    IF ((_iSize - 10) >= 45) THEN
      _iSize = _iSize - 10
    ENDIF
  Case 6
    IF ((_iSize - 5) >= 45) THEN
      _iSize = _iSize - 5
    ENDIF
  Case 7
    IF (fa_bIsLengthEqual(_WeinerLength[],_iSize)) THEN
      RETURN _iResult
    ELSE
      Goto Retry
    ENDIF
ENDSWITCH

Goto Retry

ENDFCT

you will also need to clear the string. it can be done 2 different ways
Code:
DEF ul_ClearString(Value[] :OUT)
;FOLD --> Variables
DECL CHAR VALUE[]
;ENDFOLD
Wait for StrClear(Value[])
END

or
Code:
DEFFCT BOOL ul_ClearString(Value[] :OUT)
;FOLD --> Variables
DECL CHAR Value[]
;ENDFOLD

Return StrClear(Value[])
ENDFCT

Logged
mookie
Global Moderator
*****
Offline Offline

Gender: Male
Posts: 419



« Reply #5 on: May 05, 2010, 04:15:38 PM »

this was written for 5.5.10
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!