12-13-2005 08:03 AM
12-13-2005 09:12 AM
12-13-2005 11:01 AM
12-13-2005 11:12 AM
Good option that macro!
In case you do prefere some actual instruction instead of a macro, you can use BeingDebuggedByCVI () which returns 1 if the program is running in the IDE. So you can setup the timer with this instruction:
SetCtrlAttribute (your_panel, your_timer_control, ATTR_ENABLED, !BeingDebuggedByCVI());
12-14-2005 03:41 AM
Thanks for the suggestions.
The one thought I have with the proposed suggestions is: -
As the UIR is not part of the executable and is available for all programs to see and use, if one program disables the Timer on the UIR will this not be disable the Timer for all programs that access this UIR, or is the Timer activation / de-activation only performed on a per program basis?
12-14-2005 04:07 AM
Don't worry about that. A UIR file is only read by a program. It will not be modified.
The UIR file is read into a program with the LoadPanel function. If later in this program settings of timers, buttons or whatever are changed, this does not affect the UIR file. So when another program loads this UIR file, it is loaded with the original settings.
12-19-2005 04:07 PM
I don't really have much to add to this discussion except for a rather general recommendation.
I would suggest using an asynchronous timer instead of the timer control on a panel in a UIR file. Asynchronous timers run in their own threads and are much more reliable (and predictable). UIR timers can miss firing their callbacks if the system is busy processing other events. The asynchronous timer will not do this as it is running in its own thread with its own processor time.