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

    Put delay in Structure Text

    Mervis
    2
    3
    62
    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áček
        Martin Kudláček administrators 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
          • First post
            Last post