06-01-2015 08:26 AM - edited 06-01-2015 08:28 AM
Bonjour,
Je suis débutante en Labwindows CVI et j'ai trouvé des difficultés ,
Dans mon application j'ai trois volets :
1er volet: remplissage d'une structure
typedef struct
{
int id;
int x[10];
int y[10];
}Data;
2eme volet : Affichage du contenu de la structure
int CVICALLBACK timerAffichage (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_TIMER_TICK:
/*Code
plotXY (Courbe à travers le contenu de la structure Data)
*/
break;
}
return 0;
}
3eme volet :Mise a jour du contenu de la structure Data
int CVICALLBACK MiseAjourDonnees (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_TIMER_TICK:
/*Code
*/
break;
}
return 0;
}
J'ai utilisé deux timers (UI timers) l'un pour la mise à jour et l'autre pour l'affichage , je veux que ces deux timers s'exécutent en parallèle.
NB: Environnement materiel: PC DELL intel(R) Core(TM) 2DUO CPU
Enviroment Logiciel: Labwindows CVI 2010
06-01-2015 08:41 AM
Sorry for answering in English...
If you want the two timers run in parallel, why don't you use just one? (UI timer callbacks in CVI are called sequentially)
06-01-2015 08:48 AM
parce que les données à dessiner varient au cours de temps j'aimerais que l'affichage ne soit pas interrompu et au fur et à mesure on fait la mise à jour
06-01-2015 08:55 AM
You can synchronize all UI timers running on a panel (with the same interval) using ResetTimer ( panel_handle, 0 );
06-01-2015 09:06 AM
la mise a jour de la structure se fait chaque Heure et l'affichage se fait tout le temps
06-01-2015 10:10 AM
@FENM wrote:
la mise a jour de la structure se fait chaque Heure et l'affichage se fait tout le temps
I am afraid I did not understand your comment - this is what you want to have or what you have now?
06-01-2015 10:13 AM
...if you would prefer answers in french you might want to try in the francophone forum here
06-01-2015 10:21 AM
Right Now i have two UI timers, each one have a different interval but i want to run the both in parallel
06-01-2015 10:38 AM
06-11-2015 02:40 AM - edited 06-11-2015 02:41 AM
Thx Wolfgang,
I appreciate your help but i have a question ,
I use multithreading to deal with my problem but i have to protect a variable from not being used by the two threads in the same time.
By searching i found the solution of Thread Safe Var
the question is : In my case the type of variable is structure ??
Means:
typedef struct
{
int id;
int x[10];
int y[10];
}Data;
Data line;
Can i use the solution of Thread Safe Var to protect "line" ???