I have two questions - any help would be appreciated :)
1) how do I write a skill-procedure, which is executed every 10 seconds? (without blocking other processes)
2) how do I "wait" in an active skill (procedure/code) and execute all other procedures (started before) e.g.: The user pushed a button on my skill-app and some code is executed (e.g. running 1h). BUT the "mother" icfb must not be blocked permanently. (background process)
background: I use multible small apps/guis (hiCreateAppForm) in parallel. One of them is intended to monitor sim-progress.all is running fine. but i want to "automize" the "scan"-button to be executed periodically without blocking other apps permanently.
solution for 1) in windows/delphi would be the "ontimer"-event of an timer-objectsolution for 2) in windows/delphi would be to call "Application.ProcessMessages" regularly.
thanx in advance,
ps virtuoso env. 188.8.131.520.6.133
One thing to bear in mind is that SKILL is not multi-threaded. So there are some limits as to what you can do in this regard.
There is the ability to take advantage of the top level event loop to schedule things which are "sort of" in the background. See this Cadence Online Support Solution 11381132. This encapsulates the hiRegTimer() function in a package which makes it easy to schedule small background tasks. Please take note of the comments in the code about ensuring that jobs are kept short.
For bigger tasks which are likely to block (such as your 1 hour long job), the best solution is usually to use ipcBeginProcess to launch a background process (maybe an "icfb -nograph -restore script.il" session) - that way it is being executed in an entirely different process.
The "timer" function is hiRegTimer() and it accepts two arguments, the first is a string of the SKILL command that you wish to execute, and the second is the timer delay in tenths of seconds.
You could use a semaphore or global flag to indicate the status, and use a repeating timer function to check the status and reschedule the next timer event, or not if everything is done. Make sure that there is a way to override or kill such a repeating timer event too, and make sure that it is not possible to run two or more at the same time.
Hope this is what you were looking for?
In reply to skillUser:
Thanks Lawrence & Andrew!
My scripts are running now smoothly "as intended" :)Using a separate icfb via ipcBeginProcess would cause too much overhead for my approach, I guess. (massive delay, data transfer betw. apps/scripts).hiRegTimer is perfect/easy in my case.