• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    HMI Problem

    Scheduled Pinned Locked Moved Mervis
    16 Posts 3 Posters 9.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zorro_66Z
      zorro_66
      last edited by zorro_66

      I want to control the time of my timer block with HMI
      0_1495462360746_BD13_Switch off.jpg
      How do I want to use SET
      0_1495462428786_String init.jpg

      If I enter the value 20 in the SET box, it will be 21 hours and 21 minutes.
      I only want to use minutes0_1495463376576_Hmi.jpg 0_1495463390101_Block.jpg

      Thankful for help or a kick in the right direction

      T 1 Reply Last reply
      Reply Quote 0
      • T
        tomas_hora administrators @zorro_66
        last edited by

        Hello @zorro_66,

        unfortunately, the variable type TIME cannot be set easily from HMI.

        You can, however, use a digital setter and integer variable which will represent seconds (or minutes, whatever you wish) and convert to time using a function block like this:

        FUNCTION_BLOCK IntlToSec
        	VAR_INPUT
        		seconds_int: int;
        	END_VAR
        	VAR_OUTPUT
        		out_time : TIME;
        	END_VAR
        
        out_time := mul_time(time#1s, seconds_int);
        END_FUNCTION_BLOCK
        
        1 Reply Last reply
        Reply Quote 0
        • R
          robert_n
          last edited by

          Hi everybody,
          I have a similar problem. I'm using some TOD-variables to schedule some things. Now I wanted to integrate them in HMI, I tried the approach below. However, I found no possibility to convert TIME to TOD. Can you maybe give a hint?

          T 1 Reply Last reply
          Reply Quote 0
          • T
            tomas_hora administrators @robert_n
            last edited by

            @robert_n You have to create your own function block in ST (have to be switched to full mode), past the code from the example above and create an Integer new variable, which will represent the time in seconds (you can easily change it in the function block to minutes).

            Then in the Main program, just pass the integer variable through the new function block to the TIME variable and you are done.

            1 Reply Last reply
            Reply Quote 0
            • R
              robert_n
              last edited by

              @tomas_hora Unfortunately that did not work for me because I do not use TIME variables, but TIME_OF_DAY. When I try to connect these two types, the compiler throws an error. I found a workaround to convert to TIME_OF_DAY with add_tod_time. This method means a lot of work to program the Function and HMI and it becomes slightly confusing...

              0_1496344282327_upload-0a05a185-28ca-4cf1-9de5-0c1936572795

              T 1 Reply Last reply
              Reply Quote 0
              • T
                tomas_hora administrators @robert_n
                last edited by

                @robert_n Well for that purpose, you could use one of the provided schedulers or no?

                1 Reply Last reply
                Reply Quote 0
                • zorro_66Z
                  zorro_66
                  last edited by tomas_hora

                  I have tried to do the function block
                  But i just get "build fail."
                  Do I have to write any more parameter in the block or matter it works directly

                  FUNCTION_BLOCK IntlToSec
                  	VAR_INPUT
                  		seconds_int: int;
                  	END_VAR
                  	VAR_OUTPUT
                  		out_time : TIME;
                  	END_VAR
                  
                  out_time := mul_time(time#1s, seconds_int);
                  END_FUNCTION_BLOCK
                  
                  T 1 Reply Last reply
                  Reply Quote 0
                  • T
                    tomas_hora administrators @zorro_66
                    last edited by

                    @zorro_66 is there any more info for the message Build fail?

                    1 Reply Last reply
                    Reply Quote 0
                    • zorro_66Z
                      zorro_66
                      last edited by

                      Indicates that it is wrong in any column
                      But the error changes depending on where I have the cursor standing
                      0_1496937540908_Build fail.jpg

                      T 1 Reply Last reply
                      Reply Quote 0
                      • T
                        tomas_hora administrators @zorro_66
                        last edited by

                        @zorro_66 Could you share the project? That might be easier to debug...

                        1 Reply Last reply
                        Reply Quote 0
                        • zorro_66Z
                          zorro_66
                          last edited by zorro_66

                          How can I send the project to you i tried to mail but it did not work.
                          I can not upload this one has no privileges so it's enough

                          T 1 Reply Last reply
                          Reply Quote 0
                          • T
                            tomas_hora administrators @zorro_66
                            last edited by

                            @zorro_66 Zip the archive and send me a link to google drive/dropbox or any other file sharing service...

                            1 Reply Last reply
                            Reply Quote 0
                            • zorro_66Z
                              zorro_66
                              last edited by

                              Hello
                              Tomas, you've probably got a link to Dropbox and my project
                              Sorry it took some time to fix but i have been on vacation

                              T 1 Reply Last reply
                              Reply Quote 0
                              • T
                                tomas_hora administrators @zorro_66
                                last edited by

                                @zorro_66 All input variables of a function block has to be connected or checked as not visible and set a default value. That is missing in your BD13_SwitchOffDelay of Interlocks program.

                                The second issue is, that in the PLC program mapping, you have mapped two programs that do not exist...

                                0_1497945373122_mervis_error.png

                                1 Reply Last reply
                                Reply Quote 0
                                • zorro_66Z
                                  zorro_66
                                  last edited by

                                  Thanks for the quick reply Tomas
                                  Well, I know I had nothing connected to that block but did not think it was the fault.
                                  Because it's on the position my time_Converter was supposed to enter.
                                  Which two programs have I mapped that are not available

                                  T 1 Reply Last reply
                                  Reply Quote 0
                                  • T
                                    tomas_hora administrators @zorro_66
                                    last edited by

                                    @zorro_66 if you double click on the error in the result table, it will usually show you where the issue is... Or just read what it says.

                                    0_1497967748550_Screenshot_5.png

                                    1 Reply Last reply
                                    Reply Quote 0

                                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                    With your input, this post could be even better 💗

                                    Register Login
                                    • First post
                                      Last post