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

    Put delay in Structure Text

    Scheduled Pinned Locked Moved Mervis
    3 Posts 2 Posters 872 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.
    • S
      smarko
      last edited by

      Hello,

      I want put delay in my structure text at the end of the LOOP. Because i make measure and sub 2 measures of the differents numbers of loops. The delay is 8ms of n and n+1.

      So my measure of Temperature is the same and my sub is equal to 0.

      I want make like arduino code : "delay(50);"
      but i know this option is maybe not easy to put in Structure Text.

      If someone have a idea to put a simple delay in my LOOP.

      1 Reply Last reply
      Reply Quote 0
      • Martin KudláčekM
        Martin Kudláček
        last edited by

        Hello @smarko,
        putting hard delays is a bad idea, even in Arduino. You can start a delay timer and with each cycle check if it finished. When it finishes, you can perform the desired action.

        Best regards,
        Martin

        1 Reply Last reply
        Reply Quote 0
        • S
          smarko
          last edited by

          Yeah , but i don't see in my case how put delay timer because my cycle finish if time and not action. to example "The object finish to move" i put delay with "TON" so boolean i understand how to make but not with time.

          I try this with DO WHILE but the program don’t block in the DO WHILE and the refresh of temps_1 and temps_2 is the same so diff_temp =0

          af182fd2-2613-4e15-957a-6dbf05d69092-image.png

          I want maybe 30/50 ms of delay to have a good derivate of my temperature. Do you have idea how use delay timer to have 1 times of the PLC not refresh and one other refresh and when the sub is good the action is make ?

          i try getevaltime4,detdeltime4,plc time,..etc i'm block.

          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