1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

"Busy popup window" via KRL

  • Nikolay Noskov
  • August 4, 2022 at 10:21 AM
  • Thread is Unresolved
  • Nikolay Noskov
    Trophies
    2
    Posts
    8
    • August 4, 2022 at 10:21 AM
    • #1

    Hi there!

    Are there any possibility to generate popup SmartHMI windows like a picture below from KRL? Maybe it's a kind of dialog window?

    KSS 8.5~8.6

    Thanks!

    Images

    • Screenshot 2022-08-04 111404.png
      • 41.39 kB
      • 602 × 394
      • 8
  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,027
    • August 4, 2022 at 3:14 PM
    • #2

    not exactly, but you could get similar thing using dialog. note that dialog must have at least one button or it will not show up, and if button is clicked, dialog will go away. so you need to display it again as long as "busy" is in progress and remove it when not busy.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Online
    SkyeFire
    Reactions Received
    1,038
    Trophies
    12
    Posts
    9,371
    • August 4, 2022 at 3:38 PM
    • #3

    In KRL, the SET_KRLDLG function is passed the message text, an array of text values for each button, some parameters, and passes back an integer "handle" attached to the dialog box that SET_KRLDLG pops up.

    Normally, the pop-up only clears when one of the buttons is pressed, but it's also possible to clear the pop-up from inside your program using CLR_KRLMSG (Handle Variable).

    In "raw" KRL, something like:

    Code
    nDialogMsgHandle=SET_KRLDLG(_Msg, _MsgPar[], _MsgSoftKey[], FI_MsgOpt)
    
    WAIT FOR Clear_KrlMsg(nDialogMsgHandle)

    I've never tried creating a Dialog pop-up with no buttons, but you could give it a shot. If it doesn't work for some reason, you could simply create one button and put your program into a loop that keeps popping the pop-up back up until the program is satisfied.

    The MsgDialog subroutine in the MsgLib library (located in the SYSTEM directory of your robot) is a good example of Dialog, although it doesn't support clearing the pop-up programmatically.

    I once made a modified version of MsgDialog that would allow my program to clear pop-ups based on either a SmartPad button being pressed, or on a value being sent from the PLC -- the PLC HMI "echoed" the SmartPad application messages, so the robot had to accept responses from either source.

    Code
    DEF Dialog (FO_nAnswer:OUT,FI_chText[]:IN,FI_chModule[]:IN,FI_chTextPar[]:IN,FI_chDialogSK1[]:IN,FI_chDialogSK2[]:IN,FI_chDialogSK3[]:IN,FI_chDialogSK4[]:IN,FI_chDialogSK5[]:IN,FI_chDialogSK6[]:IN,FI_chDialogSK7[]:IN,FI_bNoBrakes:IN, FI_nMsgNr:IN,FI_MsgOpt:IN)
      ;FOLD HEADER
      ; Modified from stock MsgLib Dialog-message subroutine
      ; Adds capacity for both local and remote dialog response buttons
      ; Use O_ and I_ outputs and inputs that must be configured in the .DAT file of this module
      ;ENDFOLD (HEADER)
      ;FOLD DECLARATIONS
      DECL KrlMsg_T _Msg
      DECL KrlMsgPar_T _MsgPar[3]
      DECL KrlMsgOpt_T FI_MsgOpt
      DECL KrlMsgOpt_T _DummyMsgOpt
      DECL KrlMsgDlgSK_T _MsgSoftKey[7]
      DECL INT _nCount, _nLength, _nHandle, FO_nAnswer, FI_nMsgNr
      DECL BOOL FI_bNoBrakes
      DECL BOOL _bRet
      DECL CHAR FI_chText[], FI_chModule[], FI_chTextPar[], FI_chDialogSK1[], FI_chDialogSK2[], FI_chDialogSK3[], FI_chDialogSK4[], FI_chDialogSK5[], FI_chDialogSK6[], FI_chDialogSK7[]
      DECL CHAR _chMsg[255], _chMsgToPLC[300], _chConvertedMsg[255], _chTextPar[45]
      DECL BOOL _bReplyFromPLC
      DECL STATE_T _State
      DECL INT _nOffset
      DECL BOOL _bReplyFromSmartPad
      DECL BOOL _bMessageReceivedByPLC
      ;ENDFOLD (DECLARATIONS)
      ;FOLD EXECUTABLE
      
      O_MessageCode       = 0 ; clear output
      _bReplyFromPLC      = FALSE
      _bReplyFromSmartPad = FALSE
      FO_nAnswer          = 0
      
      ; check that there are no lingering PLC inputs
      WAIT FOR (I_OperatorButton == 0)
      
      ; Handle undefined Options variable
      ON_ERROR_PROCEED 
      _DummyMsgOpt=FI_MsgOpt  
      IF ($ERR.Number<>0) THEN
        FI_MsgOpt.VL_Stop=TRUE ;DEFAULT setting TRUE
        FI_MsgOpt.Clear_P_Reset=TRUE
        FI_MsgOpt.Log_To_DB=FALSE
        ERR_CLEAR($ERR)
      ELSE
        ERR_RAISE($ERR)
      ENDIF
      
      ;Creates default values in case of none availability
      FI_MsgOpt=CheckOfMsgOpt(FI_MsgOpt)
      _Msg.Nr=1
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _Msg.Nr=FI_nMsgNr
      _nLength=STRLEN(FI_chText[])
      
      IF  _nLength>0 THEN
        IF _nLength>80 THEN
          _nLength=80
        ENDIF
        FOR _nCount=1 TO _nLength
          _Msg.Msg_txt[_nCount]=FI_chText[_nCount]
          _chConvertedMsg[_nCount] = FI_chText[_nCount]
          ; Convert %1 to %s for SWrite to include text parameter in msg to HMI
          IF (_nCount > 1) THEN
            IF ((_chConvertedMsg[_nCount-1] == "%") AND (_chConvertedMsg[_nCount] == "1")) THEN
              _chConvertedMsg[_nCount] = "s"
            ENDIF
          ENDIF      
        ENDFOR
        ; SWrite will fail if last character is %
        IF (_chConvertedMsg[_nCount-1] == "%") THEN
          _chConvertedMsg[_nCount-1] = " "
        ENDIF
      ELSE
        _Msg.Msg_txt[]="parameter FI_chText[] is missing"
      ENDIF
      
      _nLength=STRLEN(FI_chModule[])
      IF  _nLength>0 THEN
        IF _nLength>24 THEN
          _nLength=24
        ENDIF
        FOR _nCount=1 TO _nLength
          _Msg.Modul[_nCount]=FI_chModule[_nCount]
        ENDFOR
      ELSE
        _Msg.Modul[]="Appl" 
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK1[])
      IF  $ERR.Number==0 THEN
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[7].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[7].Sk_txt[_nCount] = FI_chDialogSK1[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[7].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK2[])
      IF  $ERR.Number==0 THEN
        _nLength=STRLEN(FI_chDialogSK2[])
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[6].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[6].Sk_txt[_nCount] = FI_chDialogSK2[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[6].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK3[])
      IF  $ERR.Number==0 THEN
        _nLength=STRLEN(FI_chDialogSK3[])
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[5].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[5].Sk_txt[_nCount] = FI_chDialogSK3[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[5].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK4[])
      IF  $ERR.Number==0 THEN
        _nLength=STRLEN(FI_chDialogSK4[])
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[4].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[4].Sk_txt[_nCount] = FI_chDialogSK4[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[4].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK5[])
      IF  $ERR.Number==0 THEN
        _nLength=STRLEN(FI_chDialogSK5[])
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[3].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[3].Sk_txt[_nCount] = FI_chDialogSK5[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[3].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK6[])
      IF  $ERR.Number==0 THEN
        _nLength=STRLEN(FI_chDialogSK6[])
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[2].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[2].Sk_txt[_nCount] = FI_chDialogSK6[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[2].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      _nLength=STRLEN(FI_chDialogSK7[])
      IF  $ERR.Number==0 THEN
        _nLength=STRLEN(FI_chDialogSK7[])
        IF _nLength > 0 THEN
          IF _nLength>24 THEN
            _nLength=24
          ENDIF
          _MsgSoftKey[1].Sk_Type = #KEY
          FOR _nCount=1 TO _nLength
            _MsgSoftKey[1].Sk_txt[_nCount] = FI_chDialogSK7[_nCount]
          ENDFOR
        ENDIF
      ELSE
        FOR _nCount=1 TO 24
          _MsgSoftKey[1].Sk_txt[_nCount] = " "
        ENDFOR
      ENDIF
      
      _nLength=STRLEN(FI_chTextPar[])
      IF  _nLength>0 THEN
        IF _nLength>26 THEN
          _nLength=26
        ENDIF
        FOR _nCount=1 TO _nLength
          _MsgPar[1].Par_Txt[_nCount]=FI_chTextPar[_nCount]
          _chTextPar[_nCount] = FI_chTextPar[_nCount]
        ENDFOR
        _MsgPar[1].Par_type=#Value
      ENDIF
      
      ; Write text variable into Message
      _nOffset = 0
      SWRITE(_chMsgToPLC[], _State, _nOffset, _chConvertedMsg[], _chTextPar[])
      
      ; Steering logic
      bDialogToPLC = (($EXT OR $AUT) AND (NOT bPlcSim))
      bDialogToSmartPad = TRUE ; NOT $EXT
      ; bDialogToSmartPad = ((($EXT OR $AUT) AND NOT I_ClearToLeaveStandstill) OR $T1 OR $T2) 
      
      ; Send dialog and buttons to PLC
      IF bDialogToPLC THEN
        WAIT FOR NOT (I_DialogReceived OR I_DialogResend)
        REPEAT
          ;UserDialogToPLC(_chMsgToPLC[], _Msg.Modul[],_MsgSoftKey[1].SK_TXT[],_MsgSoftKey[2].SK_TXT[],_MsgSoftKey[3].SK_TXT[],_MsgSoftKey[4].SK_TXT[],_MsgSoftKey[5].SK_TXT[],_MsgSoftKey[6].SK_TXT[],_MsgSoftKey[7].SK_TXT[],_Msg.Nr )
          O_MessageCode = nMessageCodeMemory ; transmit message code
          REPEAT
            PULSE(O_DialogSent, TRUE, 0.1)
          UNTIL(I_DialogReceived OR I_DialogResend)
          IF I_DialogResend THEN
            O_DialogSent = FALSE
            WAIT FOR NOT (I_DialogResend)
          ENDIF
        UNTIL I_DialogReceived
        O_DialogSent = FALSE
        WAIT FOR NOT (I_DialogReceived)
      ENDIF
      
      ;Send Dialog and Buttons to SmartPad
      IF bDialogToSmartPad THEN
        nDialogMsgHandle=SET_KRLDLG(_Msg, _MsgPar[], _MsgSoftKey[], FI_MsgOpt)
      ELSE
        MsgState(nDialogMsgHandle, "Operator Dialog Message on Cell HMI", "Dialog")
      ENDIF
      
      ERR_CLEAR($ERR)
      
      ON_ERROR_PROCEED
      FI_bNoBrakes=FI_bNoBrakes
      IF  NOT($ERR.Number==0) THEN
        FI_bNoBrakes=FALSE
      ENDIF
      
      ; Wait for either SmartPad button or button code input via FieldBus  
      REPEAT
        WAIT SEC 0.2
        _bReplyFromSmartPad = (bDialogToSmartPad AND NOT Exists_KrlDlg (nDialogMsgHandle, FO_nAnswer) AND (FO_nAnswer > 0))
        _bReplyFromPLC = (bDialogToPLC AND NOT (I_OperatorButton == 0))
        IF _bReplyFromPLC THEN
          SWITCH UserButton (I_OperatorButton)
          CASE #Invalid
            _bReplyFromPLC = FALSE
          DEFAULT
            ; leave _bReplyFromPLC alone
          ENDSWITCH
        ENDIF
      UNTIL (_bReplyFromPLC or _bReplyFromSmartPad)
      
      ; Reply recieved from PLC
      IF _bReplyFromPLC THEN
        ; If loop exited due to remote PLC input
        FO_nAnswer    = I_OperatorButton
        O_MessageCode = 0 ; clear Message output
        WAIT FOR (I_OperatorButton == 0) ; wait for PLC acknowledgement
        ;MsgNotify("Reply From PLC %1", "Dialog", FO_nAnswer)
        WAIT SEC 1.0 ; Debounce    
        ; Clear SmartPad message
        WAIT FOR Clear_KrlMsg(nDialogMsgHandle)
      ELSE
        ; Reply received from SmartPad
        IF _bReplyFromSmartPad THEN
          ; Loop was exited due to SmartPad button
          ; FO_nAnswer was set by Exists_KrlDlg()
          ; MsgNotify("Reply From SmartPad %1", "Dialog", FO_nAnswer)    
          O_MessageCode = 0 ; clear Message output
        ENDIF
      ENDIF
      
      IF FI_bNoBrakes THEN
        PTP $AXIS_ACT
      ENDIF  
      
      ;ENDFOLD (EXECUTABLE)
    END
    Display More
  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,027
    • August 4, 2022 at 3:43 PM
    • #4

    does it need to be a popup? status message would be perfect for this

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Nikolay Noskov
    Trophies
    2
    Posts
    8
    • August 5, 2022 at 8:43 AM
    • #5

    Panic mode, SkyeFire, thank a lot for quick answer. I've understood that have no easy way to generate the popup window.

    Quote from SkyeFire

    In KRL, the SET_KRLDLG function is passed the message text, an array of text values for each button, some parameters, and passes back an integer "handle" attached to the dialog box that SET_KRLDLG pops up.


    Normally, the pop-up only clears when one of the buttons is pressed, but it's also possible to clear the pop-up from inside your program using CLR_KRLMSG (Handle Variable).

    Yes, i know how the SET_KRLDG function works. And my first think was about it. Thank you for good example i will investigate that!

    Quote from panic mode

    does it need to be a popup? status message would be perfect for this

    Yes it need to be a popup. I want to block any activity from User-s during my function is executed.

    Edited once, last by Nikolay Noskov (August 5, 2022 at 5:59 PM).

  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,027
    • August 7, 2022 at 7:33 PM
    • #6
    Quote from Nikolay Noskov

    Yes it need to be a popup. I want to block any activity from User-s during my function is executed.

    attempting to block "any activity" is going to be difficult. you may have to define what the "any activity" really is. popup does not prevent user from using (or letting go) of enabling switch, turning mode switch or pressing anything that is not on screen. creating and removing custom popup is not really a big deal, it is just that it would need a bit more than just KRL if it need to look certain way (without button). the bigger question what is it that you are trying to prevent.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • Smarthmi
  • Busy popup
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download