09-22-2013 07:24 PM - edited 09-22-2013 07:33 PM
hi all
can anyone help
task-to start my program inside the timer with the start of Start_buttom press.
i have a question, i have a CVICALLBACK: call "Start_button" how can i put the timer control inside this function?
my timer can be found on CVI software under ,,,,,, Create>>Timer>>Timer
is there a advice or simple program/note for my reference?
Thanks alots
09-22-2013 11:47 PM
If you want to activate the timer inside a start button callback you can manipulate the enabled state of the timer using ATTR_ENABLED attribute with SetCtrlAttribute
If this is not suitable for your situation, please explain in more details your application schema and the expected behaviour.
09-23-2013 12:23 AM
i think this is what i want, but can you show me a simple porgram on how to write? cos i new to CVI Thanks
09-23-2013 01:36 AM
Well, supposing you have a start button and a timer control on the same panel, inside the button callback you can do the following:
int CVICALLBACK StartCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { if (event != EVENT_COMMIT) return 0; SetCtrlAttribute (panel, PANEL_TIMER, ATTR_ENABLED, 1); return 0; }
If you are new to CVI you should consider spending some time through Getting Started manual and the exercises included in it, or at least stadying the examples supplied with the product: this will save you some headaches as you gradually get more involved in programming.