LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric slide problem

Solved!
Go to solution

Hi,

 

I have un update problem on a numeric slide. I use this slide in a loading window.

The slide looks fine form 0 to 100 but when its return to 0 i see a dark line at the correct position but the slide is fully fill:

KO.JPG

 

I use this code:

 

static int CVICALLBACK Banner_TH (void *functionData)
{
	int i =0;
	
	do
	{
		if (i>=100)
		{
			i = 0;
		}	
		else
		{	
			i=i+1;
		}
		SetCtrlVal (panel_Handle,LOAD_PAN_WAIT ,i ); 
		ProcessDrawEvents ();
		
		Delay(0.1);
	}
	while(!_stopThread);
	
	HidePanel( panel_Handle ); 
	
	
	return 0;
}

 and this one to call:

SetCtrlVal (panel_Handle,LOAD_PAN_WAIT ,0 ); 
	
	//Start Banner in thread
	_stopThread = 0;
	
	CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE,
								   Banner_TH, NULL,&_threadID );

 If someone have an idea? Smiley Frustrated

 

Thanks

Cordialement,

Simon D.
CLA | Certified LabVIEW Architect
CTA | Certified TestStand Architect
0 Kudos
Message 1 of 4
(2,979 Views)
Solution
Accepted by topic author SimonD

I can only think to some problem when updating a control in a thread that dows not own the panel where the control lies.

You could PostDeferredCall in the thread a function that updates the control, passing its value in function callbackData: the deferred callback is executed in the main thread, which is the one that normally handles the user interface unless you have loaded the panel in the separate thread (which you are not doing).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(2,974 Views)

OK thanks, i will try the PostDeferredCall.

Cordialement,

Simon D.
CLA | Certified LabVIEW Architect
CTA | Certified TestStand Architect
0 Kudos
Message 3 of 4
(2,960 Views)

I solve the problem by loading the panel in the thread which update the control. So I update a control owned by a panel in the same thread.

Thank you for tell me the origin of this problem Smiley Wink

Cordialement,

Simon D.
CLA | Certified LabVIEW Architect
CTA | Certified TestStand Architect
0 Kudos
Message 4 of 4
(2,951 Views)