Equivalent for C++ Sleep

Hi,

Is there an equivalent of the C++ Sleep function for BnR Automation C++?

Thanks and Regards,
Kenneth

Hi,

not as I know.
But even if there would be something comparable available, using a sleep() inside an isocronous realtime system could / would be very dangerous because of possible violations of the cycle times, so in cyclic systems “sleeping” should be avoided anyway in user tasks.

Best regards!

3 Likes

Hi,

there are some limitations which C++ functions could be used

Using the C++ Standard Library

and threading is not supported.

you can for example use a state machine to get something similar

  1. step: start a TON()
  2. step: wait for .Q output
4 Likes

As and addition to @christoph.hilchenbac s proposal.

You can use the functions and functionblocks from IEC libraries in C++.
Automation Help: Using function blocks in ANSI C / C++

2 Likes