I would like to make a DM script acquiring camera images continuously, like VIEW mode. In my plan, the continious camera acquisition is start when START button located at an UIframe dialog is pressed; and a modeless dialog is also shown simultaneously. The continuous acuisition is stopped when the OK button located at the dialog is pressed. For this kind of scripts, I think a background thread is required. However, I don't have enough knowledge about such a background running.
It will be appreciated if you share some wisdom. Thank you very much in advance.
Picking up on the kachigusa's comment to my other answer....
If you want to run a slow camera acquistion pseudo-continously, that is by performing repeated single readouts on a separate thread, then you may want to use a structure like the following:
There are of course several other constructs with a dialog governing a separate thread. This is just an example.
If you are going to start/stop something which performs in very regular intervals, but requires the main thread - another option would be to register/deregister periodic tasks from a dialog. Here is an example:
Continuous camera acquisition has actually nothing to do with background-threading in scripting, but rather requires setting the hardware into a continuous readout mode. This functionality is no supported by the official scripting API up to now.
However, there exits an extended, object-oriented scripting API which gives a more in-depth control over cameras. You will need to be versatile in the object-oriented coding style of DM-scripting to use it, and you will need to get in contact with Gatan to possibly get access to this script API, as it is not officially supported.
You may want to use the support-request form on the Gatan homepage for this. (button on bottom of page)