LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

StripChart Pause

Solved!
Go to solution
Hi,

I would like to pause the graph, but I can't stop it.
 
I receive data via serial line RS232 can this be affected by this?
 
When you press the "Pause" button scrollBar appears at the bottom, but the graph does not stop and continues farther, do you know how to do it?

Thank you
 
	int val;
	switch (event) {
		case EVENT_COMMIT:
			GetCtrlVal (panel, PANELPAUSE_PAUSE, &val);
			SetCtrlAttribute (panelsil, SILY_GRAFSIL, ATTR_STRIP_CHART_PAUSED,val);
			SetCtrlAttribute (panelvy, VYSKA_GRAFVYS, ATTR_STRIP_CHART_PAUSED,val);
			SetCtrlAttribute (panelvyk, VYKYVY_GRAFVYK, ATTR_STRIP_CHART_PAUSED,val); 
			
			break;
	}
	return 0;
}
0 Kudos
Message 1 of 8
(2,635 Views)

Hi,

 

ATTR_STRIP_CHART_PAUSED is only valid when the scroll mode is set to continuous.

 

jan

0 Kudos
Message 2 of 8
(2,603 Views)
Hi

I have all 3 charts set to continuous.
 
photos.jpg
0 Kudos
Message 3 of 8
(2,593 Views)

Hi,

 

Your graph window is set to 1024 points. You have to fill in 1024 points before you can scroll back in time. Make sure that the graph buffer (ATTR_HISTORY_BUFFER_SIZE) can hold more than 1024 points.

 

Jan

0 Kudos
Message 4 of 8
(2,576 Views)
Yes, I changed it to 900 points now and it stopped for a while, until he reached the scrollBar and the graph continued again. How much should I set it then?
How do I use ATTR_HISTORY_BUFFER_SIZE?
0 Kudos
Message 5 of 8
(2,565 Views)
Solution
Accepted by topic author MajklS

Hi,

It depends on your requirements. As a start you can set ATTR_HISTORY_BUFFER_SIZE to 10 times the points per screen:

 

Example

SetCtrlAttribute(hPanel, hCtrl, ATTR_SCROLL_MODE, VAL_CONTINUOUS);
SetCtrlAttribute(hPanel, hCtrl, ATTR_HISTORY_BUFFER_SIZE, 10*1024);
SetCtrlAttribute(hPanel, hCtrl, ATTR_POINTS_PER_SCREEN, 1024);

 

Jan

 

0 Kudos
Message 6 of 8
(2,559 Views)
Hi, great, it works, but when I click on the "Pause" button, the graph starts from the beginning and then you can scroll and when I click again, the graph starts again from the beginning, do you know why?
 
Should I put the HISTORY_BUFFER_SIZE setting in a graph or button function call?
int CVICALLBACK CallbackPauseGraph (int panel, int control, int event,
									void *callbackData, int eventData1, int eventData2) {
	int hod, val;
	switch (event) {
		case EVENT_COMMIT:
			GetCtrlVal (panel, PANELPAUSE_PAUSE, &val);
			SetCtrlAttribute (panelsil, SILY_GRAFSIL, ATTR_STRIP_CHART_PAUSED,val);
			SetCtrlAttribute (panelvy, VYSKA_GRAFVYS, ATTR_STRIP_CHART_PAUSED,val);
			SetCtrlAttribute (panelvyk, VYKYVY_GRAFVYK, ATTR_STRIP_CHART_PAUSED,val);
			
						SetCtrlAttribute(panelsil, SILY_GRAFSIL, ATTR_HISTORY_BUFFER_SIZE, 10*900);
						SetCtrlAttribute(panelsil, SILY_GRAFSIL, ATTR_POINTS_PER_SCREEN, 900);
						SetCtrlAttribute(panelvy, VYSKA_GRAFVYS, ATTR_HISTORY_BUFFER_SIZE, 10*900);
						SetCtrlAttribute(panelvy, VYSKA_GRAFVYS, ATTR_POINTS_PER_SCREEN, 900);	
			 			SetCtrlAttribute(panelvyk, VYKYVY_GRAFVYK, ATTR_HISTORY_BUFFER_SIZE, 10*900);
						SetCtrlAttribute(panelvyk, VYKYVY_GRAFVYK, ATTR_POINTS_PER_SCREEN, 900);
Before pressing:
scroll.jpg
After pressing the chart starts from over and can scroll scrollBar.
I don't want him to start over.
Untitled 2.jpg
0 Kudos
Message 7 of 8
(2,531 Views)
SOLVED
 
At the beginning of the program, the attribute was sufficient to insert into the body of the "main" function.

Thank you for your help

Thank you for solving "Gaus"
0 Kudos
Message 8 of 8
(2,523 Views)