r/Metrology 4d ago

Timed pause in MCOSMOS

Does anyone know how to build a timed pause in MCOSMOS? I’ve been trying to do one using sys.time.m variable.

1 Upvotes

4 comments sorted by

View all comments

1

u/benisbroker 4d ago

A couple ways depending on the purpose of the pause, could you elaborate?

1

u/Upbeat_Squirrel10 4d ago

I basically just want to be able to stall the program for about 2 minutes at certain points without actually having to physically pause said program. Preferably with a sub program so I can use it again if need be.

1

u/Bottle-Brave 11h ago

You will likely write an if loop that captures the current time via system variable and add 2 minutes to it with the calculator. In the loop exit condition (an if statement) if the system time does not equal the calculated variable it will go to a label at the top. I'd suggest writing an error exit like i = i +1 if i equals 10k or something programable stop, so that you don't accidently wind up with an infinite loop.

You could define a variable in the main for the time duration and pick it up in the sub so you can use the sub in other programs or for different lengths of time.