08-07-2017 02:42 AM
Help please
Hello;
I would like to display on my GUI a time decomter in form (: days: hours: minutes: seconds), I managed to display it on my GUI but the probeleme is that it does not count !?
I would like to know what is the function that allows me to display deducing counter on my GUI
Ps (I send the time from teststand in seconds)
Thank you
08-07-2017 03:15 AM
There is no automatic means to display data on a CVI panel. If you want to have the clock regularly updated you need some periodic task to do it: if you have a timer control or a periodic thread already active in your program you can add the clock update there, otherwise you can add a timer control for this task.
08-07-2017 03:21 AM
thanck you RobertoBozzolo for your answer
08-07-2017 06:11 AM
I want to call two functions:
How I will call them in Ontimer?
Thanck you
1) Function 1:
int __stdcall DLLEXPORT MPT_SYS_Display_RemTime_LED (int Index,int Status,int On_Off)
{
int Return_Value=0;
char CtrlName_LED[100]="";
int ID_LED;
if(Return_Value=CmtGetLock (LockIhmHandle)<0)
return Return_Value;
/* if (Return_Value=Fmt(CtrlName_LED, "%s<%s%d","ALIM_",Index)==-1)
goto Error;
if (Return_Value=GetCtrlName(CtrlName_LED)==-1)
goto Error;
ID_LED=TabResult[CtrlID]; */
if (Status==0)
{
if (Return_Value=SetCtrlAttribute (TabCtrlTab[tab_Rem][TabHandle], Remaining_Time_Led[Index], ATTR_ON_COLOR, VAL_GREEN)<0)
goto Error;
}
if (Status<0)
{
if (Return_Value=SetCtrlAttribute (TabCtrlTab[tab_Bench][TabHandle], Remaining_Time_Led[Index], ATTR_ON_COLOR, VAL_RED)<0)
goto Error;
}
if (Return_Value=SetCtrlAttribute (TabCtrlTab[tab_Rem][TabHandle], Remaining_Time_Led[Index], ATTR_CTRL_VAL, On_Off)<0)
goto Error;
Return_Value=CmtReleaseLock (LockIhmHandle);
return Return_Value;
Error :
CmtReleaseLock (LockIhmHandle);
return Return_Value;
}
2) Function 2
/***********************************************************************************************/
int __stdcall DLLEXPORT DisplayRemainingTime (int Index, char as8InputString[])
{
int Return_Value=0;
//int s32CtrlId;
//GetPanelHandleFromTabPage (pnlE01, PNL_E01_TAB, 1, &iMyTabHandle);
if(Return_Value = SetCtrlAttribute(TabCtrlTab[tab_Rem][TabHandle],Remaining_Time[Index] , ATTR_CTRL_VAL, as8InputString) < 0)
return Return_Value;
/* if(Return_Value = SetCtrlAttribute(TabResult[TabHandle],s32CtrlId, ATTR_CTRL_VAL, as8InputString) < 0)
return Return_Value; */
/*if(Return_Value = SetCtrlAttribute(TabCtrlTab[tab_All_Test_Lines][TabHandle], s32CtrlId, ATTR_CTRL_VAL, 22) < 0)
return Return_Value; */
return Return_Value;
}
3) My function OnTimer:
int CVICALLBACK OnTimer (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
return 0;
}
08-07-2017 12:38 PM
If the functions have been succesfully exported by the DLL you should be able to call them easily in the timer control callback, but I cannot help you in interfacing between TestStand and CVI as I don't use TestStand.