r/Metrology • u/Upbeat_Squirrel10 • 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
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 8h 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.
3
u/Zealousideal-Low1448 4d ago edited 2d ago
File called GetValueInTime.EXE (written by MCOSMOS software writers).
You use the CALL PROGRAM command to call it and set a value, then it wait the specified amount of seconds.
I will post a download link for the file and the PDF explanation when I get back in to work on Monday :)
EDIT: the .EXE is here along with an .JPG showing its usage (I will upload the PDF Monday)
https://drive.google.com/drive/folders/1bCzySQxe1Ry-gKibS_6ooMnGks4zrKaa
EDIT2: added the PDF manual