LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access stripchart in extra panel

Hi,

I´m quite stuck right now: When I create a Stripchart on a "basic" panel, i can do whatever i want.
Now i loaded an additional panel and wanted to plot on it:

PlotStripChart (panel, GRAFPANEL_LOGCHART, dRamValue, 1, 0, 0,VAL_DOUBLE);

("panel" is the right handle - returned by the callback function).
This is done by a left_click event of the respective panel. All i get is a "non-fatal run-time error" - "the control is not the type expected by the function".
Exactly this function worked in the configuration before without any problem.

Can anyone please tell me waht i did wrong?

I use Labwindows 6.0

|)oS
0 Kudos
Message 1 of 4
(3,082 Views)
This kind of error is usually received when you are addressing a control in a panel passing to the function the handle of another panel.

The UIR editor creates macros for addressing the individual controls on each panel (look into the include file automatically generated): those macros are really integer values, that is when you address the control GRAFPANEL_LOGCHART you are really using for example 'the 3rd control in the panel', so if 'panel' holds an incorrect panel handle, the 3rd control in the panel really pointed to by 'panel' variable is another type of control, and you receive that kind of error.

You have to check your source code to verify that the panel handle you are using is the correct one.

By the way, 'panel' is the default variabl
e name for a control or a panel callback, that holds the handle of the panel that is triggering the callback; you should not re-use this variable in the panel or control's callback. That is, your code should look as follows:

int CVICALLBACK YourPanelCallback (int panel, int event, void *callbackData, int eventData1, int eventData2)
{
int pH;

// Your code here

pH = LoadPanel (0, "file.uir", GRAFPANEL);
PlotStripChart (pH, GRAFPANEL_LOGCHART, dRamValue, 1, 0, 0,VAL_DOUBLE);
DisplayPanel (pH);

return 0;
}

Hope this helps
Roberto


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
(3,082 Views)
Hi Roberto,

thanks for your reply.

I´m such an idiot! It´s not what you mentioned above - i was well aware of the use of that panel handlers.
But your reply told me that cannot be an error in the system.
So I went on digging. I was just upgrading to LW 6.0. So I changed the controlls to the ones more fancy looking that the "6.0" provides.
But i changed the "stripchart" to "graph". And that was the cause for all the trouble.

Thanks again for you reply!

|)oS
0 Kudos
Message 3 of 4
(3,082 Views)
I'm glad to have helped you a little.
I apologize if sometimes I have a 'professor' attitude in my answers: it's difficult from a simple question to understand if the author has recently begun to work with CVI or is an experienced programmer, so it may happen that the answer is not well adapted to sender's background.

Roberto


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?
0 Kudos
Message 4 of 4
(3,082 Views)