Put delay in Structure Text



  • 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.


  • administrators

    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



  • 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.


Log in to reply